Skip to content

Commit 9065479

Browse files
committed
refactor
1 parent bcc60b5 commit 9065479

File tree

5 files changed

+22
-66
lines changed

5 files changed

+22
-66
lines changed

services/static-webserver/client/source/class/osparc/task/Duplicate.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,14 @@ qx.Class.define("osparc.task.Duplicate", {
1919
extend: osparc.task.TaskUI,
2020

2121
construct: function(studyName) {
22-
this.__studyName = studyName;
23-
2422
this.base(arguments);
23+
24+
this.setIcon(this.self().ICON+"/14");
25+
this.setTitle(this.tr("Duplicating:"));
26+
this.setSubtitle(studyName);
2527
},
2628

2729
statics: {
2830
ICON: "@FontAwesome5Solid/copy"
2931
},
30-
31-
members: {
32-
__studyName: null,
33-
34-
// overridden
35-
_buildLayout: function() {
36-
this.setIcon(this.self().ICON+"/14");
37-
this.getChildControl("title");
38-
this.getChildControl("subtitle");
39-
this.getChildControl("stop");
40-
41-
this.setTitle(this.tr("Duplicating:"));
42-
this.setSubtitle(this.__studyName);
43-
}
44-
}
4532
});

services/static-webserver/client/source/class/osparc/task/Export.js

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,14 @@ qx.Class.define("osparc.task.Export", {
1919
extend: osparc.task.TaskUI,
2020

2121
construct: function(study) {
22-
this.__study = study;
23-
2422
this.base(arguments);
23+
24+
this.setIcon(this.self().ICON+"/14");
25+
this.setTitle(this.tr("Exporting:"));
26+
this.setSubtitle(study.name);
2527
},
2628

2729
statics: {
2830
ICON: "@FontAwesome5Solid/cloud-download-alt"
2931
},
30-
31-
members: {
32-
__study: null,
33-
34-
// overridden
35-
_buildLayout: function() {
36-
this.setIcon(this.self().ICON+"/14");
37-
this.getChildControl("title");
38-
this.getChildControl("subtitle");
39-
this.getChildControl("stop");
40-
41-
this.setTitle(this.tr("Exporting ") + this.__study.name);
42-
}
43-
}
4432
});

services/static-webserver/client/source/class/osparc/task/Import.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,15 @@
1818
qx.Class.define("osparc.task.Import", {
1919
extend: osparc.task.TaskUI,
2020

21+
construct: function(studyName) {
22+
this.base(arguments);
23+
24+
this.setIcon(this.self().ICON+"/14");
25+
this.setTitle(this.tr("Importing..."));
26+
this.setSubtitle(studyName);
27+
},
28+
2129
statics: {
2230
ICON: "@FontAwesome5Solid/cloud-upload-alt"
2331
},
24-
25-
members: {
26-
// overridden
27-
_buildLayout: function() {
28-
this.setIcon(this.self().ICON+"/14");
29-
this.getChildControl("title");
30-
this.getChildControl("subtitle");
31-
this.getChildControl("stop");
32-
33-
this.setTitle(this.tr("Importing Study"));
34-
}
35-
}
3632
});

services/static-webserver/client/source/class/osparc/task/TaskUI.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ qx.Class.define("osparc.task.TaskUI", {
138138
this.getChildControl("icon").setSource(source);
139139
},
140140

141-
/**
142-
* @abstract
143-
*/
144141
_buildLayout: function() {
145-
throw new Error("Abstract method called!");
142+
this.getChildControl("title");
143+
this.getChildControl("subtitle");
146144
}
147145
}
148146
});

services/static-webserver/client/source/class/osparc/task/ToTemplate.js

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,14 @@ qx.Class.define("osparc.task.ToTemplate", {
1919
extend: osparc.task.TaskUI,
2020

2121
construct: function(studyName) {
22-
this.__studyName = studyName;
23-
2422
this.base(arguments);
23+
24+
this.setIcon(this.self().ICON+"/14");
25+
this.setTitle(this.tr("Publishing:"));
26+
this.setSubtitle(studyName);
2527
},
2628

2729
statics: {
2830
ICON: "@FontAwesome5Solid/copy"
2931
},
30-
31-
members: {
32-
__studyName: null,
33-
34-
// overridden
35-
_buildLayout: function() {
36-
this.setIcon(this.self().ICON+"/14");
37-
this.getChildControl("title");
38-
this.getChildControl("subtitle");
39-
this.getChildControl("stop");
40-
41-
this.setTitle(this.tr("Publishing:"));
42-
this.setSubtitle(this.__studyName);
43-
}
44-
}
4532
});

0 commit comments

Comments
 (0)