| 
15 | 15 | 
  | 
16 | 16 | ************************************************************************ */  | 
17 | 17 | 
 
  | 
18 |  | -/**  | 
19 |  | - * @asset(osparc/ui_config.json")  | 
20 |  | - */  | 
21 |  | - | 
22 | 18 | /**  | 
23 | 19 |  * Widget that shows lists user's studies.  | 
24 | 20 |  *  | 
@@ -979,39 +975,36 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {  | 
979 | 975 |       this._resourcesContainer.addNonResourceCard(newPlansBtn);  | 
980 | 976 |       newPlansBtn.setEnabled(false);  | 
981 | 977 | 
 
  | 
982 |  | -      osparc.utils.Utils.fetchJSON("/resource/osparc/ui_config.json")  | 
983 |  | -        .then(newStudiesData => {  | 
984 |  | -          const product = osparc.product.Utils.getProductName()  | 
985 |  | -          if (product in newStudiesData) {  | 
986 |  | -            newPlansBtn.setEnabled(true);  | 
987 |  | - | 
988 |  | -            newPlansBtn.addListener("tap", () => {  | 
989 |  | -              osparc.data.Resources.get("templates")  | 
990 |  | -                .then(templates => {  | 
991 |  | -                  if (templates) {  | 
992 |  | -                    const newStudies = new osparc.dashboard.NewStudies(newStudiesData[product]);  | 
993 |  | -                    newStudies.addListener("templatesLoaded", () => {  | 
994 |  | -                      newStudies.setGroupBy("category");  | 
995 |  | -                      const winTitle = this.tr("New Plan");  | 
996 |  | -                      const win = osparc.ui.window.Window.popUpInWindow(newStudies, winTitle, osparc.dashboard.NewStudies.WIDTH+40, 300).set({  | 
997 |  | -                        clickAwayClose: false,  | 
998 |  | -                        resizable: true  | 
999 |  | -                      });  | 
1000 |  | -                      newStudies.addListener("newStudyClicked", e => {  | 
1001 |  | -                        win.close();  | 
1002 |  | -                        const templateInfo = e.getData();  | 
1003 |  | -                        const templateData = templates.find(t => t.name === templateInfo.expectedTemplateLabel);  | 
1004 |  | -                        if (templateData) {  | 
1005 |  | -                          this.__newPlanBtnClicked(templateData, templateInfo.newStudyLabel);  | 
1006 |  | -                        }  | 
1007 |  | -                      });  | 
1008 |  | -                      osparc.utils.Utils.setIdToWidget(win, "newStudiesWindow");  | 
1009 |  | -                    });  | 
1010 |  | -                  }  | 
 | 978 | +      const newStudiesData = osparc.store.Products.getInstance().getNewStudiesUiConfig();  | 
 | 979 | +      if (newStudiesData) {  | 
 | 980 | +        newPlansBtn.setEnabled(true);  | 
 | 981 | + | 
 | 982 | +        newPlansBtn.addListener("tap", () => {  | 
 | 983 | +          osparc.data.Resources.get("templates")  | 
 | 984 | +            .then(templates => {  | 
 | 985 | +              if (templates) {  | 
 | 986 | +                const newStudies = new osparc.dashboard.NewStudies(newStudiesData);  | 
 | 987 | +                newStudies.addListener("templatesLoaded", () => {  | 
 | 988 | +                  newStudies.setGroupBy("category");  | 
 | 989 | +                  const winTitle = this.tr("New Plan");  | 
 | 990 | +                  const win = osparc.ui.window.Window.popUpInWindow(newStudies, winTitle, osparc.dashboard.NewStudies.WIDTH+40, 300).set({  | 
 | 991 | +                    clickAwayClose: false,  | 
 | 992 | +                    resizable: true  | 
 | 993 | +                  });  | 
 | 994 | +                  newStudies.addListener("newStudyClicked", e => {  | 
 | 995 | +                    win.close();  | 
 | 996 | +                    const templateInfo = e.getData();  | 
 | 997 | +                    const templateData = templates.find(t => t.name === templateInfo.expectedTemplateLabel);  | 
 | 998 | +                    if (templateData) {  | 
 | 999 | +                      this.__newPlanBtnClicked(templateData, templateInfo.newStudyLabel);  | 
 | 1000 | +                    }  | 
 | 1001 | +                  });  | 
 | 1002 | +                  osparc.utils.Utils.setIdToWidget(win, "newStudiesWindow");  | 
1011 | 1003 |                 });  | 
 | 1004 | +              }  | 
1012 | 1005 |             });  | 
1013 |  | -          }  | 
1014 | 1006 |         });  | 
 | 1007 | +      }  | 
1015 | 1008 |     },  | 
1016 | 1009 | 
 
  | 
1017 | 1010 |     // Used in S4L products  | 
@@ -1042,16 +1035,13 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {  | 
1042 | 1035 | 
 
  | 
1043 | 1036 |     __addPlusButtonsFromServices: function() {  | 
1044 | 1037 |       // add new plus buttons if key services exists  | 
1045 |  | -      osparc.utils.Utils.fetchJSON("/resource/osparc/ui_config.json")  | 
1046 |  | -        .then(newStudiesData => {  | 
1047 |  | -          const product = osparc.product.Utils.getProductName()  | 
1048 |  | -          if (product in newStudiesData) {  | 
1049 |  | -            const newButtonsInfo = newStudiesData[product].resources;  | 
1050 |  | -            newButtonsInfo.forEach(newButtonInfo => {  | 
1051 |  | -              this.__addNewStudyFromServiceButtons(newButtonInfo.expectedKey, newButtonInfo);  | 
1052 |  | -            });  | 
1053 |  | -          }  | 
 | 1038 | +      const newStudiesData = osparc.store.Products.getInstance().getNewStudiesUiConfig();  | 
 | 1039 | +      if (newStudiesData) {  | 
 | 1040 | +        const newButtonsInfo = newStudiesData["resources"];  | 
 | 1041 | +        newButtonsInfo.forEach(newButtonInfo => {  | 
 | 1042 | +          this.__addNewStudyFromServiceButtons(newButtonInfo.expectedKey, newButtonInfo);  | 
1054 | 1043 |         });  | 
 | 1044 | +      }  | 
1055 | 1045 |     },  | 
1056 | 1046 | 
 
  | 
1057 | 1047 |     // LAYOUT //  | 
 | 
0 commit comments