Skip to content

Commit da8110a

Browse files
committed
statics
1 parent 774fbfb commit da8110a

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

services/static-webserver/client/source/class/osparc/dashboard/Dashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,13 @@ qx.Class.define("osparc.dashboard.Dashboard", {
225225
},
226226

227227
__createTemplateBrowser: function() {
228-
const templateType = osparc.utils.DisabledPlugins.isHypertoolsEnabled() ? "tutorial" : null;
228+
const templateType = osparc.utils.DisabledPlugins.isHypertoolsEnabled() ? osparc.data.model.StudyUI.STANDARD_TYPE : null;
229229
const templatesView = this.__templateBrowser = new osparc.dashboard.TemplateBrowser(templateType);
230230
return templatesView;
231231
},
232232

233233
__createHypertoolsBrowser: function() {
234-
const templateType = "Hypertools";
234+
const templateType = osparc.data.model.StudyUI.HYPERTOOL_TYPE;
235235
const hypertoolsView = this.__hypertoolBrowser = new osparc.dashboard.TemplateBrowser(templateType);
236236
return hypertoolsView;
237237
},

services/static-webserver/client/source/class/osparc/data/model/StudyUI.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,18 @@ qx.Class.define("osparc.data.model.StudyUI", {
8383
},
8484

8585
templateType: {
86-
check: "String",
86+
check: [null, "tutorial", "hypertool"],
8787
init: null,
8888
nullable: true,
8989
event: "changeTemplateType",
9090
},
9191
},
9292

93+
statics: {
94+
STANDARD_TYPE: "tutorial",
95+
HYPERTOOL_TYPE: "hypertool",
96+
},
97+
9398
members: {
9499
__annotationsInitData: null,
95100

services/static-webserver/client/source/class/osparc/study/SaveAsTemplate.js

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,36 @@ qx.Class.define("osparc.study.SaveAsTemplate", {
4343

4444
members: {
4545
__studyDataClone: null,
46+
__copyWData: null,
47+
__templateTypeSB: null,
4648
__shareWith: null,
4749
__publishTemplateBtn: null,
48-
__copyWData: null,
4950

5051
__buildLayout: function() {
5152
const publishWithData = this.__copyWData = new qx.ui.form.CheckBox(this.tr("Publish with data")).set({
52-
value: true
53+
value: true,
54+
iconPosition: "right",
5355
});
5456
this._add(publishWithData);
5557

58+
if (osparc.utils.DisabledPlugins.isHypertoolsEnabled()) {
59+
const templateTypeSB = this.__templateTypeSB = new qx.ui.form.SelectBox();
60+
const countries = osparc.store.StaticInfo.getInstance().getCountries();
61+
[{
62+
label: "Standard",
63+
id: null,
64+
}, {
65+
label: "Hypertool",
66+
id: "hypertool",
67+
}]
68+
countries.forEach(c => {
69+
const cItem = new qx.ui.form.ListItem(c.name, null, c.alpha2).set({
70+
rich: true
71+
});
72+
templateTypeSB.add(cItem);
73+
});
74+
}
75+
5676
const shareWith = this.__shareWith = new osparc.share.ShareTemplateWith(this.__studyDataClone);
5777
this._add(shareWith);
5878

0 commit comments

Comments
 (0)