Skip to content

Commit fccbfa5

Browse files
committed
fallback in ui_config
1 parent 5f2e083 commit fccbfa5

File tree

1 file changed

+14
-5
lines changed
  • services/static-webserver/client/source/class/osparc/store

1 file changed

+14
-5
lines changed

services/static-webserver/client/source/class/osparc/store/Products.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,21 @@ qx.Class.define("osparc.store.Products", {
3434
});
3535
}
3636

37-
return osparc.data.Resources.fetch("productMetadata", "getUiConfig")
38-
.then(uiConfig => {
39-
const product = osparc.product.Utils.getProductName()
40-
if (product in uiConfig) {
41-
this.__uiConfig = uiConfig[product];
37+
return Promise.all([
38+
osparc.data.Resources.fetch("productMetadata", "getUiConfig"),
39+
osparc.utils.Utils.fetchJSON("/resource/osparc/ui_config.json"),
40+
])
41+
.then(values => {
42+
let uiConfig = {};
43+
if (values[0] && values[0]["ui"] && Object.keys(values[0]["ui"]).length) {
44+
uiConfig = values[0]["ui"];
45+
} else {
46+
const product = osparc.product.Utils.getProductName();
47+
if (values[1] && product in values[1]) {
48+
uiConfig = values[1][product];
49+
}
4250
}
51+
this.__uiConfig = uiConfig;
4352
return this.__uiConfig;
4453
})
4554
.catch(console.error);

0 commit comments

Comments
 (0)