Skip to content

Commit 0c46002

Browse files
committed
refactor
1 parent 44cf984 commit 0c46002

File tree

1 file changed

+5
-9
lines changed
  • services/static-webserver/client/source/class/osparc/info

1 file changed

+5
-9
lines changed

services/static-webserver/client/source/class/osparc/info/StudyLarge.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ qx.Class.define("osparc.info.StudyLarge", {
2727
this.base(arguments);
2828

2929
this.setStudy(study);
30-
if ("resourceType" in study) {
31-
this.__isTemplate = study["resourceType"] === "template";
32-
}
3330

3431
if (openOptions !== undefined) {
3532
this.setOpenOptions(openOptions);
@@ -51,8 +48,6 @@ qx.Class.define("osparc.info.StudyLarge", {
5148
},
5249

5350
members: {
54-
__isTemplate: null,
55-
5651
__canIWrite: function() {
5752
return osparc.data.model.Study.canIWrite(this.getStudy().getAccessRights());
5853
},
@@ -67,7 +62,7 @@ qx.Class.define("osparc.info.StudyLarge", {
6762
vBox.add(infoLayout);
6863

6964
let text = osparc.product.Utils.getStudyAlias({firstUpperCase: true}) + " Id";
70-
if (this.__isTemplate) {
65+
if (this.getStudy().getTemplateType()) {
7166
text = osparc.product.Utils.getTemplateAlias({firstUpperCase: true}) + " Id";
7267
}
7368
const copyIdButton = new qx.ui.form.Button(null, "@FontAwesome5Solid/copy/12").set({
@@ -179,7 +174,8 @@ qx.Class.define("osparc.info.StudyLarge", {
179174
};
180175
}
181176

182-
if (!this.__isTemplate) {
177+
if (this.getStudy().getTemplateType() === null) {
178+
// studies only
183179
const pathLabel = new qx.ui.basic.Label();
184180
pathLabel.setValue(this.getStudy().getLocationString());
185181
infoLayout["LOCATION"] = {
@@ -225,7 +221,7 @@ qx.Class.define("osparc.info.StudyLarge", {
225221

226222
__openAccessRights: function() {
227223
const studyData = this.getStudy().serialize();
228-
studyData["resourceType"] = this.__isTemplate ? "template" : "study";
224+
studyData["resourceType"] = this.getStudy().getTemplateType() ? "template" : "study";
229225
const collaboratorsView = osparc.info.StudyUtils.openAccessRights(studyData);
230226
collaboratorsView.addListener("updateAccessRights", e => {
231227
const updatedData = e.getData();
@@ -307,7 +303,7 @@ qx.Class.define("osparc.info.StudyLarge", {
307303
__patchStudy: function(fieldKey, value) {
308304
this.getStudy().patchStudy({[fieldKey]: value})
309305
.then(studyData => {
310-
studyData["resourceType"] = this.__isTemplate ? "template" : "study";
306+
studyData["resourceType"] = this.getStudy().getTemplateType() ? "template" : "study";
311307
this.fireDataEvent("updateStudy", studyData);
312308
qx.event.message.Bus.getInstance().dispatchByName("updateStudy", studyData);
313309
})

0 commit comments

Comments
 (0)