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..2cdac611102 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, // center it + }); this.addAt(moreMenuButton, this.__itemIdx); this.__itemIdx++; 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..21e953efe51 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(); @@ -417,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); 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; } 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, }); }, }, 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"); } 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; 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..7734141dfca 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.__attachListeners(); + this.__attachInterIframeThemeSyncer(); + this.__attachInterIframeListeners(); }, - __attachTriggerers: function() { + __attachInterIframeThemeSyncer: function() { this.postThemeSwitch = theme => { const msg = "osparc;theme=" + theme; this.sendMessageToIframe(msg); @@ -279,12 +279,14 @@ qx.Class.define("osparc.widget.PersistentIframe", { } }, - __attachListeners: function() { + __attachInterIframeListeners: function() { this.__iframe.addListener("load", () => { 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) {