From 63d384684c6672e736f73bfdd10c8be6ddf73174 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 08:51:15 +0200 Subject: [PATCH 01/10] updateSubJob --- .../client/source/class/osparc/data/SubJob.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/SubJob.js b/services/static-webserver/client/source/class/osparc/data/SubJob.js index 5f49c345e4e..9ee1f017463 100644 --- a/services/static-webserver/client/source/class/osparc/data/SubJob.js +++ b/services/static-webserver/client/source/class/osparc/data/SubJob.js @@ -24,15 +24,9 @@ qx.Class.define("osparc.data.SubJob", { this.set({ projectUuid: subJobData["projectUuid"], nodeId: subJobData["nodeId"], - nodeName: subJobData["nodeName"], - state: subJobData["state"], - progress: subJobData["progress"], - startedAt: subJobData["startedAt"] ? new Date(subJobData["startedAt"]) : null, - endedAt: subJobData["endedAt"] ? new Date(subJobData["endedAt"]) : null, - osparcCredits: subJobData["osparcCredits"] === null ? null : -1*parseFloat(subJobData["osparcCredits"]), - image: subJobData["image"] || {}, - logDownloadLink: subJobData["logDownloadLink"] || null, }); + + this.updateSubJob(subJobData); }, properties: { @@ -100,11 +94,14 @@ qx.Class.define("osparc.data.SubJob", { members: { updateSubJob: function(subJobData) { this.set({ + nodeName: subJobData["nodeName"], state: subJobData["state"], progress: subJobData["progress"], startedAt: subJobData["startedAt"] ? new Date(subJobData["startedAt"]) : null, endedAt: subJobData["endedAt"] ? new Date(subJobData["endedAt"]) : null, osparcCredits: subJobData["osparcCredits"] === null ? null : -1*parseFloat(subJobData["osparcCredits"]), + image: subJobData["image"] || {}, + logDownloadLink: subJobData["logDownloadLink"] || null, }); }, }, From 4eafde3d54ec3eab0ff7c7d3ac426e0b72f32d6e Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 11:38:56 +0200 Subject: [PATCH 02/10] Hide Templates and Public Projects in TIP --- .../osparc/dashboard/ResourceBrowserFilter.js | 8 +++++-- .../source/class/osparc/product/Utils.js | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js index 21bc6a52c46..68e129f73ca 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js @@ -60,8 +60,12 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", { switch (this.__resourceType) { case "study": { this._add(this.__createWorkspacesAndFoldersTree()); - this._add(this.__createTemplates()); - this._add(this.__createPublicProjects()); + if (osparc.product.Utils.showTemplates()) { + this._add(this.__createTemplates()); + } + if (osparc.product.Utils.showPublicProjects()) { + this._add(this.__createPublicProjects()); + } this._add(this.__createTrashBin()); this._add(filtersSpacer); const scrollView = new qx.ui.container.Scroll(); diff --git a/services/static-webserver/client/source/class/osparc/product/Utils.js b/services/static-webserver/client/source/class/osparc/product/Utils.js index 2005ef26a3b..9f81c38f71a 100644 --- a/services/static-webserver/client/source/class/osparc/product/Utils.js +++ b/services/static-webserver/client/source/class/osparc/product/Utils.js @@ -284,6 +284,28 @@ qx.Class.define("osparc.product.Utils", { return true; }, + showTemplates: function() { + if (osparc.data.Permissions.getInstance().isTester()) { + return true; + } + + if (this.isProduct("tis") || this.isProduct("tiplite")) { + return false; + } + return true; + }, + + showPublicProjects: function() { + if (osparc.data.Permissions.getInstance().isTester()) { + return true; + } + + if (this.isProduct("tis") || this.isProduct("tiplite")) { + return false; + } + return true; + }, + showQuality: function() { if (this.isProduct("osparc")) { return true; From 1bc255c4d114f14963d0d9d8599420bcfd8c7f7c Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 11:56:40 +0200 Subject: [PATCH 03/10] showPublicProjects II --- .../source/class/osparc/dashboard/ResourceDetails.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 fb7a71901cc..2f9454212e3 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceDetails.js @@ -761,7 +761,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { }, __getPublishPage: function() { - if (!osparc.utils.Resources.isStudy(this.__resourceData)) { + if ( + !osparc.utils.Resources.isStudy(this.__resourceData) || + !osparc.product.Utils.showPublicProjects() + ) { return null; } @@ -799,7 +802,10 @@ qx.Class.define("osparc.dashboard.ResourceDetails", { }, __getCreateTemplatePage: function() { - if (!osparc.utils.Resources.isStudy(this.__resourceData)) { + if ( + !osparc.utils.Resources.isStudy(this.__resourceData) || + osparc.product.Utils.showTemplates() + ) { return null; } From 6bea282f661ae3788aa6442aa717563f8edbba7a Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 12:18:19 +0200 Subject: [PATCH 04/10] minor --- .../source/class/osparc/dashboard/ResourceBrowserFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js index 68e129f73ca..21e953efe51 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ResourceBrowserFilter.js @@ -421,7 +421,7 @@ qx.Class.define("osparc.dashboard.ResourceBrowserFilter", { // hypertools filter const button = new qx.ui.toolbar.RadioButton("Hypertools", null); - osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON(), 20); + osparc.utils.Utils.replaceIconWithThumbnail(button, osparc.data.model.StudyUI.HYPERTOOL_ICON(18), 20); button.appType = "hypertool"; this.__appTypeButtons.push(button); From 780d5bb7a8a56455455dbf886509a225f72ff62f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 12:26:14 +0200 Subject: [PATCH 05/10] More icon --- .../client/source/class/osparc/dashboard/NewPlusMenu.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js b/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js index 6167e92acb9..5b5f6e80ff9 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js @@ -170,7 +170,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", { if (osparc.product.Utils.isS4LProduct()) { this.__addHypertools(); } - this.__addOtherTabsAccess(); + this.__addMoreMenu(); this.getChildControl("new-folder"); }, @@ -230,8 +230,11 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", { }); }, - __addOtherTabsAccess: function() { - const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/star/16", this.tr("More")); + __addMoreMenu: function() { + const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/angle-double-right/16", this.tr("More")); + moreMenuButton.getChildControl("icon").set({ + marginLeft: 6, + }); this.addAt(moreMenuButton, this.__itemIdx); this.__itemIdx++; From 30dd95ec4889455488a2aabdc2721121cd759533 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 12:30:54 +0200 Subject: [PATCH 06/10] comment --- .../client/source/class/osparc/dashboard/NewPlusMenu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js b/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js index 5b5f6e80ff9..2cdac611102 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/NewPlusMenu.js @@ -233,7 +233,7 @@ qx.Class.define("osparc.dashboard.NewPlusMenu", { __addMoreMenu: function() { const moreMenuButton = this.self().createMenuButton("@FontAwesome5Solid/angle-double-right/16", this.tr("More")); moreMenuButton.getChildControl("icon").set({ - marginLeft: 6, + marginLeft: 6, // center it }); this.addAt(moreMenuButton, this.__itemIdx); this.__itemIdx++; From 90be6d4f7b7b55bbf502d2bb8098d9c4288362d8 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 12:38:08 +0200 Subject: [PATCH 07/10] getUser for thumbnail --- .../client/source/class/osparc/info/CommentUI.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/info/CommentUI.js b/services/static-webserver/client/source/class/osparc/info/CommentUI.js index d6cde919dbd..d945cd65f8e 100644 --- a/services/static-webserver/client/source/class/osparc/info/CommentUI.js +++ b/services/static-webserver/client/source/class/osparc/info/CommentUI.js @@ -126,11 +126,13 @@ qx.Class.define("osparc.info.CommentUI", { const commentContent = this.getChildControl("comment-content"); commentContent.setValue(this.__comment["content"]); - const user = osparc.store.Groups.getInstance().getUserByGroupId(this.__comment["userGroupId"]) - if (user) { - thumbnail.setSource(user.getThumbnail()); - userName.setValue(user.getLabel()); - } + osparc.store.Users.getInstance().getUser(this.__comment["userGroupId"]) + .then(user => { + if (user) { + thumbnail.setSource(user.getThumbnail()); + userName.setValue(user.getLabel()); + } + }); this.getChildControl("spacer"); } From 256d14d808e885365f75d73d0f70f0425302ceac Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 15:17:52 +0200 Subject: [PATCH 08/10] rename --- .../client/source/class/osparc/widget/PersistentIframe.js | 4 ++-- 1 file changed, 2 insertions(+), 2 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 c2a1164de8a..c6017f3bdc2 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -248,11 +248,11 @@ qx.Class.define("osparc.widget.PersistentIframe", { }, __attachInterframeMessageHandlers: function() { - this.__attachTriggerers(); + this.__attachThemeSyncer(); this.__attachListeners(); }, - __attachTriggerers: function() { + __attachThemeSyncer: function() { this.postThemeSwitch = theme => { const msg = "osparc;theme=" + theme; this.sendMessageToIframe(msg); From c612b5e2cbd84fc926b61d45211f041e0abfce5c Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 15:19:25 +0200 Subject: [PATCH 09/10] rename --- .../client/source/class/osparc/widget/PersistentIframe.js | 8 ++++---- 1 file changed, 4 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 c6017f3bdc2..1baa6c7e58f 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -248,11 +248,11 @@ qx.Class.define("osparc.widget.PersistentIframe", { }, __attachInterframeMessageHandlers: function() { - this.__attachThemeSyncer(); - this.__attachListeners(); + this.__attachInterIframeThemeSyncer(); + this.__attachInterIframeListeners(); }, - __attachThemeSyncer: function() { + __attachInterIframeThemeSyncer: function() { this.postThemeSwitch = theme => { const msg = "osparc;theme=" + theme; this.sendMessageToIframe(msg); @@ -279,7 +279,7 @@ qx.Class.define("osparc.widget.PersistentIframe", { } }, - __attachListeners: function() { + __attachInterIframeListeners: function() { this.__iframe.addListener("load", () => { const iframe = this._getIframeElement(); if (iframe) { From 3ef74130a900c32119b81558dd2766a76ed5dbb4 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Tue, 3 Jun 2025 15:24:53 +0200 Subject: [PATCH 10/10] Make sure the iframe is loaded and has a valid source --- .../client/source/class/osparc/widget/PersistentIframe.js | 4 +++- 1 file changed, 3 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 1baa6c7e58f..7734141dfca 100644 --- a/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/widget/PersistentIframe.js @@ -284,7 +284,9 @@ qx.Class.define("osparc.widget.PersistentIframe", { const iframe = this._getIframeElement(); if (iframe) { const iframeDomEl = iframe.getDomElement(); - if (iframeDomEl) { + const iframeSource = iframe.getSource(); + // Make sure the iframe is loaded and has a valid source + if (iframeDomEl && iframeSource && iframeSource !== "about:blank") { window.addEventListener("message", message => { const data = message.data; if (data) {