Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix theme switch in website #10724

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions packages/website/src/components/Editor/playground-support.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const loadThemeProperties = async (themeName) => {
};
const loadAndCheck = async (themeName) => {
const data = await loadThemeProperties(themeName);

if (typeof data === "string" && data.endsWith(".json")) {
throw new Error("error");
}
const result = {_:data}
return result;
return data;
};

["sap_fiori_3", "sap_fiori_3_dark", "sap_fiori_3_hcb", "sap_fiori_3_hcw", "sap_horizon", "sap_horizon_dark", "sap_horizon_hcb", "sap_horizon_hcw"]
Expand All @@ -54,8 +54,7 @@ const loadAndCheckFiori = async (themeName) => {
if (typeof data === "string" && data.endsWith(".json")) {
throw new Error("error");
}
const result = {_:data}
return result;
return data;
};

["sap_fiori_3", "sap_fiori_3_dark", "sap_fiori_3_hcb", "sap_fiori_3_hcw", "sap_horizon", "sap_horizon_dark", "sap_horizon_hcb", "sap_horizon_hcw"]
Expand All @@ -80,8 +79,7 @@ const loadAndCheckCompat = async (themeName) => {
if (typeof data === "string" && data.endsWith(".json")) {
throw new Error("error");
}
const result = {_:data}
return result;
return data;
};

["sap_fiori_3", "sap_fiori_3_dark", "sap_fiori_3_hcb", "sap_fiori_3_hcw", "sap_horizon", "sap_horizon_dark", "sap_horizon_hcb", "sap_horizon_hcw"]
Expand All @@ -108,8 +106,7 @@ const loadAndCheckAI = async (themeName) => {
if (typeof data === "string" && data.endsWith(".json")) {
throw new Error("error");
}
const result = {_:data}
return result;
return data;
};

["sap_fiori_3", "sap_fiori_3_dark", "sap_fiori_3_hcb", "sap_fiori_3_hcw", "sap_horizon", "sap_horizon_dark", "sap_horizon_hcb", "sap_horizon_hcw"]
Expand All @@ -134,7 +131,7 @@ const loadAndCheck2 = async (themeName) => {
if (typeof data === "string" && data.endsWith(".json")) {
throw new Error("error");
}
return {_:data};
return data;
};
["sap_fiori_3", "sap_fiori_3_dark", "sap_fiori_3_hcb", "sap_fiori_3_hcw", "sap_horizon", "sap_horizon_dark", "sap_horizon_hcb", "sap_horizon_hcw"]
.forEach(themeName => registerThemePropertiesLoader("@ui5/webcomponents-theming", themeName, loadAndCheck2));
Expand Down