From ec6b8bfeccf4bf578623362cb0e460f294164f7e Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 16:20:44 +0100 Subject: [PATCH 01/45] "standalone" mode --- .../client/source/class/osparc/dashboard/CardBase.js | 2 +- .../client/source/class/osparc/data/model/StudyUI.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index 6d74de34376..54ad02365fe 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -352,7 +352,7 @@ qx.Class.define("osparc.dashboard.CardBase", { }, uiMode: { - check: ["workbench", "guided", "app"], + check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used nullable: true, apply: "__applyUiMode" }, diff --git a/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js b/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js index d6451f158e3..b76556bb4f4 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js +++ b/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js @@ -63,7 +63,7 @@ qx.Class.define("osparc.data.model.StudyUI", { }, mode: { - check: ["workbench", "guided", "app"], + check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used init: "workbench", nullable: true, event: "changeMode", From dab85ea1bb5e7cb071f6257e8f0c57ea44381850 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 16:29:07 +0100 Subject: [PATCH 02/45] [skip ci] add standalone where needed --- .../source/class/osparc/dashboard/CardBase.js | 19 +++++++------------ .../class/osparc/dashboard/ResourceDetails.js | 2 +- .../class/osparc/desktop/SlideshowView.js | 2 +- .../class/osparc/desktop/StudyEditor.js | 5 +++-- .../source/class/osparc/file/FilePicker.js | 9 ++++----- .../class/osparc/navigation/NavigationBar.js | 3 ++- .../source/class/osparc/study/StudyPreview.js | 2 +- .../client/source/class/osparc/study/Utils.js | 4 ++++ 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index 54ad02365fe..db53b75e080 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -582,21 +582,16 @@ qx.Class.define("osparc.dashboard.CardBase", { }, __applyUiMode: function(uiMode) { - let source = null; - let toolTipText = null; switch (uiMode) { case "guided": - case "app": - source = osparc.dashboard.CardBase.MODE_APP; - toolTipText = this.tr("App mode"); + case "app": { + const uiModeIcon = this.getChildControl("workbench-mode"); + uiModeIcon.set({ + source: osparc.dashboard.CardBase.MODE_APP, + toolTipText: this.tr("App mode"), + }); break; - } - if (source) { - const uiModeIcon = this.getChildControl("workbench-mode"); - uiModeIcon.set({ - source, - toolTipText, - }); + } } }, diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js index 5f6bb97a02e..1881ee00feb 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js @@ -431,7 +431,7 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { if ( osparc.utils.Resources.isService(resourceData) || !osparc.product.Utils.showStudyPreview() || - osparc.data.model.Study.getUiMode(resourceData) === "app" + !osparc.data.model.Study.getUiMode(resourceData) === "workbench" ) { // there is no pipelining or don't show it return null; diff --git a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js index e05a37f56a1..9978a6f6463 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js @@ -271,7 +271,7 @@ qx.Class.define("osparc.desktop.SlideshowView", { } view.setNode(node); if (node.isDynamic()) { - view.getSettingsLayout().setVisibility(this.getPageContext() === "app" ? "excluded" : "visible"); + view.getSettingsLayout().setVisibility(["app", "standalone"].includes(this.getPageContext()) ? "excluded" : "visible"); } } this.__connectMaximizeEvents(node); diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 3e6a0c943e2..377ac147eb9 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -105,11 +105,11 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, pageContext: { - check: ["workbench", "guided", "app"], + check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used init: null, nullable: false, event: "changePageContext", - apply: "__applyPageContext" + apply: "__applyPageContext" // OM } }, @@ -257,6 +257,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { case "app": this.__slideshowView.startSlides(); break; + // OM default: this.__workbenchView.openFirstNode(); break; diff --git a/services/static-webserver/client/source/class/osparc/file/FilePicker.js b/services/static-webserver/client/source/class/osparc/file/FilePicker.js index fdce6e4aec9..afadab6b230 100644 --- a/services/static-webserver/client/source/class/osparc/file/FilePicker.js +++ b/services/static-webserver/client/source/class/osparc/file/FilePicker.js @@ -58,7 +58,7 @@ qx.Class.define("osparc.file.FilePicker", { }, pageContext: { - check: ["workbench", "guided", "app"], + check: ["workbench", "guided", "app", "standalone"], nullable: false } }, @@ -291,8 +291,7 @@ qx.Class.define("osparc.file.FilePicker", { this.__buildInfoLayout(); } else { this.__addProgressBar(); - const isWorkbenchContext = this.getPageContext() === "workbench"; - if (isWorkbenchContext) { + if (this.getPageContext() === "workbench") { this.__buildWorkbenchLayout(); } else { this.setMargin(10); @@ -545,8 +544,8 @@ qx.Class.define("osparc.file.FilePicker", { flex: 1 }); treeFolderLayout.add(treeLayout, 0); - const allowMultiselection = false; - const folderViewer = new osparc.file.FolderViewer(allowMultiselection); + const allowMultiSelection = false; + const folderViewer = new osparc.file.FolderViewer(allowMultiSelection); treeFolderLayout.add(folderViewer, 1); filesTree.addListener("selectionChanged", () => { diff --git a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js index e8d252a5f82..11eff606785 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js +++ b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js @@ -84,7 +84,8 @@ qx.Class.define("osparc.navigation.NavigationBar", { PAGE_CONTEXT: { 0: "dashboard", 1: "workbench", - 2: "app" + 2: "app", + 3: "standalone", // OM } }, diff --git a/services/static-webserver/client/source/class/osparc/study/StudyPreview.js b/services/static-webserver/client/source/class/osparc/study/StudyPreview.js index 62d5d01470f..c1d6af633be 100644 --- a/services/static-webserver/client/source/class/osparc/study/StudyPreview.js +++ b/services/static-webserver/client/source/class/osparc/study/StudyPreview.js @@ -37,7 +37,7 @@ qx.Class.define("osparc.study.StudyPreview", { __buildPreview: function() { const study = this.__study; const uiMode = study.getUi().getMode(); - if (uiMode !== "app" && !study.isPipelineEmpty()) { + if (uiMode === "workbench" && !study.isPipelineEmpty()) { const workbenchUIPreview = new osparc.workbench.WorkbenchUIPreview(); workbenchUIPreview.setStudy(study); workbenchUIPreview.loadModel(study.getWorkbench()); diff --git a/services/static-webserver/client/source/class/osparc/study/Utils.js b/services/static-webserver/client/source/class/osparc/study/Utils.js index 445b2f82c31..8097b4b8e0e 100644 --- a/services/static-webserver/client/source/class/osparc/study/Utils.js +++ b/services/static-webserver/client/source/class/osparc/study/Utils.js @@ -142,6 +142,10 @@ qx.Class.define("osparc.study.Utils", { "y": 100 } }; + // maybe check it's dynamic + if (!("mode" in minStudyData["ui"])) { + minStudyData["ui"]["mode"] = "standalone"; + } const inaccessibleServices = this.getInaccessibleServices(minStudyData["workbench"]) if (inaccessibleServices.length) { const msg = this.getInaccessibleServicesMsg(inaccessibleServices, minStudyData["workbench"]); From 51bafbb7666e6709c5f08c529a6c2276a22f50fa Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 16:47:07 +0100 Subject: [PATCH 03/45] [skip ci] minor --- .../source/class/osparc/desktop/StudyEditor.js | 16 ++++++++++++---- .../class/osparc/navigation/NavigationBar.js | 7 ------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 377ac147eb9..3aa2f7049cf 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -37,8 +37,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { }); workbenchView.addListener("slidesEdit", () => this.__editSlides(), this); - workbenchView.addListener("slidesAppStart", () => this.setPageContext(osparc.navigation.NavigationBar.PAGE_CONTEXT[2]), this); - slideshowView.addListener("slidesStop", () => this.setPageContext(osparc.navigation.NavigationBar.PAGE_CONTEXT[1]), this); + workbenchView.addListener("slidesAppStart", () => this.setPageContext(this.self().PAGE_CONTEXT[2]), this); // "app" + slideshowView.addListener("slidesStop", () => this.setPageContext(this.self().PAGE_CONTEXT[1]), this); // "workbench" workbenchView.addListener("takeSnapshot", () => this.__takeSnapshot(), this); workbenchView.addListener("takeSnapshot", () => this.__takeSnapshot(), this); @@ -115,7 +115,14 @@ qx.Class.define("osparc.desktop.StudyEditor", { statics: { AUTO_SAVE_INTERVAL: 3000, - READ_ONLY_TEXT: qx.locale.Manager.tr("You do not have writing permissions.
Your changes will not be saved.") + READ_ONLY_TEXT: qx.locale.Manager.tr("You do not have writing permissions.
Your changes will not be saved."), + + PAGE_CONTEXT: { + 0: "dashboard", + 1: "workbench", + 2: "app", + 3: "standalone", + }, }, members: { @@ -557,7 +564,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, __editSlides: function() { - if (this.getPageContext() !== osparc.navigation.NavigationBar.PAGE_CONTEXT[1]) { + if (this.getPageContext() !== osparc.navigation.NavigationBar.PAGE_CONTEXT[1]) { // "workbench" + // if the user it not in "workbench" mode, return return; } diff --git a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js index 11eff606785..faeb6f21832 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js +++ b/services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js @@ -80,13 +80,6 @@ qx.Class.define("osparc.navigation.NavigationBar", { minWidth: 30, minHeight: 30 }, - - PAGE_CONTEXT: { - 0: "dashboard", - 1: "workbench", - 2: "app", - 3: "standalone", // OM - } }, members: { From c3d9f4a0d079aae13f140acd1f66ff3dc2031c79 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 16:54:45 +0100 Subject: [PATCH 04/45] [skip ci] more switches --- .../source/class/osparc/desktop/StudyEditor.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 3aa2f7049cf..2f3fa408786 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -264,7 +264,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { case "app": this.__slideshowView.startSlides(); break; - // OM + case "workbench": + case "standalone": default: this.__workbenchView.openFirstNode(); break; @@ -730,12 +731,6 @@ qx.Class.define("osparc.desktop.StudyEditor", { __applyPageContext: function(newCtxt) { switch (newCtxt) { - case "workbench": - this.__viewsStack.setSelection([this.__workbenchView]); - if (this.getStudy() && this.getStudy().getUi()) { - this.__workbenchView.nodeSelected(this.getStudy().getUi().getCurrentNodeId()); - } - break; case "guided": case "app": this.__viewsStack.setSelection([this.__slideshowView]); @@ -743,6 +738,14 @@ qx.Class.define("osparc.desktop.StudyEditor", { this.__slideshowView.startSlides(); } break; + case "workbench": + case "standalone": + default: + this.__viewsStack.setSelection([this.__workbenchView]); + if (this.getStudy() && this.getStudy().getUi()) { + this.__workbenchView.nodeSelected(this.getStudy().getUi().getCurrentNodeId()); + } + break; } }, From ec9f041bb6105ef9a80b38f1105b553f08fb4518 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 17:36:12 +0100 Subject: [PATCH 05/45] minor fix --- .../client/source/class/osparc/dashboard/ResourceBrowserBase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js index 049b8541689..2ad6467669a 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserBase.js @@ -124,7 +124,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserBase", { // pop up study options if the study was just created or if it has no wallet assigned or user has no access to it const resourceSelector = new osparc.study.StudyOptions(studyId); if (isStudyCreation) { - resourceSelector.getChildControl("open-button").setLabel(this.tr("New")); + resourceSelector.getChildControl("open-button").setLabel(qx.locale.Manager.tr("New")); } const win = osparc.study.StudyOptions.popUpInWindow(resourceSelector); win.moveItUp(); From fe5904bdf0d0c9f31239b2e4595f2205fa052cfc Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 17:36:24 +0100 Subject: [PATCH 06/45] menu-wider --- .../class/osparc/navigation/StudyTitleWOptions.js | 1 + .../client/source/class/osparc/theme/Appearance.js | 11 +++++++++++ .../client/source/class/osparc/utils/Utils.js | 9 +-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 342f0de8cee..b532fcbca28 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -77,6 +77,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { break; case "study-menu-button": { const optionsMenu = new qx.ui.menu.Menu(); + optionsMenu.setAppearance("menu-wider"); optionsMenu.add(this.getChildControl("study-menu-info")); optionsMenu.add(this.getChildControl("study-menu-download-logs")); control = new qx.ui.form.MenuButton().set({ diff --git a/services/static-webserver/client/source/class/osparc/theme/Appearance.js b/services/static-webserver/client/source/class/osparc/theme/Appearance.js index 8af7db982cb..28f4fb4a3ec 100644 --- a/services/static-webserver/client/source/class/osparc/theme/Appearance.js +++ b/services/static-webserver/client/source/class/osparc/theme/Appearance.js @@ -719,6 +719,17 @@ qx.Theme.define("osparc.theme.Appearance", { } }, + "menu-wider": { + include: "menu", + style: () => { + return { + decorator: "border-simple", + font: "text-14", + padding: 4, + }; + } + }, + "menu-button": { alias: "atom", diff --git a/services/static-webserver/client/source/class/osparc/utils/Utils.js b/services/static-webserver/client/source/class/osparc/utils/Utils.js index 6f8bcec17f6..54647719ad9 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Utils.js +++ b/services/static-webserver/client/source/class/osparc/utils/Utils.js @@ -253,19 +253,12 @@ qx.Class.define("osparc.utils.Utils", { }, prettifyMenu: function(menu) { - menu.set({ - font: "text-14", - padding: 4 - }); + menu.setAppearance("menu-wider"); menu.getChildren().forEach(menuItem => { if (menuItem.classname !== "qx.ui.menu.Separator") { menuItem.setPadding(4); } }); - - menu.getContentElement().setStyles({ - "border-radius": "4px" - }); }, hardRefresh: function() { From 18674d309f1faab56d652abf0fe969da33912ff0 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 17:45:25 +0100 Subject: [PATCH 07/45] wider options button --- .../source/class/osparc/navigation/StudyTitleWOptions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index b532fcbca28..717a974cfbb 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -84,7 +84,8 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { appearance: "fab-button", menu: optionsMenu, icon: "@FontAwesome5Solid/ellipsis-v/14", - allowGrowY: false + allowGrowY: false, + width: 24, }); this._add(control); break; From ae69cbbff70369ad1429af0cfd5b081065cb51fc Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 17:48:55 +0100 Subject: [PATCH 08/45] [skip ci] more menu entries --- .../class/osparc/data/model/IframeHandler.js | 5 ++++- .../osparc/navigation/StudyTitleWOptions.js | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 2ca74c47274..76017f14614 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -92,7 +92,10 @@ qx.Class.define("osparc.data.model.IframeHandler", { __initIFrame: function() { const iframe = new osparc.widget.PersistentIframe(); osparc.utils.Utils.setIdToWidget(iframe.getIframe(), "iframe_"+this.getNode().getNodeId()); - if (osparc.product.Utils.isProduct("s4llite")) { + if ( + osparc.product.Utils.isProduct("s4llite") || + this.getStudy().getUi().getMode() === "standalone" + ) { iframe.setShowToolbar(false); } iframe.addListener("restart", () => this.__restartIFrame(), this); diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 717a974cfbb..ee4ceed5557 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -68,6 +68,24 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); }); break; + case "study-menu-reload": + control = new qx.ui.menu.Button().set({ + label: this.tr("Reload"), + icon: "@MaterialIcons/info_outline/14", + }); + control.addListener("execute", () => { + console.log("Reload page"); + }); + break; + case "study-menu-convert-to-pipeline": + control = new qx.ui.menu.Button().set({ + label: this.tr("Convert to Pipeline"), + icon: "@MaterialIcons/info_outline/14", + }); + control.addListener("execute", () => { + console.log("Convert to Pipeline"); + }); + break; case "study-menu-download-logs": control = new qx.ui.menu.Button().set({ label: this.tr("Download logs"), @@ -79,6 +97,10 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { const optionsMenu = new qx.ui.menu.Menu(); optionsMenu.setAppearance("menu-wider"); optionsMenu.add(this.getChildControl("study-menu-info")); + if (this.getStudy().getUi().getMode() === "standalone") { + optionsMenu.add(this.getChildControl("study-menu-reload")); + optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline")); + } optionsMenu.add(this.getChildControl("study-menu-download-logs")); control = new qx.ui.form.MenuButton().set({ appearance: "fab-button", From 8a5fa3905c962583b5743ca1f3f4d7c630c6b028 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Wed, 29 Jan 2025 17:51:56 +0100 Subject: [PATCH 09/45] minor --- .../client/source/class/osparc/dashboard/CardBase.js | 2 +- .../client/source/class/osparc/data/model/StudyUI.js | 2 +- .../client/source/class/osparc/desktop/StudyEditor.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index db53b75e080..e0aa907e11a 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -352,7 +352,7 @@ qx.Class.define("osparc.dashboard.CardBase", { }, uiMode: { - check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used + check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used nullable: true, apply: "__applyUiMode" }, diff --git a/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js b/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js index b76556bb4f4..fcc2f7bd9f8 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js +++ b/services/static-webserver/client/source/class/osparc/data/model/StudyUI.js @@ -63,7 +63,7 @@ qx.Class.define("osparc.data.model.StudyUI", { }, mode: { - check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used + check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used init: "workbench", nullable: true, event: "changeMode", diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 2f3fa408786..3d6edae0147 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -105,7 +105,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, pageContext: { - check: ["workbench", "guided", "app", "standalone"], // "guided" is not longer used + check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used init: null, nullable: false, event: "changePageContext", From 3c4668ae903dc4d3dd697dc74b082a8beb664d5f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 09:53:03 +0100 Subject: [PATCH 10/45] minor --- .../client/source/resource/osparc/new_studies.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/resource/osparc/new_studies.json b/services/static-webserver/client/source/resource/osparc/new_studies.json index ed29e1145d5..7770b61dce2 100644 --- a/services/static-webserver/client/source/resource/osparc/new_studies.json +++ b/services/static-webserver/client/source/resource/osparc/new_studies.json @@ -148,7 +148,7 @@ "resourceType": "study", "icon": "@FontAwesome5Solid/file/18", "title": "Empty Pipeline", - "newStudyLabel": "New Project", + "newStudyLabel": "New Pipeline", "idToWidget": "emptyStudyBtn" }] }, @@ -185,7 +185,7 @@ "resourceType": "study", "icon": "@FontAwesome5Solid/file/18", "title": "Empty Pipeline", - "newStudyLabel": "New Project", + "newStudyLabel": "New Pipeline", "idToWidget": "emptyStudyBtn" }] }, From 8d381d60512ac905ffa72f2b68b2daad4a8ac352 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 09:53:13 +0100 Subject: [PATCH 11/45] buttons visibility --- .../osparc/navigation/StudyTitleWOptions.js | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index ee4ceed5557..7f0d032389c 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -71,7 +71,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { case "study-menu-reload": control = new qx.ui.menu.Button().set({ label: this.tr("Reload"), - icon: "@MaterialIcons/info_outline/14", + icon: "@FontAwesome5Solid/redo-alt/12", }); control.addListener("execute", () => { console.log("Reload page"); @@ -80,7 +80,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { case "study-menu-convert-to-pipeline": control = new qx.ui.menu.Button().set({ label: this.tr("Convert to Pipeline"), - icon: "@MaterialIcons/info_outline/14", + icon: null, }); control.addListener("execute", () => { console.log("Convert to Pipeline"); @@ -97,10 +97,8 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { const optionsMenu = new qx.ui.menu.Menu(); optionsMenu.setAppearance("menu-wider"); optionsMenu.add(this.getChildControl("study-menu-info")); - if (this.getStudy().getUi().getMode() === "standalone") { - optionsMenu.add(this.getChildControl("study-menu-reload")); - optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline")); - } + optionsMenu.add(this.getChildControl("study-menu-reload")); + optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline")); optionsMenu.add(this.getChildControl("study-menu-download-logs")); control = new qx.ui.form.MenuButton().set({ appearance: "fab-button", @@ -130,7 +128,16 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { __applyStudy: function(study) { if (study) { - study.bind("name", this.getChildControl("edit-title-label"), "value"); + const editTitle = this.getChildControl("edit-title-label"); + study.bind("name", editTitle, "value"); + const reloadButton = this.getChildControl("study-menu-reload"); + study.getUi().bind("mode", reloadButton, "visibility", { + converter: mode => mode === "standalone" ? "visible" : "excluded" + }); + const convertToPipelineButton = this.getChildControl("study-menu-convert-to-pipeline"); + study.getUi().bind("mode", convertToPipelineButton, "visibility", { + converter: mode => mode === "standalone" ? "visible" : "excluded" + }); } else { this.exclude(); } From 9422a6310fec4e09cfd621c62dbf8f6d2387f75e Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 09:56:01 +0100 Subject: [PATCH 12/45] [skip ci] minor --- .../source/class/osparc/data/model/IframeHandler.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 76017f14614..431017b7dcf 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -104,11 +104,15 @@ qx.Class.define("osparc.data.model.IframeHandler", { }, __initLoadingPage: function() { - const showZoomMaximizeButton = !osparc.product.Utils.isProduct("s4llite"); - const loadingPage = new osparc.ui.message.Loading(showZoomMaximizeButton); - loadingPage.set({ + const loadingPage = new osparc.ui.message.Loading().set({ header: this.__getLoadingPageHeader() }); + if ( + osparc.product.Utils.isProduct("s4llite") || + this.getStudy().getUi().getMode() === "standalone" + ) { + loadingPage.setShowToolbar(false); + } const node = this.getNode(); const thumbnail = node.getMetaData()["thumbnail"]; From 482898d1812fb48438d580affccf6179009dd7fb Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 11:21:42 +0100 Subject: [PATCH 13/45] minor --- .../client/source/class/osparc/widget/PersistentIframe.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index f5f48cf30d8..6ca1af9f418 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -91,7 +91,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { // override _createContentElement : function() { - let iframe = this.__iframe = new qx.ui.embed.Iframe(this.getSource()); + const iframe = this.__iframe = new qx.ui.embed.Iframe(this.getSource()); const persistentIframe = this; iframe.addListener("load", () => { const currentTheme = qx.theme.manager.Meta.getInstance().getTheme(); @@ -115,6 +115,9 @@ qx.Class.define("osparc.widget.PersistentIframe", { alignX: "right", alignY: "middle" })); + this.bind("showToolbar", buttonContainer, "visibility", { + converter: showToolbar => showToolbar ? "visible" : "excluded" + }); const diskUsageIndicator = this.__diskUsageIndicator = new osparc.workbench.DiskUsageIndicator(); diskUsageIndicator.getChildControl("disk-indicator").set({ @@ -231,8 +234,6 @@ qx.Class.define("osparc.widget.PersistentIframe", { top: (divPos.top - iframeParentPos.top), right: (iframeParentPos.right - iframeParentPos.left - divPos.right) }); - - this.__buttonContainer.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); }, 0); }, From a13f62e0a5963bd8434cb00d2f7909ade2a12e17 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 11:22:30 +0100 Subject: [PATCH 14/45] Loading props --- .../source/class/osparc/ui/message/Loading.js | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index bfd238cd9e2..0102508cdf8 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -64,7 +64,21 @@ qx.Class.define("osparc.ui.message.Loading", { check: "Array", nullable: true, apply: "__applyMessages" - } + }, + + toolbarHeight: { + check: "Integer", + init: 25 + }, + + /** + * Show Restart-Maximize Toolbar + */ + showToolbar: { + check: "Boolean", + init: true, + apply: "__applyShowToolbar" + }, }, // from osparc.widget.PersistentIframe @@ -97,15 +111,15 @@ qx.Class.define("osparc.ui.message.Loading", { __extraWidgets: null, __maxButton: null, - __buildLayout: function(showMaximizeButton) { + __buildLayout: function() { + this.__createMaximizeButton(); this.__createMainLayout(); - this.__createMaximizeButton(showMaximizeButton); }, __createMainLayout: function() { const layout = new qx.ui.layout.Grid(20, 20); layout.setColumnFlex(0, 1); - const mainLayout = this.__mainLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(20).set({ + const mainLayout = this.__mainLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ alignX: "center", alignY: "middle" })).set({ @@ -179,6 +193,10 @@ qx.Class.define("osparc.ui.message.Loading", { }); }, + __applyShowToolbar: function(show) { + this.setToolbarHeight(show ? 25 : 0); + }, + __createMaximizeButton: function(showMaximizeButton) { const maximize = false; const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ From 3022792adbe55eaf437e0ade9501173ea4d55d96 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 12:40:03 +0100 Subject: [PATCH 15/45] [skip ci] more refactoring --- .../source/class/osparc/ui/message/Loading.js | 78 +++++++++---------- .../class/osparc/widget/PersistentIframe.js | 22 +++--- 2 files changed, 47 insertions(+), 53 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 0102508cdf8..b1911ca8d4c 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -31,19 +31,16 @@ qx.Class.define("osparc.ui.message.Loading", { extend: qx.ui.core.Widget, - /** - * Constructor for the Loading widget. - * - * @param {Boolean} showMaximizeButton - */ - construct: function(showMaximizeButton = false) { + construct: function() { this.base(arguments); - this._setLayout(new qx.ui.layout.HBox()); + this._setLayout(new qx.ui.layout.VBox()); this.set({ - alignX: "center" + alignX: "center", + alignY: "middle", }); - this.__buildLayout(showMaximizeButton); + + this.__buildLayout(); }, properties: { @@ -77,7 +74,7 @@ qx.Class.define("osparc.ui.message.Loading", { showToolbar: { check: "Boolean", init: true, - apply: "__applyShowToolbar" + event: "changeShowToolbar", }, }, @@ -104,7 +101,6 @@ qx.Class.define("osparc.ui.message.Loading", { }, members: { - __mainLayout: null, __thumbnail: null, __header: null, __messagesContainer: null, @@ -116,21 +112,39 @@ qx.Class.define("osparc.ui.message.Loading", { this.__createMainLayout(); }, + __createMaximizeButton: function() { + const maximize = false; + const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ + label: osparc.widget.PersistentIframe.getZoomLabel(maximize), + icon: osparc.widget.PersistentIframe.getZoomIcon(maximize), + }); + osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); + maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); + + const buttonsContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ + alignX: "right", + alignY: "middle" + })); + this.bind("showToolbar", buttonsContainer, "visibility", { + converter: showToolbar => showToolbar ? "visible" : "excluded" + }); + buttonsContainer.add(maxButton); + this._add(buttonsContainer); + }, + __createMainLayout: function() { const layout = new qx.ui.layout.Grid(20, 20); layout.setColumnFlex(0, 1); - const mainLayout = this.__mainLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ + layout.setColumnAlign(0, "center", "middle"); + const mainLayout = new qx.ui.container.Composite(layout).set({ + maxWidth: 400, alignX: "center", - alignY: "middle" - })).set({ - width: 400, - padding: 0 }); - this._add(new qx.ui.core.Widget(), { + this._add(new qx.ui.core.Spacer(), { flex: 1 }); this._add(mainLayout); - this._add(new qx.ui.core.Widget(), { + this._add(new qx.ui.core.Spacer(), { flex: 1 }); @@ -151,7 +165,7 @@ qx.Class.define("osparc.ui.message.Loading", { height: logoHeight }); } - mainLayout.addAt(thumbnail, { + mainLayout.add(thumbnail, { column: 0, row: this.self().GRID_POS.LOGO }); @@ -171,7 +185,7 @@ qx.Class.define("osparc.ui.message.Loading", { }); const icon = waitingHeader.getChildControl("icon"); osparc.service.StatusUI.updateCircleAnimation(icon); - mainLayout.addAt(waitingHeader, { + mainLayout.add(waitingHeader, { column: 0, row: this.self().GRID_POS.WAITING }); @@ -179,7 +193,7 @@ qx.Class.define("osparc.ui.message.Loading", { const messages = this.__messagesContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ alignX: "center" })); - mainLayout.addAt(messages, { + mainLayout.add(messages, { column: 0, row: this.self().GRID_POS.MESSAGES }); @@ -187,7 +201,7 @@ qx.Class.define("osparc.ui.message.Loading", { const extraWidgets = this.__extraWidgets = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ alignX: "center" })); - mainLayout.addAt(extraWidgets, { + mainLayout.add(extraWidgets, { column: 0, row: this.self().GRID_POS.EXTRA_WIDGETS }); @@ -197,26 +211,6 @@ qx.Class.define("osparc.ui.message.Loading", { this.setToolbarHeight(show ? 25 : 0); }, - __createMaximizeButton: function(showMaximizeButton) { - const maximize = false; - const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ - label: osparc.widget.PersistentIframe.getZoomLabel(maximize), - icon: osparc.widget.PersistentIframe.getZoomIcon(maximize), - visibility: showMaximizeButton ? "visible" : "excluded" - }); - osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); - maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); - - const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox()).set({ - maxWidth: 100 - }); - maximizeLayout.add(maxButton); - maximizeLayout.add(new qx.ui.core.Widget(), { - flex: 1 - }); - this._add(maximizeLayout); - }, - __applyLogo: function(newLogo) { const productLogoPath = osparc.product.Utils.getLogoPath(); if (newLogo !== productLogoPath) { diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index 6ca1af9f418..220c24c2c32 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -68,6 +68,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { showToolbar: { check: "Boolean", init: true, + event: "changeShowToolbar", apply: "__applyShowToolbar" } }, @@ -84,7 +85,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { members: { __iframe: null, __syncScheduled: null, - __buttonContainer: null, + __buttonsContainer: null, __diskUsageIndicator: null, __reloadButton: null, __zoomButton: null, @@ -111,11 +112,11 @@ qx.Class.define("osparc.widget.PersistentIframe", { const host = window.location.host; iframeEl.setAttribute("allow", `clipboard-read; clipboard-write; from *.services.${host}`); - const buttonContainer = this.__buttonContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ + const buttonsContainer = this.__buttonsContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ alignX: "right", alignY: "middle" })); - this.bind("showToolbar", buttonContainer, "visibility", { + this.bind("showToolbar", buttonsContainer, "visibility", { converter: showToolbar => showToolbar ? "visible" : "excluded" }); @@ -123,7 +124,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { diskUsageIndicator.getChildControl("disk-indicator").set({ margin: 0 }); - buttonContainer.add(diskUsageIndicator); + buttonsContainer.add(diskUsageIndicator); const reloadButton = this.__reloadButton = this.self().createToolbarButton().set({ label: this.tr("Reload"), @@ -135,7 +136,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { this.fireEvent("restart"); }, this); osparc.utils.Utils.setIdToWidget(reloadButton, "iFrameRestartBtn"); - buttonContainer.add(reloadButton); + buttonsContainer.add(reloadButton); const zoomButton = this.__zoomButton = this.self().createToolbarButton().set({ label: this.self().getZoomLabel(false), @@ -145,9 +146,9 @@ qx.Class.define("osparc.widget.PersistentIframe", { zoomButton.addListener("execute", e => { this.maximizeIFrame(!this.hasState("maximized")); }, this); - buttonContainer.add(zoomButton); + buttonsContainer.add(zoomButton); - appRoot.add(buttonContainer, { + appRoot.add(buttonsContainer, { top: this.self().HIDDEN_TOP }); standin.addListener("appear", e => { @@ -157,7 +158,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { iframe.setLayoutProperties({ top: this.self().HIDDEN_TOP }); - buttonContainer.setLayoutProperties({ + buttonsContainer.setLayoutProperties({ top: this.self().HIDDEN_TOP }); }); @@ -230,15 +231,14 @@ qx.Class.define("osparc.widget.PersistentIframe", { height: divSize.height - this.getToolbarHeight() }); - this.__buttonContainer.setLayoutProperties({ + this.__buttonsContainer.setLayoutProperties({ top: (divPos.top - iframeParentPos.top), right: (iframeParentPos.right - iframeParentPos.left - divPos.right) }); }, 0); }, - __applyShowToolbar: function(show) { - this.setToolbarHeight(show ? 25 : 0); + __applyShowToolbar: function() { this.__syncIframePos(); }, From fe51cebc95eecdb2cfdd06f05760b05c5d5e6c97 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 12:46:57 +0100 Subject: [PATCH 16/45] bring back hide toolbar logic --- .../client/source/class/osparc/widget/PersistentIframe.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index 220c24c2c32..b786cad153f 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -116,9 +116,6 @@ qx.Class.define("osparc.widget.PersistentIframe", { alignX: "right", alignY: "middle" })); - this.bind("showToolbar", buttonsContainer, "visibility", { - converter: showToolbar => showToolbar ? "visible" : "excluded" - }); const diskUsageIndicator = this.__diskUsageIndicator = new osparc.workbench.DiskUsageIndicator(); diskUsageIndicator.getChildControl("disk-indicator").set({ @@ -162,6 +159,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { top: this.self().HIDDEN_TOP }); }); + this.addListener("move", e => { // got to let the new layout render first or we don't see it this.__syncIframePos(); @@ -238,7 +236,8 @@ qx.Class.define("osparc.widget.PersistentIframe", { }, 0); }, - __applyShowToolbar: function() { + __applyShowToolbar: function(show) { + this.setToolbarHeight(show ? 25 : 0); this.__syncIframePos(); }, From 3801d5563ba334d1b904535f01439f2cca3b3784 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 12:58:13 +0100 Subject: [PATCH 17/45] connect reload button --- .../source/class/osparc/data/model/IframeHandler.js | 6 +++--- .../class/osparc/navigation/StudyTitleWOptions.js | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 431017b7dcf..cc9e04ceaa7 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -98,7 +98,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { ) { iframe.setShowToolbar(false); } - iframe.addListener("restart", () => this.__restartIFrame(), this); + iframe.addListener("restart", () => this.restartIFrame(), this); iframe.getDiskUsageIndicator().setCurrentNode(this.getNode()) this.setIFrame(iframe); }, @@ -359,7 +359,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { node.fireDataEvent("showInLogger", msgData); // will switch to iframe's content - this.__restartIFrame(); + this.restartIFrame(); if (!node.isDynamicV2()) { node.callRetrieveInputs(); } @@ -381,7 +381,7 @@ qx.Class.define("osparc.data.model.IframeHandler", { } }, - __restartIFrame: function() { + restartIFrame: function() { const node = this.getNode(); if (node.getServiceUrl() !== null) { // restart button pushed diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 7f0d032389c..a4a50759085 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -73,9 +73,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { label: this.tr("Reload"), icon: "@FontAwesome5Solid/redo-alt/12", }); - control.addListener("execute", () => { - console.log("Reload page"); - }); + control.addListener("execute", () => this.__reloadIFrame(), this); break; case "study-menu-convert-to-pipeline": control = new qx.ui.menu.Button().set({ @@ -126,6 +124,13 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { return control || this.base(arguments, id); }, + __reloadIFrame: function() { + const nodes = this.getStudy().getWorkbench().getNodes(); + if (Object.keys(nodes).length === 1) { + Object.values(nodes)[0].getIframeHandler().restartIFrame(); + } + }, + __applyStudy: function(study) { if (study) { const editTitle = this.getChildControl("edit-title-label"); From 3bd294aedc3861fce5795332a400a630c1ee1f77 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 13:49:09 +0100 Subject: [PATCH 18/45] minor --- .../client/source/class/osparc/widget/PersistentIframe.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index b786cad153f..b96fc9599d8 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -233,6 +233,8 @@ qx.Class.define("osparc.widget.PersistentIframe", { top: (divPos.top - iframeParentPos.top), right: (iframeParentPos.right - iframeParentPos.left - divPos.right) }); + + this.__buttonContainer.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); }, 0); }, From 074274200f44d3448fe0b350e67759b2211d35df Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 15:38:40 +0100 Subject: [PATCH 19/45] Simplify Loading page --- .../class/osparc/data/model/IframeHandler.js | 6 - .../class/osparc/desktop/WorkbenchView.js | 1 - .../source/class/osparc/ui/message/Loading.js | 129 +++++------------- .../class/osparc/widget/PersistentIframe.js | 2 +- 4 files changed, 36 insertions(+), 102 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index cc9e04ceaa7..3284d73c8de 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -107,12 +107,6 @@ qx.Class.define("osparc.data.model.IframeHandler", { const loadingPage = new osparc.ui.message.Loading().set({ header: this.__getLoadingPageHeader() }); - if ( - osparc.product.Utils.isProduct("s4llite") || - this.getStudy().getUi().getMode() === "standalone" - ) { - loadingPage.setShowToolbar(false); - } const node = this.getNode(); const thumbnail = node.getMetaData()["thumbnail"]; diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index a735b2532d6..3f8534411d4 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -1191,7 +1191,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.nodeSelected(dynamicNode.getNodeId()); qx.event.Timer.once(() => { this.__openIframeTab(dynamicNode); - dynamicNode.getLoadingPage().maximizeIFrame(true); dynamicNode.getIFrame().maximizeIFrame(true); }, this, 10); return; diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index b1911ca8d4c..7e273222e9b 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -33,12 +33,15 @@ qx.Class.define("osparc.ui.message.Loading", { construct: function() { this.base(arguments); - this._setLayout(new qx.ui.layout.VBox()); - this.set({ - alignX: "center", - alignY: "middle", - }); + const layout = new qx.ui.layout.Grid(20, 20); + layout.setRowFlex(this.self().GRID_POS.SPACER_TOP, 1); + layout.setRowFlex(this.self().GRID_POS.SPACER_BOTTOM, 1); + layout.setColumnFlex(0, 1); + layout.setColumnFlex(2, 1); + layout.setColumnMaxWidth(1, 400); + layout.setColumnAlign(1, "center", "middle"); + this._setLayout(layout); this.__buildLayout(); }, @@ -62,28 +65,6 @@ qx.Class.define("osparc.ui.message.Loading", { nullable: true, apply: "__applyMessages" }, - - toolbarHeight: { - check: "Integer", - init: 25 - }, - - /** - * Show Restart-Maximize Toolbar - */ - showToolbar: { - check: "Boolean", - init: true, - event: "changeShowToolbar", - }, - }, - - // from osparc.widget.PersistentIframe - events: { - /** Fired if the iframe is restored from a minimized or maximized state */ - "restore" : "qx.event.type.Event", - /** Fired if the iframe is maximized */ - "maximize" : "qx.event.type.Event" }, statics: { @@ -93,10 +74,12 @@ qx.Class.define("osparc.ui.message.Loading", { STATUS_ICON_SIZE: 20, GRID_POS: { + SPACER_TOP: 0, LOGO: 1, WAITING: 2, MESSAGES: 3, - EXTRA_WIDGETS: 4 + EXTRA_WIDGETS: 4, + SPACER_BOTTOM: 5, } }, @@ -108,44 +91,18 @@ qx.Class.define("osparc.ui.message.Loading", { __maxButton: null, __buildLayout: function() { - this.__createMaximizeButton(); - this.__createMainLayout(); - }, - - __createMaximizeButton: function() { - const maximize = false; - const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ - label: osparc.widget.PersistentIframe.getZoomLabel(maximize), - icon: osparc.widget.PersistentIframe.getZoomIcon(maximize), - }); - osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); - maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); - - const buttonsContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox(10).set({ - alignX: "right", - alignY: "middle" - })); - this.bind("showToolbar", buttonsContainer, "visibility", { - converter: showToolbar => showToolbar ? "visible" : "excluded" - }); - buttonsContainer.add(maxButton); - this._add(buttonsContainer); - }, - - __createMainLayout: function() { - const layout = new qx.ui.layout.Grid(20, 20); - layout.setColumnFlex(0, 1); - layout.setColumnAlign(0, "center", "middle"); - const mainLayout = new qx.ui.container.Composite(layout).set({ - maxWidth: 400, - alignX: "center", + this._add(new qx.ui.core.Spacer(), { + column: 0, + row: 0 }); this._add(new qx.ui.core.Spacer(), { - flex: 1 + column: 2, + row: 0 }); - this._add(mainLayout); + this._add(new qx.ui.core.Spacer(), { - flex: 1 + column: 1, + row: this.self().GRID_POS.SPACER_TOP }); const productLogoPath = osparc.product.Utils.getLogoPath(); @@ -165,8 +122,8 @@ qx.Class.define("osparc.ui.message.Loading", { height: logoHeight }); } - mainLayout.add(thumbnail, { - column: 0, + this._add(thumbnail, { + column: 1, row: this.self().GRID_POS.LOGO }); @@ -178,37 +135,39 @@ qx.Class.define("osparc.ui.message.Loading", { gap: 15, allowGrowX: false }); + const icon = waitingHeader.getChildControl("icon"); + osparc.service.StatusUI.updateCircleAnimation(icon); const label = waitingHeader.getChildControl("label"); label.set({ rich: true, - wrap: true + wrap: true, + alignX: "center", }); - const icon = waitingHeader.getChildControl("icon"); - osparc.service.StatusUI.updateCircleAnimation(icon); - mainLayout.add(waitingHeader, { - column: 0, + this._add(waitingHeader, { + column: 1, row: this.self().GRID_POS.WAITING }); const messages = this.__messagesContainer = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ alignX: "center" })); - mainLayout.add(messages, { - column: 0, + this._add(messages, { + column: 1, row: this.self().GRID_POS.MESSAGES }); const extraWidgets = this.__extraWidgets = new qx.ui.container.Composite(new qx.ui.layout.VBox(10).set({ alignX: "center" })); - mainLayout.add(extraWidgets, { - column: 0, + this._add(extraWidgets, { + column: 1, row: this.self().GRID_POS.EXTRA_WIDGETS }); - }, - __applyShowToolbar: function(show) { - this.setToolbarHeight(show ? 25 : 0); + this._add(new qx.ui.core.Spacer(), { + column: 1, + row: this.self().GRID_POS.SPACER_BOTTOM + }); }, __applyLogo: function(newLogo) { @@ -276,23 +235,5 @@ qx.Class.define("osparc.ui.message.Loading", { addExtraWidget: function(widget) { this.__extraWidgets.add(widget); }, - - // from osparc.widget.PersistentIframe - maximizeIFrame: function(maximize) { - if (maximize) { - this.fireEvent("maximize"); - this.addState("maximized"); - } else { - this.fireEvent("restore"); - this.removeState("maximized"); - } - const maxButton = this.__maxButton; - maxButton.set({ - label: osparc.widget.PersistentIframe.getZoomLabel(maximize), - icon: osparc.widget.PersistentIframe.getZoomIcon(maximize) - }); - osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); - qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized")); - } } }); diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index b96fc9599d8..202086b04ad 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -234,7 +234,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { right: (iframeParentPos.right - iframeParentPos.left - divPos.right) }); - this.__buttonContainer.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); + this.__buttonsContainer.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); }, 0); }, From 904753507b5d4e37774e42d7e318a92d3d9cf760 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:11:58 +0100 Subject: [PATCH 20/45] refactor page contexts --- .../class/osparc/desktop/SlideshowView.js | 3 +- .../class/osparc/desktop/StudyEditor.js | 65 ++++++------------- .../class/osparc/desktop/WorkbenchView.js | 5 +- .../osparc/navigation/StudyTitleWOptions.js | 4 +- 4 files changed, 23 insertions(+), 54 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js index 9978a6f6463..63dbae8f79a 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js @@ -72,7 +72,7 @@ qx.Class.define("osparc.desktop.SlideshowView", { const nodeId = e.getData(); this.__hideNode(nodeId); }, this); - slideshowToolbar.addListener("slidesStop", () => this.fireEvent("slidesStop"), this); + slideshowToolbar.addListener("slidesStop", () => this.getStudy().getUi().setMode("workbench"), this); this._add(slideshowToolbar); const mainView = this.__mainView = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({ @@ -109,7 +109,6 @@ qx.Class.define("osparc.desktop.SlideshowView", { }, events: { - "slidesStop": "qx.event.type.Event", "startPartialPipeline": "qx.event.type.Data", "stopPipeline": "qx.event.type.Event", "backToDashboardPressed": "qx.event.type.Event", diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 3d6edae0147..3c1a9465ab2 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -37,8 +37,6 @@ qx.Class.define("osparc.desktop.StudyEditor", { }); workbenchView.addListener("slidesEdit", () => this.__editSlides(), this); - workbenchView.addListener("slidesAppStart", () => this.setPageContext(this.self().PAGE_CONTEXT[2]), this); // "app" - slideshowView.addListener("slidesStop", () => this.setPageContext(this.self().PAGE_CONTEXT[1]), this); // "workbench" workbenchView.addListener("takeSnapshot", () => this.__takeSnapshot(), this); workbenchView.addListener("takeSnapshot", () => this.__takeSnapshot(), this); @@ -72,7 +70,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { const startStopButtons = workbenchView.getStartStopButtons(); startStopButtons.addListener("startPipeline", () => this.__startPipeline([]), this); startStopButtons.addListener("startPartialPipeline", () => { - const partialPipeline = this.getPageContext() === "workbench" ? this.__workbenchView.getSelectedNodeIDs() : this.__slideshowView.getSelectedNodeIDs(); + const partialPipeline = this.getStudy().getUi().getMode() === "app" ? this.__slideshowView.getSelectedNodeIDs() : this.__workbenchView.getSelectedNodeIDs(); this.__startPipeline(partialPipeline); }, this); startStopButtons.addListener("stopPipeline", () => this.__stopPipeline(), this); @@ -103,26 +101,11 @@ qx.Class.define("osparc.desktop.StudyEditor", { apply: "__applyStudy", event: "changeStudy" }, - - pageContext: { - check: ["workbench", "guided", "app", "standalone"], // "guided" is no longer used - init: null, - nullable: false, - event: "changePageContext", - apply: "__applyPageContext" // OM - } }, statics: { AUTO_SAVE_INTERVAL: 3000, READ_ONLY_TEXT: qx.locale.Manager.tr("You do not have writing permissions.
Your changes will not be saved."), - - PAGE_CONTEXT: { - 0: "dashboard", - 1: "workbench", - 2: "app", - 3: "standalone", - }, }, members: { @@ -186,6 +169,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { } }, this); } + + study.getUi().addListener("changeMode", e => this.__uiModeChanged(e.getData())); }) .catch(err => { console.error(err); @@ -258,23 +243,9 @@ qx.Class.define("osparc.desktop.StudyEditor", { osparc.FlashMessenger.getInstance().logAs(msg, "WARNING"); } - const pageContext = study.getUi().getMode(); - switch (pageContext) { - case "guided": - case "app": - this.__slideshowView.startSlides(); - break; - case "workbench": - case "standalone": - default: - this.__workbenchView.openFirstNode(); - break; - } - this.addListener("changePageContext", e => { - const pageCxt = e.getData(); - study.getUi().setMode(pageCxt); - }); - this.setPageContext(pageContext); + + const uiMode = study.getUi().getMode(); + this.__uiModeChanged(uiMode); const workbench = study.getWorkbench(); workbench.addListener("retrieveInputs", e => { @@ -565,8 +536,8 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, __editSlides: function() { - if (this.getPageContext() !== osparc.navigation.NavigationBar.PAGE_CONTEXT[1]) { // "workbench" - // if the user it not in "workbench" mode, return + if (this.getStudy().getUi().getMode() !== "workbench") { + // if the user is not in "workbench" mode, return return; } @@ -729,23 +700,25 @@ qx.Class.define("osparc.desktop.StudyEditor", { return this.__workbenchView.getLogger(); }, - __applyPageContext: function(newCtxt) { - switch (newCtxt) { + __uiModeChanged: function(newUIMode) { + switch (newUIMode) { case "guided": case "app": this.__viewsStack.setSelection([this.__slideshowView]); - if (this.getStudy() && this.getStudy().getUi()) { - this.__slideshowView.startSlides(); - } + this.__slideshowView.startSlides(); break; - case "workbench": case "standalone": - default: + case "workbench": + default: { this.__viewsStack.setSelection([this.__workbenchView]); - if (this.getStudy() && this.getStudy().getUi()) { - this.__workbenchView.nodeSelected(this.getStudy().getUi().getCurrentNodeId()); + const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); + if (currentNodeId) { + this.__workbenchView.nodeSelected(); + } else { + this.__workbenchView.openFirstNode(); } break; + } } }, diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 3f8534411d4..1cbab491d4c 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -70,7 +70,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", { "expandNavBar": "qx.event.type.Event", "backToDashboardPressed": "qx.event.type.Event", "slidesEdit": "qx.event.type.Event", - "slidesAppStart": "qx.event.type.Event", "annotationRectStart": "qx.event.type.Event", "takeSnapshot": "qx.event.type.Event", "showSnapshots": "qx.event.type.Event", @@ -448,7 +447,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { marginTop: 7, ...osparc.navigation.NavigationBar.BUTTON_OPTIONS }); - startAppButtonTB.addListener("execute", () => this.fireEvent("slidesAppStart")); + startAppButtonTB.addListener("execute", () => study.getUi().setMode("app")); topBar.add(startAppButtonTB); const collapseWithUserMenu = this.__collapseWithUserMenu = new osparc.desktop.CollapseWithUserMenu(); @@ -843,7 +842,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { toolTipText: this.tr("Start App Mode"), height: buttonsHeight }); - startAppBtn.addListener("execute", () => this.fireEvent("slidesAppStart"), this); + startAppBtn.addListener("execute", () => this.getStudy().getUi().setMode("app"), this); slideshowButtons.add(startAppBtn); this.__evalSlidesButtons(); diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index a4a50759085..198156ad183 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -80,9 +80,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { label: this.tr("Convert to Pipeline"), icon: null, }); - control.addListener("execute", () => { - console.log("Convert to Pipeline"); - }); + control.addListener("execute", () => this.getStudy().getUi().setMode("workbench")); break; case "study-menu-download-logs": control = new qx.ui.menu.Button().set({ From 0eefce2936d946a7d4697b7c586b4fd22b588bc6 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:15:57 +0100 Subject: [PATCH 21/45] less page context --- .../source/class/osparc/desktop/SlideshowView.js | 10 ---------- .../client/source/class/osparc/file/FilePicker.js | 14 ++++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js index 63dbae8f79a..52c33d94be9 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/SlideshowView.js @@ -130,12 +130,6 @@ qx.Class.define("osparc.desktop.SlideshowView", { apply: "__applyMaximized", event: "changeMaximized" }, - - pageContext: { - check: ["guided", "app"], - nullable: false, - init: "guided" - } }, statics: { @@ -269,9 +263,6 @@ qx.Class.define("osparc.desktop.SlideshowView", { view = new osparc.node.slideshow.NodeView(); } view.setNode(node); - if (node.isDynamic()) { - view.getSettingsLayout().setVisibility(["app", "standalone"].includes(this.getPageContext()) ? "excluded" : "visible"); - } } this.__connectMaximizeEvents(node); this.__styleView(node, view); @@ -376,7 +367,6 @@ qx.Class.define("osparc.desktop.SlideshowView", { }); } } - this.setPageContext("app"); this.__slideshowToolbar.populateButtons(true); const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); const isValid = slideshow.getPosition(currentNodeId) !== -1; diff --git a/services/static-webserver/client/source/class/osparc/file/FilePicker.js b/services/static-webserver/client/source/class/osparc/file/FilePicker.js index afadab6b230..4437b773064 100644 --- a/services/static-webserver/client/source/class/osparc/file/FilePicker.js +++ b/services/static-webserver/client/source/class/osparc/file/FilePicker.js @@ -39,28 +39,22 @@ qx.Class.define("osparc.file.FilePicker", { /** * @param node {osparc.data.model.Node} Node owning the widget */ - construct: function(node, pageContext = "workbench") { + construct: function(node, viewContext = "workbench") { this.base(arguments); this._setLayout(new qx.ui.layout.VBox(20)); this.set({ node, - pageContext }); - this.__buildLayout(); + this.__buildLayout(viewContext); }, properties: { node: { check: "osparc.data.model.Node" }, - - pageContext: { - check: ["workbench", "guided", "app", "standalone"], - nullable: false - } }, events: { @@ -284,14 +278,14 @@ qx.Class.define("osparc.file.FilePicker", { } }, - __buildLayout: function() { + __buildLayout: function(viewContext) { this._removeAll(); const hasOutput = osparc.file.FilePicker.hasOutputAssigned(this.getNode().getOutputs()); if (hasOutput) { this.__buildInfoLayout(); } else { this.__addProgressBar(); - if (this.getPageContext() === "workbench") { + if (viewContext === "workbench") { this.__buildWorkbenchLayout(); } else { this.setMargin(10); From b6ac8928e61b1bfa9c7a5166e2c242483be04827 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:33:45 +0100 Subject: [PATCH 22/45] [skip ci] minors --- .../source/class/osparc/data/model/IframeHandler.js | 4 +++- .../client/source/class/osparc/desktop/StudyEditor.js | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 3284d73c8de..d08ed1392d6 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -116,7 +116,9 @@ qx.Class.define("osparc.data.model.IframeHandler", { node.addListener("changeLabel", () => loadingPage.setHeader(this.__getLoadingPageHeader()), this); const nodeStatus = node.getStatus(); - const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage(); + const sequenceWidget = nodeStatus.getProgressSequence().getWidgetForLoadingPage().set({ + width: 400 + }); nodeStatus.bind("interactive", sequenceWidget, "visibility", { converter: state => ["pending", "pulling", "starting", "connecting"].includes(state) ? "visible" : "excluded" }); diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 3c1a9465ab2..51cb99a2946 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -109,7 +109,6 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, members: { - __study: null, __settingStudy: null, __viewsStack: null, __workbenchView: null, @@ -707,13 +706,17 @@ qx.Class.define("osparc.desktop.StudyEditor", { this.__viewsStack.setSelection([this.__slideshowView]); this.__slideshowView.startSlides(); break; - case "standalone": + case "standalone": { + this.__viewsStack.setSelection([this.__workbenchView]); + this.__workbenchView.openFirstNode(); + break; + } case "workbench": default: { this.__viewsStack.setSelection([this.__workbenchView]); const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); if (currentNodeId) { - this.__workbenchView.nodeSelected(); + this.__workbenchView.nodeSelected(currentNodeId); } else { this.__workbenchView.openFirstNode(); } From 2d02148fcc5dadd25f8b5f802bd4f2692f703314 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:49:43 +0100 Subject: [PATCH 23/45] convert to standalone --- .../class/osparc/data/model/Workbench.js | 4 +++ .../class/osparc/desktop/WorkbenchView.js | 3 +- .../osparc/navigation/StudyTitleWOptions.js | 30 ++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Workbench.js b/services/static-webserver/client/source/class/osparc/data/model/Workbench.js index d442cb03b63..056b9089c14 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Workbench.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Workbench.js @@ -88,6 +88,10 @@ qx.Class.define("osparc.data.model.Workbench", { }); return Array.from(linkedNodeIDs); }, + + getNonFrontendNodes: function(nodes) { + return Object.values(nodes).filter(node => node.isComputational() || node.isDynamic()); + }, }, members: { diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 1cbab491d4c..720b522da9c 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -557,7 +557,6 @@ qx.Class.define("osparc.desktop.WorkbenchView", { if (node) { this.__populateSecondaryColumn(node); this.__openIframeTab(node); - node.getLoadingPage().maximizeIFrame(true); node.getIFrame().maximizeIFrame(true); } this.__loggerView.setCurrentNodeId(nodeId); @@ -1184,7 +1183,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { openFirstNode: function() { const nodes = this.getStudy().getWorkbench().getNodes(); - const validNodes = Object.values(nodes).filter(node => node.isComputational() || node.isDynamic()); + const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(nodes); if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; this.nodeSelected(dynamicNode.getNodeId()); diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 198156ad183..6f6650bbe3d 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -80,7 +80,28 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { label: this.tr("Convert to Pipeline"), icon: null, }); - control.addListener("execute", () => this.getStudy().getUi().setMode("workbench")); + control.addListener("execute", () => { + this.getStudy().getUi().setMode("workbench"); + const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(this.getStudy().getWorkbench().getNodes()); + if (validNodes.length === 1 && validNodes[0].isDynamic()) { + const dynamicNode = validNodes[0]; + dynamicNode.getIFrame().maximizeIFrame(false); + } + }); + break; + case "study-menu-convert-to-standalone": + control = new qx.ui.menu.Button().set({ + label: this.tr("Convert to Standalone"), + icon: null, + }); + control.addListener("execute", () => { + this.getStudy().getUi().setMode("standalone"); + const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(this.getStudy().getWorkbench().getNodes()); + if (validNodes.length === 1 && validNodes[0].isDynamic()) { + const dynamicNode = validNodes[0]; + dynamicNode.getIFrame().maximizeIFrame(true); + } + }); break; case "study-menu-download-logs": control = new qx.ui.menu.Button().set({ @@ -133,14 +154,21 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { if (study) { const editTitle = this.getChildControl("edit-title-label"); study.bind("name", editTitle, "value"); + const reloadButton = this.getChildControl("study-menu-reload"); study.getUi().bind("mode", reloadButton, "visibility", { converter: mode => mode === "standalone" ? "visible" : "excluded" }); + const convertToPipelineButton = this.getChildControl("study-menu-convert-to-pipeline"); study.getUi().bind("mode", convertToPipelineButton, "visibility", { converter: mode => mode === "standalone" ? "visible" : "excluded" }); + + const convertToStandaloneButton = this.getChildControl("study-menu-convert-to-standalone"); + study.getUi().bind("mode", convertToStandaloneButton, "visibility", { + converter: mode => mode === "workbench" ? "visible" : "excluded" + }); } else { this.exclude(); } From 144cb379171878276d208daefff1b1f9052453f9 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:51:54 +0100 Subject: [PATCH 24/45] minor --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js index 9c04ac3ef7d..ef08f18f085 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -1119,17 +1119,17 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { studiesMoveButton.set({ visibility: selection.length && currentContext === "studiesAndFolders" ? "visible" : "excluded", - label: this.tr("Move") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""), + label: this.tr("Move") + (selection.length > 1 ? ` (${selection.length})` : ""), }); studiesTrashButton.set({ visibility: selection.length && currentContext === "studiesAndFolders" ? "visible" : "excluded", - label: this.tr("Move to Bin") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""), + label: this.tr("Move to Bin") + (selection.length > 1 ? ` (${selection.length})` : ""), }); studiesDeleteButton.set({ visibility: selection.length && currentContext === "trash" ? "visible" : "excluded", - label: this.tr("Delete permanently") + (selection.length > 1 ? this.tr(" selected ") + `(${selection.length})` : ""), + label: this.tr("Delete permanently") + (selection.length > 1 ? ` (${selection.length})` : ""), }); }); From fc08c63a6e19e4d78ca4229dd8268872ff3dbf5b Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 16:56:53 +0100 Subject: [PATCH 25/45] bind --- .../source/class/osparc/data/model/IframeHandler.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index d08ed1392d6..883bfb95e7e 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -92,11 +92,12 @@ qx.Class.define("osparc.data.model.IframeHandler", { __initIFrame: function() { const iframe = new osparc.widget.PersistentIframe(); osparc.utils.Utils.setIdToWidget(iframe.getIframe(), "iframe_"+this.getNode().getNodeId()); - if ( - osparc.product.Utils.isProduct("s4llite") || - this.getStudy().getUi().getMode() === "standalone" - ) { + if (osparc.product.Utils.isProduct("s4llite")) { iframe.setShowToolbar(false); + } else { + this.getStudy().getUi().bind("mode", iframe, "showToolbar", { + converter: mode => mode !== "standalone" + }); } iframe.addListener("restart", () => this.restartIFrame(), this); iframe.getDiskUsageIndicator().setCurrentNode(this.getNode()) From a762dab37194b396076bb7332755f32392a70100 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 17:00:18 +0100 Subject: [PATCH 26/45] convert to standalone working --- .../client/source/class/osparc/navigation/StudyTitleWOptions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 6f6650bbe3d..e0e84bc9cbb 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -116,6 +116,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { optionsMenu.add(this.getChildControl("study-menu-info")); optionsMenu.add(this.getChildControl("study-menu-reload")); optionsMenu.add(this.getChildControl("study-menu-convert-to-pipeline")); + optionsMenu.add(this.getChildControl("study-menu-convert-to-standalone")); optionsMenu.add(this.getChildControl("study-menu-download-logs")); control = new qx.ui.form.MenuButton().set({ appearance: "fab-button", From 8a57934142b0f0ba091923b31f760db243156bd0 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 17:13:56 +0100 Subject: [PATCH 27/45] refactor --- .../source/class/osparc/data/model/Study.js | 5 +++++ .../source/class/osparc/data/model/Workbench.js | 4 ---- .../class/osparc/desktop/WorkbenchView.js | 3 +-- .../osparc/navigation/StudyTitleWOptions.js | 17 ++++++++++++----- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 6a511f726b7..ddb275698c8 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -637,6 +637,11 @@ qx.Class.define("osparc.data.model.Study", { return parameters; }, + getNonFrontendNodes: function() { + const nodes = this.getWorkbench().getNodes(); + return Object.values(nodes).filter(node => node.isComputational() || node.isDynamic()); + }, + hasSlideshow: function() { return !this.getUi().getSlideshow().isEmpty(); }, diff --git a/services/static-webserver/client/source/class/osparc/data/model/Workbench.js b/services/static-webserver/client/source/class/osparc/data/model/Workbench.js index 056b9089c14..d442cb03b63 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Workbench.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Workbench.js @@ -88,10 +88,6 @@ qx.Class.define("osparc.data.model.Workbench", { }); return Array.from(linkedNodeIDs); }, - - getNonFrontendNodes: function(nodes) { - return Object.values(nodes).filter(node => node.isComputational() || node.isDynamic()); - }, }, members: { diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 720b522da9c..d1882ac86c7 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -1182,8 +1182,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { }, openFirstNode: function() { - const nodes = this.getStudy().getWorkbench().getNodes(); - const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(nodes); + const validNodes = this.getStudy().getNonFrontendNodes(); if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; this.nodeSelected(dynamicNode.getNodeId()); diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index e0e84bc9cbb..47dbc7dedea 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -82,7 +82,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); control.addListener("execute", () => { this.getStudy().getUi().setMode("workbench"); - const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(this.getStudy().getWorkbench().getNodes()); + const validNodes = this.getStudy().getNonFrontendNodes(); if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; dynamicNode.getIFrame().maximizeIFrame(false); @@ -96,7 +96,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); control.addListener("execute", () => { this.getStudy().getUi().setMode("standalone"); - const validNodes = osparc.data.model.Workbench.getNonFrontendNodes(this.getStudy().getWorkbench().getNodes()); + const validNodes = this.getStudy().getNonFrontendNodes(); if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; dynamicNode.getIFrame().maximizeIFrame(true); @@ -167,9 +167,16 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); const convertToStandaloneButton = this.getChildControl("study-menu-convert-to-standalone"); - study.getUi().bind("mode", convertToStandaloneButton, "visibility", { - converter: mode => mode === "workbench" ? "visible" : "excluded" - }); + const evaluateConvertToPipelineButton = () => { + const mode = study.getUi(); + if (mode === "workbench") { + convertToStandaloneButton.show(); + } else { + convertToStandaloneButton.exclude(); + } + }; + study.getWorkbench().addListener("pipelineChanged", () => evaluateConvertToPipelineButton()); + study.getUi().addListener("changeMode", () => evaluateConvertToPipelineButton()); } else { this.exclude(); } From c25f59909354f00be862a961cbe34277f43ee276 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 17:17:44 +0100 Subject: [PATCH 28/45] more checks --- .../client/source/class/osparc/data/model/Study.js | 8 ++++++++ .../source/class/osparc/navigation/StudyTitleWOptions.js | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index ddb275698c8..653a9fa72a7 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -642,6 +642,14 @@ qx.Class.define("osparc.data.model.Study", { return Object.values(nodes).filter(node => node.isComputational() || node.isDynamic()); }, + isOnlyNodeDynamic: function() { + const validNodes = this.getStudy().getNonFrontendNodes(); + if (validNodes.length === 1) { + return validNodes[0].isDynamic(); + } + return null; + }, + hasSlideshow: function() { return !this.getUi().getSlideshow().isEmpty(); }, diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 47dbc7dedea..4f85088f32b 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -83,7 +83,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { control.addListener("execute", () => { this.getStudy().getUi().setMode("workbench"); const validNodes = this.getStudy().getNonFrontendNodes(); - if (validNodes.length === 1 && validNodes[0].isDynamic()) { + if (this.getStudy().isOnlyNodeDynamic()) { const dynamicNode = validNodes[0]; dynamicNode.getIFrame().maximizeIFrame(false); } @@ -97,7 +97,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { control.addListener("execute", () => { this.getStudy().getUi().setMode("standalone"); const validNodes = this.getStudy().getNonFrontendNodes(); - if (validNodes.length === 1 && validNodes[0].isDynamic()) { + if (this.getStudy().isOnlyNodeDynamic()) { const dynamicNode = validNodes[0]; dynamicNode.getIFrame().maximizeIFrame(true); } @@ -168,8 +168,7 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { const convertToStandaloneButton = this.getChildControl("study-menu-convert-to-standalone"); const evaluateConvertToPipelineButton = () => { - const mode = study.getUi(); - if (mode === "workbench") { + if (study.getUi().getMode() === "workbench" && study.isOnlyNodeDynamic()) { convertToStandaloneButton.show(); } else { convertToStandaloneButton.exclude(); From ed19d3ae3823a7962850bde7f52a6d2a7aa5cc52 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 17:19:47 +0100 Subject: [PATCH 29/45] minor --- .../client/source/class/osparc/data/model/Study.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 653a9fa72a7..1da17af04d2 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -643,7 +643,7 @@ qx.Class.define("osparc.data.model.Study", { }, isOnlyNodeDynamic: function() { - const validNodes = this.getStudy().getNonFrontendNodes(); + const validNodes = this.getNonFrontendNodes(); if (validNodes.length === 1) { return validNodes[0].isDynamic(); } From e1b0be42a2bf27b1041ae23cd8d90ea442f5987e Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 30 Jan 2025 18:05:22 +0100 Subject: [PATCH 30/45] [skip ci] getIcon --- .../source/class/osparc/data/model/Study.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 1da17af04d2..e3e715c259c 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -61,6 +61,7 @@ qx.Class.define("osparc.data.model.Study", { dev: studyData.dev || this.getDev(), trashedAt: studyData.trashedAt ? new Date(studyData.trashedAt) : this.getTrashedAt(), trashedBy: studyData.trashedBy || null, + icon: this.self().getIcon(studyData), }); const wbData = studyData.workbench || this.getWorkbench(); @@ -225,6 +226,13 @@ qx.Class.define("osparc.data.model.Study", { init: null, event: "changeTrashedBy", }, + + icon: { + check: "String", + nullable: false, + event: "changeIcon", + init: "" + }, // ------ ignore for serializing ------ }, @@ -235,6 +243,7 @@ qx.Class.define("osparc.data.model.Study", { "pipelineRunning", "readOnly", "trashedAt", + "icon", ], IgnoreModelizationProps: [ @@ -308,6 +317,16 @@ qx.Class.define("osparc.data.model.Study", { return false; }, + getIcon: function(studyData) { + let icon = ""; + if (this.getUiMode() === "standalone") { + return "@FontAwesome5Solid/user/14"; + } else if (this.getUiMode() === "workbench") { + return "@FontAwesome5Solid/globe/14"; + } + return icon; + }, + getUiMode: function(studyData) { if ("ui" in studyData && "mode" in studyData["ui"]) { return studyData["ui"]["mode"]; From f747f45140dca7ccbd750f7e50d86fb7460de2a5 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 11:48:05 +0100 Subject: [PATCH 31/45] listen to openWallets event from iframe --- .../client/source/class/osparc/widget/PersistentIframe.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index 202086b04ad..03a5f07069b 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -320,6 +320,10 @@ qx.Class.define("osparc.widget.PersistentIframe", { osparc.vipMarket.MarketWindow.openWindow(nodeId, category); break; } + case "openWallets": { + osparc.desktop.credits.BillingCenterWindow.openWindow(); + break; + } } } }, From 9fa41801ee84a899ba317284696ea789ee244b5a Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 12:11:41 +0100 Subject: [PATCH 32/45] [skip ci] minors --- .../client/source/class/osparc/data/model/Study.js | 4 ++-- .../client/source/class/osparc/widget/PersistentIframe.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index e3e715c259c..759b50236f6 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -319,9 +319,9 @@ qx.Class.define("osparc.data.model.Study", { getIcon: function(studyData) { let icon = ""; - if (this.getUiMode() === "standalone") { + if (this.getUiMode(studyData) === "standalone") { return "@FontAwesome5Solid/user/14"; - } else if (this.getUiMode() === "workbench") { + } else if (this.getUiMode(studyData) === "workbench") { return "@FontAwesome5Solid/globe/14"; } return icon; diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index 03a5f07069b..1a8b291212e 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -299,12 +299,12 @@ qx.Class.define("osparc.widget.PersistentIframe", { }, __handleIframeMessage: function(data, nodeId) { - if (data["type"] && data["message"]) { + if (data["type"]) { switch (data["type"]) { case "theme": { // switch theme driven by the iframe const message = data["message"]; - if (message.includes("osparc;theme=")) { + if (message && message.includes("osparc;theme=")) { const themeName = message.replace("osparc;theme=", ""); const validThemes = osparc.ui.switch.ThemeSwitcher.getValidThemes(); const themeFound = validThemes.find(theme => theme.basename === themeName); From 358464ffe79c07b7040b42ddddc0997e7f228a13 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 13:08:25 +0100 Subject: [PATCH 33/45] minor --- .../client/source/class/osparc/widget/PersistentIframe.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index 1a8b291212e..b9b9e974814 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -321,7 +321,10 @@ qx.Class.define("osparc.widget.PersistentIframe", { break; } case "openWallets": { - osparc.desktop.credits.BillingCenterWindow.openWindow(); + const walletsEnabled = osparc.desktop.credits.Utils.areWalletsEnabled(); + if (walletsEnabled) { + osparc.desktop.credits.BillingCenterWindow.openWindow(); + } break; } } From f8b2e81223f14274ca33239cfad327c432771390 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 13:37:24 +0100 Subject: [PATCH 34/45] one more check --- .../source/class/osparc/widget/PersistentIframe.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js index b9b9e974814..96ecc5c505d 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -316,14 +316,15 @@ qx.Class.define("osparc.widget.PersistentIframe", { break; } case "openMarket": { - const category = data["message"] && data["message"]["category"]; - osparc.vipMarket.MarketWindow.openWindow(nodeId, category); + if (osparc.product.Utils.showS4LStore()) { + const category = data["message"] && data["message"]["category"]; + setTimeout(() => osparc.vipMarket.MarketWindow.openWindow(nodeId, category), 100); + } break; } case "openWallets": { - const walletsEnabled = osparc.desktop.credits.Utils.areWalletsEnabled(); - if (walletsEnabled) { - osparc.desktop.credits.BillingCenterWindow.openWindow(); + if (osparc.desktop.credits.Utils.areWalletsEnabled()) { + setTimeout(() => osparc.desktop.credits.BillingCenterWindow.openWindow(), 100); } break; } From c8c2d3dd78d0519a0b7f2b3a98bb65b84a910af8 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 13:47:12 +0100 Subject: [PATCH 35/45] minor --- .../client/source/class/osparc/desktop/WorkbenchView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index d1882ac86c7..26e8cfbc6ff 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -80,7 +80,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { properties: { study: { check: "osparc.data.model.Study", - apply: "_applyStudy", + apply: "__applyStudy", nullable: false }, @@ -243,7 +243,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { return sidePanelsNewWidth; }, - _applyStudy: function(study) { + __applyStudy: function(study) { if (study) { this.__initViews(); this.__connectEvents(); From 24cb70c337ab573a15529868ad77592bd8e01246 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 13:55:44 +0100 Subject: [PATCH 36/45] [skip ci] init minimized --- .../client/source/class/osparc/desktop/WorkbenchView.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 26e8cfbc6ff..e162ea06d40 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -301,9 +301,12 @@ qx.Class.define("osparc.desktop.WorkbenchView", { if (study === null) { return; } + this.__initPrimaryColumn(); this.__initSecondaryColumn(); this.__initMainView(); + + this.setMaximized(false); }, __initPrimaryColumn: function() { From cd6c172e2139e135861b1a71d28805dd28203d3f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 14:21:36 +0100 Subject: [PATCH 37/45] maximize to loading --- .../source/class/osparc/ui/message/Loading.js | 59 ++++++++++++++++--- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 7e273222e9b..033e92784f2 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -19,6 +19,7 @@ * The loading page * * ----------------------- + * | [] | * | | * | oSparc/service logo | * | spinner + header | @@ -38,9 +39,10 @@ qx.Class.define("osparc.ui.message.Loading", { layout.setRowFlex(this.self().GRID_POS.SPACER_TOP, 1); layout.setRowFlex(this.self().GRID_POS.SPACER_BOTTOM, 1); layout.setColumnFlex(0, 1); - layout.setColumnFlex(2, 1); layout.setColumnMaxWidth(1, 400); layout.setColumnAlign(1, "center", "middle"); + layout.setColumnFlex(2, 1); + layout.setColumnAlign(2, "right", "middle"); this._setLayout(layout); this.__buildLayout(); @@ -67,6 +69,11 @@ qx.Class.define("osparc.ui.message.Loading", { }, }, + events: { + "restore" : "qx.event.type.Event", + "maximize" : "qx.event.type.Event", + }, + statics: { ICON_WIDTH: 190, LOGO_HEIGHT: 100, @@ -74,12 +81,13 @@ qx.Class.define("osparc.ui.message.Loading", { STATUS_ICON_SIZE: 20, GRID_POS: { - SPACER_TOP: 0, - LOGO: 1, - WAITING: 2, - MESSAGES: 3, - EXTRA_WIDGETS: 4, - SPACER_BOTTOM: 5, + TOOLBAR: 0, + SPACER_TOP: 1, + LOGO: 2, + WAITING: 3, + MESSAGES: 4, + EXTRA_WIDGETS: 5, + SPACER_BOTTOM: 6, } }, @@ -95,9 +103,11 @@ qx.Class.define("osparc.ui.message.Loading", { column: 0, row: 0 }); - this._add(new qx.ui.core.Spacer(), { + + const maxLayout = this.__createMaximizeToolbar(); + this._add(maxLayout, { column: 2, - row: 0 + row: this.self().GRID_POS.TOOLBAR }); this._add(new qx.ui.core.Spacer(), { @@ -170,6 +180,37 @@ qx.Class.define("osparc.ui.message.Loading", { }); }, + maximizeIFrame: function(maximize) { + if (maximize) { + this.fireEvent("maximize"); + this.addState("maximized"); + } else { + this.fireEvent("restore"); + this.removeState("maximized"); + } + const maxButton = this.__maxButton; + maxButton.set({ + label: osparc.widget.PersistentIframe.getZoomLabel(maximize), + icon: osparc.widget.PersistentIframe.getZoomIcon(maximize) + }); + osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); + qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized")); + }, + + __createMaximizeToolbar: function() { + const maximize = false; + const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ + label: osparc.widget.PersistentIframe.getZoomLabel(maximize), + icon: osparc.widget.PersistentIframe.getZoomIcon(maximize), + }); + osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); + maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); + + const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox()); + maximizeLayout.add(maxButton); + return maximizeLayout; + }, + __applyLogo: function(newLogo) { const productLogoPath = osparc.product.Utils.getLogoPath(); if (newLogo !== productLogoPath) { From 9e342cf15a1ed3b003511a08b964414f46f1df66 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 14:22:52 +0100 Subject: [PATCH 38/45] [skip ci] minor --- .../client/source/class/osparc/ui/message/Loading.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 033e92784f2..39ce847dcc4 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -206,7 +206,9 @@ qx.Class.define("osparc.ui.message.Loading", { osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); - const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox()); + const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({ + alignX: "right", + })); maximizeLayout.add(maxButton); return maximizeLayout; }, From e2f1607afd8264328a49ef69ce1042f224b75f4b Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 15:06:20 +0100 Subject: [PATCH 39/45] currentNodeId more progress --- .../class/osparc/data/model/IframeHandler.js | 7 ++++ .../class/osparc/desktop/StudyEditor.js | 7 +++- .../class/osparc/desktop/WorkbenchView.js | 34 ++++++++++++++----- .../source/class/osparc/ui/message/Loading.js | 18 ++++++++-- 4 files changed, 54 insertions(+), 12 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js index 883bfb95e7e..1c521de8d9d 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js +++ b/services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js @@ -108,6 +108,13 @@ qx.Class.define("osparc.data.model.IframeHandler", { const loadingPage = new osparc.ui.message.Loading().set({ header: this.__getLoadingPageHeader() }); + if (osparc.product.Utils.isProduct("s4llite")) { + loadingPage.setShowToolbar(false); + } else { + this.getStudy().getUi().bind("mode", loadingPage, "showToolbar", { + converter: mode => mode !== "standalone" + }); + } const node = this.getNode(); const thumbnail = node.getMetaData()["thumbnail"]; diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 51cb99a2946..5d7476eaf5b 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -716,7 +716,12 @@ qx.Class.define("osparc.desktop.StudyEditor", { this.__viewsStack.setSelection([this.__workbenchView]); const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); if (currentNodeId) { - this.__workbenchView.nodeSelected(currentNodeId); + const node = this.getStudy().getWorkbench().getNode(currentNodeId); + if (node && node.isDynamic()) { + this.__workbenchView.fullscreenNode(currentNodeId); + } else { + this.__workbenchView.nodeSelected(currentNodeId); + } } else { this.__workbenchView.openFirstNode(); } diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index e162ea06d40..26f026b100c 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -503,6 +503,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__evalIframe(); this.__openWorkbenchTab(); this.__loggerView.setCurrentNodeId(null); + + this.getStudy().getUi().setCurrentNodeId(this.getStudy().getUuid()); }); nodesTree.addListener("changeSelectedNode", e => { studyTreeItem.resetSelection(); @@ -516,6 +518,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__loggerView.setCurrentNodeId(nodeId); this.__workbenchUI.nodeSelected(nodeId); this.fireDataEvent("changeSelectedNode", nodeId); + + this.getStudy().getUi().setCurrentNodeId(nodeId); }); if (this.__workbenchUIConnected === null) { @@ -531,9 +535,13 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__evalIframe(node); this.__loggerView.setCurrentNodeId(nodeId); this.fireDataEvent("changeSelectedNode", nodeId); + + this.getStudy().getUi().setCurrentNodeId(nodeId); } else { // empty selection this.__studyTreeItem.selectStudyItem(); + + this.getStudy().getUi().setCurrentNodeId(this.getStudy().getUuid()); } }); workbenchUI.addListener("nodeSelected", e => { @@ -547,6 +555,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__populateSecondaryColumn(node); this.__openIframeTab(node); this.__loggerView.setCurrentNodeId(nodeId); + + this.getStudy().getUi().setCurrentNodeId(nodeId); } }, this); } @@ -564,6 +574,8 @@ qx.Class.define("osparc.desktop.WorkbenchView", { } this.__loggerView.setCurrentNodeId(nodeId); this.__workbenchUI.nodeSelected(nodeId); + + this.getStudy().getUi().setCurrentNodeId(nodeId); } }, this); nodesTree.addListener("removeNode", e => { @@ -1184,19 +1196,25 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__nodesTree.nodeSelected(this.__currentNodeId); }, + fullscreenNode: function(nodeId) { + const node = this.getStudy().getWorkbench().getNode(nodeId); + if (node.isDynamic()) { + qx.event.Timer.once(() => { + this.__openIframeTab(node); + node.getIFrame().maximizeIFrame(true); + }, this, 10); + } + }, + openFirstNode: function() { const validNodes = this.getStudy().getNonFrontendNodes(); if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; - this.nodeSelected(dynamicNode.getNodeId()); - qx.event.Timer.once(() => { - this.__openIframeTab(dynamicNode); - dynamicNode.getIFrame().maximizeIFrame(true); - }, this, 10); - return; + this.fullscreenNode(dynamicNode.getNodeId()); + } else { + this.setMaximized(false); + this.nodeSelected(this.getStudy().getUuid()); } - this.setMaximized(false); - this.nodeSelected(this.getStudy().getUuid()); } } }); diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 39ce847dcc4..2bec282ad2e 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -67,6 +67,15 @@ qx.Class.define("osparc.ui.message.Loading", { nullable: true, apply: "__applyMessages" }, + + /** + * Show Restart-Maximize Toolbar + */ + showToolbar: { + check: "Boolean", + init: false, + event: "changeShowToolbar", + } }, events: { @@ -206,11 +215,14 @@ qx.Class.define("osparc.ui.message.Loading", { osparc.utils.Utils.setIdToWidget(maxButton, osparc.widget.PersistentIframe.getMaximizeWidgetId(maximize)); maxButton.addListener("execute", () => this.maximizeIFrame(!this.hasState("maximized")), this); - const maximizeLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({ + const toolbarLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({ alignX: "right", })); - maximizeLayout.add(maxButton); - return maximizeLayout; + this.bind("showToolbar", toolbarLayout, "visibility", { + converter: showToolbar => showToolbar ? "visible" : "hidden" + }); + toolbarLayout.add(maxButton); + return toolbarLayout; }, __applyLogo: function(newLogo) { From dea946832284c79b2e286c9df42f69120496f02d Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 15:16:22 +0100 Subject: [PATCH 40/45] refactor --- .../class/osparc/desktop/WorkbenchView.js | 17 ++++++----------- .../source/class/osparc/ui/message/Loading.js | 3 ++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 26f026b100c..62ab71148d0 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -565,16 +565,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { const nodeId = e.getData(); if (nodeId) { studyTreeItem.resetSelection(); - const workbench = this.getStudy().getWorkbench(); - const node = workbench.getNode(nodeId); - if (node) { - this.__populateSecondaryColumn(node); - this.__openIframeTab(node); - node.getIFrame().maximizeIFrame(true); - } - this.__loggerView.setCurrentNodeId(nodeId); - this.__workbenchUI.nodeSelected(nodeId); - + this.fullscreenNode(nodeId); this.getStudy().getUi().setCurrentNodeId(nodeId); } }, this); @@ -1198,12 +1189,15 @@ qx.Class.define("osparc.desktop.WorkbenchView", { fullscreenNode: function(nodeId) { const node = this.getStudy().getWorkbench().getNode(nodeId); - if (node.isDynamic()) { + if (node && node.isDynamic()) { qx.event.Timer.once(() => { + this.__populateSecondaryColumn(node); this.__openIframeTab(node); node.getIFrame().maximizeIFrame(true); }, this, 10); } + this.__loggerView.setCurrentNodeId(nodeId); + this.__workbenchUI.nodeSelected(nodeId); }, openFirstNode: function() { @@ -1211,6 +1205,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { if (validNodes.length === 1 && validNodes[0].isDynamic()) { const dynamicNode = validNodes[0]; this.fullscreenNode(dynamicNode.getNodeId()); + this.getStudy().getUi().setCurrentNodeId(dynamicNode.getNodeId()); } else { this.setMaximized(false); this.nodeSelected(this.getStudy().getUuid()); diff --git a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js index 2bec282ad2e..e222ead4cbf 100644 --- a/services/static-webserver/client/source/class/osparc/ui/message/Loading.js +++ b/services/static-webserver/client/source/class/osparc/ui/message/Loading.js @@ -108,7 +108,7 @@ qx.Class.define("osparc.ui.message.Loading", { __maxButton: null, __buildLayout: function() { - this._add(new qx.ui.core.Spacer(), { + this._add(new qx.ui.core.Widget(), { column: 0, row: 0 }); @@ -209,6 +209,7 @@ qx.Class.define("osparc.ui.message.Loading", { __createMaximizeToolbar: function() { const maximize = false; const maxButton = this.__maxButton = osparc.widget.PersistentIframe.createToolbarButton(maximize).set({ + maxHeight: 25, label: osparc.widget.PersistentIframe.getZoomLabel(maximize), icon: osparc.widget.PersistentIframe.getZoomIcon(maximize), }); From 54932cfae176cf785f1421a69452460294c4420f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 15:43:06 +0100 Subject: [PATCH 41/45] transition --- .../class/osparc/desktop/StudyEditor.js | 27 ++++++++++++------- .../class/osparc/desktop/WorkbenchView.js | 14 +++++++--- .../osparc/navigation/StudyTitleWOptions.js | 5 ---- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 5d7476eaf5b..1a921002082 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -169,7 +169,9 @@ qx.Class.define("osparc.desktop.StudyEditor", { }, this); } - study.getUi().addListener("changeMode", e => this.__uiModeChanged(e.getData())); + study.getUi().addListener("changeMode", e => { + this.__uiModeChanged(e.getData(), e.getOldData()); + }); }) .catch(err => { console.error(err); @@ -699,7 +701,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { return this.__workbenchView.getLogger(); }, - __uiModeChanged: function(newUIMode) { + __uiModeChanged: function(newUIMode, oldUIMode) { switch (newUIMode) { case "guided": case "app": @@ -714,16 +716,21 @@ qx.Class.define("osparc.desktop.StudyEditor", { case "workbench": default: { this.__viewsStack.setSelection([this.__workbenchView]); - const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); - if (currentNodeId) { - const node = this.getStudy().getWorkbench().getNode(currentNodeId); - if (node && node.isDynamic()) { - this.__workbenchView.fullscreenNode(currentNodeId); + if (oldUIMode === "standalone") { + // in this transition, show workbenchUI + this.__workbenchView.showPipeline(); + } else { + const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); + if (currentNodeId) { + const node = this.getStudy().getWorkbench().getNode(currentNodeId); + if (node && node.isDynamic()) { + this.__workbenchView.fullscreenNode(currentNodeId); + } else { + this.__workbenchView.nodeSelected(currentNodeId); + } } else { - this.__workbenchView.nodeSelected(currentNodeId); + this.__workbenchView.openFirstNode(); } - } else { - this.__workbenchView.openFirstNode(); } break; } diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 62ab71148d0..f1999ebb99f 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -499,10 +499,7 @@ qx.Class.define("osparc.desktop.WorkbenchView", { studyTreeItem.addListener("changeSelectedNode", () => { nodesTree.resetSelection(); - this.__populateSecondaryColumn(this.getStudy()); - this.__evalIframe(); - this.__openWorkbenchTab(); - this.__loggerView.setCurrentNodeId(null); + this.showPipeline(); this.getStudy().getUi().setCurrentNodeId(this.getStudy().getUuid()); }); @@ -1187,6 +1184,15 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__nodesTree.nodeSelected(this.__currentNodeId); }, + showPipeline: function() { + this.__populateSecondaryColumn(this.getStudy()); + this.__evalIframe(); + this.__openWorkbenchTab(); + this.__loggerView.setCurrentNodeId(null); + + this.getStudy().getUi().setCurrentNodeId(this.getStudy().getUuid()); + }, + fullscreenNode: function(nodeId) { const node = this.getStudy().getWorkbench().getNode(nodeId); if (node && node.isDynamic()) { diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 4f85088f32b..8ca51ad9026 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -96,11 +96,6 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); control.addListener("execute", () => { this.getStudy().getUi().setMode("standalone"); - const validNodes = this.getStudy().getNonFrontendNodes(); - if (this.getStudy().isOnlyNodeDynamic()) { - const dynamicNode = validNodes[0]; - dynamicNode.getIFrame().maximizeIFrame(true); - } }); break; case "study-menu-download-logs": From 669f096a4ae8f97da3997b2c63551feb857b2c0f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 15:50:05 +0100 Subject: [PATCH 42/45] simplify --- .../client/source/class/osparc/desktop/StudyEditor.js | 1 + .../source/class/osparc/navigation/StudyTitleWOptions.js | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js index 1a921002082..9d7f33e55e3 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -718,6 +718,7 @@ qx.Class.define("osparc.desktop.StudyEditor", { this.__viewsStack.setSelection([this.__workbenchView]); if (oldUIMode === "standalone") { // in this transition, show workbenchUI + this.__workbenchView.setMaximized(false); this.__workbenchView.showPipeline(); } else { const currentNodeId = this.getStudy().getUi().getCurrentNodeId(); diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index 8ca51ad9026..e1e29a260cd 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -82,11 +82,6 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { }); control.addListener("execute", () => { this.getStudy().getUi().setMode("workbench"); - const validNodes = this.getStudy().getNonFrontendNodes(); - if (this.getStudy().isOnlyNodeDynamic()) { - const dynamicNode = validNodes[0]; - dynamicNode.getIFrame().maximizeIFrame(false); - } }); break; case "study-menu-convert-to-standalone": From c8ce874f019d44104667b1314f0c2c000fe934f1 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 16:49:09 +0100 Subject: [PATCH 43/45] exclude until we have the export to standalone backend functionality --- .../source/class/osparc/navigation/StudyTitleWOptions.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js index e1e29a260cd..4147444812b 100644 --- a/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js +++ b/services/static-webserver/client/source/class/osparc/navigation/StudyTitleWOptions.js @@ -158,11 +158,8 @@ qx.Class.define("osparc.navigation.StudyTitleWOptions", { const convertToStandaloneButton = this.getChildControl("study-menu-convert-to-standalone"); const evaluateConvertToPipelineButton = () => { - if (study.getUi().getMode() === "workbench" && study.isOnlyNodeDynamic()) { - convertToStandaloneButton.show(); - } else { - convertToStandaloneButton.exclude(); - } + // exclude until we have the export to standalone backend functionality + convertToStandaloneButton.exclude(); }; study.getWorkbench().addListener("pipelineChanged", () => evaluateConvertToPipelineButton()); study.getUi().addListener("changeMode", () => evaluateConvertToPipelineButton()); From 9c61212dc4deb0d19aa81439553e8ad35ba06717 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 17:26:05 +0100 Subject: [PATCH 44/45] no icon yet --- .../source/class/osparc/data/model/Study.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Study.js b/services/static-webserver/client/source/class/osparc/data/model/Study.js index 759b50236f6..1da17af04d2 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Study.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Study.js @@ -61,7 +61,6 @@ qx.Class.define("osparc.data.model.Study", { dev: studyData.dev || this.getDev(), trashedAt: studyData.trashedAt ? new Date(studyData.trashedAt) : this.getTrashedAt(), trashedBy: studyData.trashedBy || null, - icon: this.self().getIcon(studyData), }); const wbData = studyData.workbench || this.getWorkbench(); @@ -226,13 +225,6 @@ qx.Class.define("osparc.data.model.Study", { init: null, event: "changeTrashedBy", }, - - icon: { - check: "String", - nullable: false, - event: "changeIcon", - init: "" - }, // ------ ignore for serializing ------ }, @@ -243,7 +235,6 @@ qx.Class.define("osparc.data.model.Study", { "pipelineRunning", "readOnly", "trashedAt", - "icon", ], IgnoreModelizationProps: [ @@ -317,16 +308,6 @@ qx.Class.define("osparc.data.model.Study", { return false; }, - getIcon: function(studyData) { - let icon = ""; - if (this.getUiMode(studyData) === "standalone") { - return "@FontAwesome5Solid/user/14"; - } else if (this.getUiMode(studyData) === "workbench") { - return "@FontAwesome5Solid/globe/14"; - } - return icon; - }, - getUiMode: function(studyData) { if ("ui" in studyData && "mode" in studyData["ui"]) { return studyData["ui"]["mode"]; From 11a954e491c2a5abf626b5eadf5b2e775e54bb4d Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Fri, 31 Jan 2025 17:35:39 +0100 Subject: [PATCH 45/45] Convert to Pipeline from dashboard --- .../source/class/osparc/dashboard/CardBase.js | 4 ++ .../class/osparc/dashboard/StudyBrowser.js | 46 +++++++++++++++---- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js index e0aa907e11a..4f99235ec6e 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/CardBase.js @@ -877,6 +877,10 @@ qx.Class.define("osparc.dashboard.CardBase", { if (duplicateButton) { duplicateButton.setEnabled(osparc.study.Utils.canBeDuplicated(resourceData)); } + const convertToPipelineButton = menuButtons.find(menuBtn => "convertToPipelineButton" in menuBtn); + if (convertToPipelineButton) { + convertToPipelineButton.setEnabled(osparc.study.Utils.canBeDuplicated(resourceData)); + } const exportCMISButton = menuButtons.find(menuBtn => "exportCMISButton" in menuBtn); if (exportCMISButton) { exportCMISButton.setEnabled(osparc.study.Utils.canBeExported(resourceData)); diff --git a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js index ef08f18f085..22321e4b164 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -1648,6 +1648,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { const duplicateStudyButton = this.__getDuplicateMenuButton(studyData); menu.add(duplicateStudyButton); + const convertToPipelineButton = this.__getConvertToPipelineMenuButton(studyData); + menu.add(convertToPipelineButton); + if (osparc.product.Utils.isProduct("osparc")) { const exportStudyButton = this.__getExportMenuButton(studyData); menu.add(exportStudyButton); @@ -1722,6 +1725,16 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { return renameButton; }, + __updateName: function(studyData, name) { + osparc.info.StudyUtils.patchStudyData(studyData, "name", name) + .then(() => this._updateStudyData(studyData)) + .catch(err => { + console.error(err); + const msg = err.message || this.tr("Something went wrong Renaming"); + osparc.FlashMessenger.logAs(msg, "ERROR"); + }); + }, + __getThumbnailStudyMenuButton: function(studyData) { const thumbButton = new qx.ui.menu.Button(this.tr("Thumbnail..."), "@FontAwesome5Solid/image/12"); thumbButton.addListener("execute", () => { @@ -1743,16 +1756,6 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { return thumbButton; }, - __updateName: function(studyData, name) { - osparc.info.StudyUtils.patchStudyData(studyData, "name", name) - .then(() => this._updateStudyData(studyData)) - .catch(err => { - console.error(err); - const msg = err.message || this.tr("Something went wrong Renaming"); - osparc.FlashMessenger.logAs(msg, "ERROR"); - }); - }, - __updateThumbnail: function(studyData, url) { osparc.info.StudyUtils.patchStudyData(studyData, "thumbnail", url) .then(() => this._updateStudyData(studyData)) @@ -1860,6 +1863,29 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { return duplicateButton; }, + __getConvertToPipelineMenuButton: function(studyData) { + const convertToPipelineButton = new qx.ui.menu.Button(this.tr("Convert to Pipeline"), null); + convertToPipelineButton["convertToPipelineButton"] = true; + const uiMode = osparc.data.model.Study.getUiMode(studyData); + convertToPipelineButton.setVisibility(uiMode === "standalone" ? "visible" : "excluded"); + convertToPipelineButton.addListener("execute", () => { + this.__updateUIMode(studyData, "workbench") + .catch(err => { + console.error(err); + const msg = err.message || this.tr("Something went wrong Converting to Pipeline"); + osparc.FlashMessenger.logAs(msg, "ERROR"); + }); + }, this); + return convertToPipelineButton; + }, + + __updateUIMode: function(studyData, uiMode) { + const studyUI = osparc.utils.Utils.deepCloneObject(studyData["ui"]); + studyUI["mode"] = uiMode; + return osparc.info.StudyUtils.patchStudyData(studyData, "ui", studyUI) + .then(() => this._updateStudyData(studyData)) + }, + __getExportMenuButton: function(studyData) { const exportButton = new qx.ui.menu.Button(this.tr("Export cMIS"), "@FontAwesome5Solid/cloud-download-alt/12"); exportButton["exportCMISButton"] = true;