Skip to content

Commit b537b67

Browse files
authored
🎨 Redesign: Study information page (#4396)
1 parent f61f6ea commit b537b67

File tree

13 files changed

+304
-452
lines changed

13 files changed

+304
-452
lines changed

services/static-webserver/client/source/class/osparc/component/snapshots/IterationsView.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ qx.Class.define("osparc.component.snapshots.IterationsView", {
138138

139139
const iterationData = this.__iterations[idx];
140140
const iteration = new osparc.data.model.Study(iterationData);
141-
iteration.buildWorkbench();
142141
iteration.setReadOnly(true);
143142
iteration.nodeUpdated(dataUpdate);
144143
const iterationDataUpdated = iteration.serialize(false);
@@ -171,7 +170,6 @@ qx.Class.define("osparc.component.snapshots.IterationsView", {
171170
if (idx > -1) {
172171
const iterationData = this.__iterations[idx];
173172
const iteration = new osparc.data.model.Study(iterationData);
174-
iteration.buildWorkbench();
175173
iteration.setReadOnly(true);
176174
this.__iterationPreview.setStudy(iteration);
177175
this.__iterationPreview.loadModel(iteration.getWorkbench());
@@ -221,7 +219,6 @@ qx.Class.define("osparc.component.snapshots.IterationsView", {
221219
}
222220

223221
const study = new osparc.data.model.Study(studyData);
224-
study.buildWorkbench();
225222
study.setReadOnly(true);
226223
this.__iterationPreview.set({
227224
study: study

services/static-webserver/client/source/class/osparc/component/snapshots/SnapshotsView.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ qx.Class.define("osparc.component.snapshots.SnapshotsView", {
219219
studyData["workbench"] = data["workbench"];
220220
studyData["ui"] = data["ui"];
221221
const study = new osparc.data.model.Study(studyData);
222-
study.buildWorkbench();
223222
study.setReadOnly(true);
224223
this.__snapshotPreview.set({
225224
study: study

services/static-webserver/client/source/class/osparc/component/workbench/WorkbenchUI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", {
19331933
if (!this.isPropertyInitialized("study") || this.__startHint === null) {
19341934
return;
19351935
}
1936-
const isEmptyWorkspace = this.getStudy().isPipelineEmtpy();
1936+
const isEmptyWorkspace = this.getStudy().isPipelineEmpty();
19371937
this.__startHint.setVisibility(isEmptyWorkspace ? "visible" : "excluded");
19381938
if (isEmptyWorkspace) {
19391939
const hintBounds = this.__startHint.getBounds() || this.__startHint.getSizeHint();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ qx.Class.define("osparc.dashboard.ResourceMoreOptions", {
4040
},
4141

4242
statics: {
43-
WIDTH: 710,
44-
HEIGHT: 710,
43+
WIDTH: 715,
44+
HEIGHT: 715,
4545

4646
popUpInWindow: function(moreOpts) {
4747
const title = qx.locale.Manager.tr("Details");

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,21 @@ qx.Class.define("osparc.dashboard.StudyThumbnailExplorer", {
8686
},
8787

8888
__getNodesTree: function() {
89-
const study = new osparc.data.model.Study(this.__studyData);
90-
study.buildWorkbench();
9189
const nodesTree = new osparc.component.widget.NodesTree().set({
9290
hideRoot: false,
9391
simpleNodes: true
9492
});
93+
const study = new osparc.data.model.Study(this.__studyData);
94+
// Do not show the nodes tree if it's a mononode study
95+
if (study.isPipelineMononode()) {
96+
nodesTree.exclude();
97+
}
9598
nodesTree.setStudy(study);
9699
return nodesTree;
97100
},
98101

99102
__getThumbnailSuggestions: function() {
100103
const study = new osparc.data.model.Study(this.__studyData);
101-
study.buildWorkbench();
102104
const thumbnailSuggestions = new osparc.component.editor.ThumbnailSuggestions().set({
103105
minHeight: this.self().THUMBNAIL_SLIDER_HEIGHT,
104106
maxHeight: this.self().THUMBNAIL_SLIDER_HEIGHT
@@ -153,7 +155,6 @@ qx.Class.define("osparc.dashboard.StudyThumbnailExplorer", {
153155

154156
__getWorkbenchUIPreview: function() {
155157
const study = new osparc.data.model.Study(this.__studyData);
156-
study.buildWorkbench();
157158
// make nodes not movable
158159
study.setReadOnly(true);
159160
const workbenchUIPreview = new osparc.component.workbench.WorkbenchUIPreview();

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ qx.Class.define("osparc.data.model.Study", {
6565
workbench.setStudy(this);
6666

6767
this.setUi(new osparc.data.model.StudyUI(studyData.ui));
68+
69+
this.__buildWorkbench();
6870
},
6971

7072
properties: {
@@ -311,7 +313,7 @@ qx.Class.define("osparc.data.model.Study", {
311313
},
312314

313315
members: {
314-
buildWorkbench: function() {
316+
__buildWorkbench: function() {
315317
this.getWorkbench().buildWorkbench();
316318
},
317319

@@ -457,10 +459,14 @@ qx.Class.define("osparc.data.model.Study", {
457459
return false;
458460
},
459461

460-
isPipelineEmtpy: function() {
462+
isPipelineEmpty: function() {
461463
return Object.keys(this.getWorkbench().getNodes()).length === 0;
462464
},
463465

466+
isPipelineMononode: function() {
467+
return Object.keys(this.getWorkbench().getNodes()).length === 1;
468+
},
469+
464470
__applyAccessRights: function(accessRights) {
465471
if (this.isSnapshot()) {
466472
this.setReadOnly(true);

services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
171171

172172
this.__reloadSnapshotsAndIterations();
173173

174-
study.buildWorkbench();
175174
study.openStudy()
176175
.then(() => {
177176
this.__lastSavedStudy = study.serialize();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ qx.Class.define("osparc.info.MergedLarge", {
218218
},
219219

220220
__createExtraInfo: function(extraInfo) {
221-
const moreInfo = osparc.info.StudyUtils.createExtraInfo(extraInfo).set({
221+
const moreInfo = osparc.info.StudyUtils.createExtraInfoGrid(extraInfo).set({
222222
width: osparc.info.CardLarge.EXTRA_INFO_WIDTH
223223
});
224224

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

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,27 @@ qx.Class.define("osparc.info.ServiceLarge", {
179179

180180
__extraInfo: function() {
181181
const extraInfo = [{
182-
label: this.tr("Version"),
182+
label: this.tr("KEY"),
183+
view: this.__createKey(),
184+
action: {
185+
button: osparc.utils.Utils.getCopyButton(),
186+
callback: this.__copyKeyToClipboard,
187+
ctx: this
188+
}
189+
}, {
190+
label: this.tr("VERSION"),
183191
view: this.__createVersion(),
184192
action: null
185193
}, {
186-
label: this.tr("Contact"),
194+
label: this.tr("CONTACT"),
187195
view: this.__createContact(),
188196
action: null
189197
}, {
190-
label: this.tr("Authors"),
198+
label: this.tr("AUTHORS"),
191199
view: this.__createAuthors(),
192200
action: null
193201
}, {
194-
label: this.tr("Access Rights"),
202+
label: this.tr("ACCESS RIGHTS"),
195203
view: this.__createAccessRights(),
196204
action: {
197205
button: osparc.utils.Utils.getViewButton(),
@@ -200,9 +208,12 @@ qx.Class.define("osparc.info.ServiceLarge", {
200208
}
201209
}];
202210

203-
if (this.getService()["classifiers"]) {
211+
if (
212+
osparc.product.Utils.showClassifiers() &&
213+
this.getService()["classifiers"]
214+
) {
204215
extraInfo.push({
205-
label: this.tr("Classifiers"),
216+
label: this.tr("CLASSIFIERS"),
206217
view: this.__createClassifiers(),
207218
action: {
208219
button: osparc.utils.Utils.getViewButton(),
@@ -218,7 +229,7 @@ qx.Class.define("osparc.info.ServiceLarge", {
218229
osparc.component.metadata.Quality.isEnabled(this.getService()["quality"])
219230
) {
220231
extraInfo.push({
221-
label: this.tr("Quality"),
232+
label: this.tr("QUAILITY"),
222233
view: this.__createQuality(),
223234
action: {
224235
button: osparc.utils.Utils.getViewButton(),
@@ -230,7 +241,7 @@ qx.Class.define("osparc.info.ServiceLarge", {
230241

231242
if (this.getNodeId()) {
232243
extraInfo.splice(0, 0, {
233-
label: this.tr("Service ID"),
244+
label: this.tr("SERVICE ID"),
234245
view: this.__createNodeId(),
235246
action: {
236247
button: osparc.utils.Utils.getCopyButton(),
@@ -240,16 +251,6 @@ qx.Class.define("osparc.info.ServiceLarge", {
240251
});
241252
}
242253

243-
extraInfo.splice(1, 0, {
244-
label: this.tr("Key"),
245-
view: this.__createKey(),
246-
action: {
247-
button: osparc.utils.Utils.getCopyButton(),
248-
callback: this.__copyKeyToClipboard,
249-
ctx: this
250-
}
251-
});
252-
253254
return extraInfo;
254255
},
255256

0 commit comments

Comments
 (0)