Skip to content

Commit c6c1946

Browse files
committed
support "pipeline"
1 parent 7facb7a commit c6c1946

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", {
481481
if (
482482
osparc.utils.Resources.isService(resourceData) ||
483483
!osparc.product.Utils.showStudyPreview() ||
484-
!(osparc.study.Utils.getUiMode(resourceData) === "workbench")
484+
["app", "guided", "standalone"].includes(osparc.study.Utils.getUiMode(resourceData))
485485
) {
486486
// there is no pipelining or don't show it
487487
return null;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,7 +1811,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
18111811
confirmationWin.getChildControl("buttons-layout").addAt(copyOptionButton, 0);
18121812
confirmationWin.addListener("close", () => {
18131813
if (confirmationWin.getConfirmed()) {
1814-
this.__updateUIMode(studyData, "workbench")
1814+
this.__updateUIMode(studyData, "pipeline")
18151815
.then(() => osparc.FlashMessenger.logAs(this.tr("Project converted to pipeline"), "INFO"))
18161816
.catch(err => osparc.FlashMessenger.logError(err, this.tr("Something went wrong while converting to pipeline")));
18171817
}
@@ -1822,8 +1822,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
18221822
.then(task => {
18231823
task.addListener("resultReceived", e => {
18241824
const copiedStudy = e.getData();
1825-
osparc.store.Study.patchStudyData(copiedStudy, "name", copiedStudy["name"] + " (pipeline)");
1826-
this.__updateUIMode(copiedStudy, "workbench")
1825+
this.__updateUIMode(copiedStudy, "pipeline")
18271826
.then(() => osparc.FlashMessenger.logAs(this.tr("Project's copy converted to pipeline"), "INFO"))
18281827
.catch(err => osparc.FlashMessenger.logError(err, this.tr("Something went wrong while converting the copy to pipeline")));
18291828
}, this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ qx.Class.define("osparc.desktop.SlideshowView", {
7272
const nodeId = e.getData();
7373
this.__hideNode(nodeId);
7474
}, this);
75-
slideshowToolbar.addListener("slidesStop", () => this.getStudy().getUi().setMode("workbench"), this);
75+
slideshowToolbar.addListener("slidesStop", () => this.getStudy().getUi().setMode("pipeline"), this);
7676
this._add(slideshowToolbar);
7777

7878
const mainView = this.__mainView = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -707,14 +707,19 @@ qx.Class.define("osparc.desktop.StudyEditor", {
707707
this.__viewsStack.setSelection([this.__slideshowView]);
708708
this.__slideshowView.startSlides();
709709
break;
710-
case "standalone": {
710+
case "standalone":
711711
this.__viewsStack.setSelection([this.__workbenchView]);
712712
this.__workbenchView.openFirstNode();
713713
break;
714-
}
714+
case "pipeline":
715+
this.__viewsStack.setSelection([this.__workbenchView]);
716+
this.__workbenchView.setMaximized(false);
717+
this.__workbenchView.showPipeline();
718+
break;
715719
case "workbench":
716720
default: {
717721
this.__viewsStack.setSelection([this.__workbenchView]);
722+
// OM: Is this needed?
718723
if (oldUIMode === "standalone") {
719724
// in this transition, show workbenchUI
720725
this.__workbenchView.setMaximized(false);

services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
8181
icon: null,
8282
});
8383
control.addListener("execute", () => {
84-
this.getStudy().getUi().setMode("workbench");
85-
});
86-
break;
87-
case "study-menu-convert-to-standalone":
88-
control = new qx.ui.menu.Button().set({
89-
label: this.tr("Convert to Standalone"),
90-
icon: null,
91-
});
92-
control.addListener("execute", () => {
93-
this.getStudy().getUi().setMode("standalone");
84+
this.getStudy().getUi().setMode("pipeline");
9485
});
9586
break;
9687
case "study-menu-restore":
@@ -115,7 +106,6 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", {
115106
optionsMenu.add(this.getChildControl("study-menu-info"));
116107
optionsMenu.add(this.getChildControl("study-menu-reload"));
117108
optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline"));
118-
optionsMenu.add(this.getChildControl("study-menu-convert-to-standalone"));
119109
optionsMenu.add(this.getChildControl("study-menu-restore"));
120110
optionsMenu.add(this.getChildControl("study-menu-open-logger"));
121111
control = new qx.ui.form.MenuButton().set({

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ qx.Class.define("osparc.study.StudyPreview", {
3737
__buildPreview: function() {
3838
const study = this.__study;
3939
const uiMode = study.getUi().getMode();
40-
if (uiMode === "workbench" && !study.isPipelineEmpty()) {
40+
if (["workbench", "pipeline"].includes(uiMode) && !study.isPipelineEmpty()) {
4141
const workbenchUIPreview = new osparc.workbench.WorkbenchUIPreview();
4242
workbenchUIPreview.setStudy(study);
4343
workbenchUIPreview.loadModel(study.getWorkbench());

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

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -340,30 +340,37 @@ qx.Class.define("osparc.study.Utils", {
340340
},
341341

342342
guessIcon: function(studyData) {
343-
if (osparc.product.Utils.isProduct("tis") || osparc.product.Utils.isProduct("tiplite")) {
343+
if (
344+
(osparc.product.Utils.isProduct("tis") || osparc.product.Utils.isProduct("tiplite")) &&
345+
["app", "guided"].includes(studyData["ui"]["mode"])
346+
) {
344347
return new Promise(resolve => resolve(this.__guessTIPIcon(studyData)));
345348
}
346349
return this.__guessIcon(studyData);
347350
},
348351

349352
__guessIcon: function(studyData) {
350-
const defaultIcon = osparc.dashboard.CardBase.PRODUCT_ICON;
351353
return new Promise(resolve => {
352-
// the was to guess the TI type is to check the boot mode of the ti-postpro in the pipeline
353-
const wbServices = this.self().getNonFrontendNodes(studyData);
354-
if (wbServices.length === 1) {
355-
const wbService = wbServices[0];
356-
osparc.store.Services.getService(wbService.key, wbService.version)
357-
.then(serviceMetadata => {
358-
if (serviceMetadata && serviceMetadata["icon"]) {
359-
resolve(serviceMetadata["icon"]);
360-
}
361-
resolve(defaultIcon);
362-
});
363-
} else if (wbServices.length > 1) {
354+
if (studyData["ui"]["mode"] === "pipeline") {
364355
resolve("osparc/icons/diagram.png");
365356
} else {
366-
resolve(defaultIcon);
357+
const defaultIcon = osparc.dashboard.CardBase.PRODUCT_ICON;
358+
// the was to guess the TI type is to check the boot mode of the ti-postpro in the pipeline
359+
const wbServices = this.self().getNonFrontendNodes(studyData);
360+
if (wbServices.length === 1) {
361+
const wbService = wbServices[0];
362+
osparc.store.Services.getService(wbService.key, wbService.version)
363+
.then(serviceMetadata => {
364+
if (serviceMetadata && serviceMetadata["icon"]) {
365+
resolve(serviceMetadata["icon"]);
366+
}
367+
resolve(defaultIcon);
368+
});
369+
} else if (wbServices.length > 1) {
370+
resolve("osparc/icons/diagram.png");
371+
} else {
372+
resolve(defaultIcon);
373+
}
367374
}
368375
});
369376
},

0 commit comments

Comments
 (0)