diff --git a/services/static-webserver/client/source/class/osparc/component/widget/PersistentIframe.js b/services/static-webserver/client/source/class/osparc/component/widget/PersistentIframe.js index caca11d7246..82c727ee8ab 100644 --- a/services/static-webserver/client/source/class/osparc/component/widget/PersistentIframe.js +++ b/services/static-webserver/client/source/class/osparc/component/widget/PersistentIframe.js @@ -29,15 +29,27 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { }, statics: { + getZoomLabel: function(maximize) { + return maximize ? "Restore" : "Maximize"; + }, + getZoomIcon: function(maximize) { const iconURL = maximize ? "window-restore" : "window-maximize"; - return osparc.theme.common.Image.URLS[iconURL]+"/20"; + return osparc.theme.common.Image.URLS[iconURL] + "/20"; }, getMaximizeWidgetId: function(maximize) { return maximize ? "restoreBtn" : "maximizeBtn"; }, + createToolbarButton: function() { + return new qx.ui.form.Button().set({ + zIndex: 20, + backgroundColor: "transparent", + decorator: null + }); + }, + HIDDEN_TOP: -10000 }, @@ -69,7 +81,7 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { members: { __iframe: null, __syncScheduled: null, - __restartButton: null, + __reloadButton: null, __zoomButton: null, // override @@ -85,27 +97,25 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { }); const iframeEl = this._getIframeElement(); iframeEl.setAttribute("allow", "clipboard-write"); - const restartButton = this.__restartButton = new qx.ui.form.Button(null, "@FontAwesome5Solid/redo-alt/14").set({ - zIndex: 20, + const reloadButton = this.__reloadButton = this.self().createToolbarButton().set({ + label: this.tr("Reload"), + icon: "@FontAwesome5Solid/redo-alt/14", paddingLeft: 8, paddingRight: 4, paddingTop: 6, paddingBottom: 6, - backgroundColor: "transparent", - decorator: null + gap: 10 }); - restartButton.addListener("execute", e => { + reloadButton.addListener("execute", e => { this.fireEvent("restart"); }, this); - osparc.utils.Utils.setIdToWidget(restartButton, "iFrameRestartBtn"); - appRoot.add(restartButton, { + osparc.utils.Utils.setIdToWidget(reloadButton, "iFrameRestartBtn"); + appRoot.add(reloadButton, { top: this.self().HIDDEN_TOP }); - const zoomButton = this.__zoomButton = new qx.ui.form.Button(null).set({ - icon: this.self().getZoomIcon(false), - zIndex: 20, - backgroundColor: "transparent", - decorator: null + const zoomButton = this.__zoomButton = this.self().createToolbarButton().set({ + label: this.self().getZoomLabel(false), + icon: this.self().getZoomIcon(false) }); osparc.utils.Utils.setIdToWidget(zoomButton, this.self().getMaximizeWidgetId(false)); appRoot.add(zoomButton, { @@ -122,7 +132,7 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { iframe.setLayoutProperties({ top: this.self().HIDDEN_TOP }); - restartButton.setLayoutProperties({ + reloadButton.setLayoutProperties({ top: this.self().HIDDEN_TOP }); zoomButton.setLayoutProperties({ @@ -159,7 +169,10 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { this.removeState("maximized"); } const actionButton = this.__zoomButton; - actionButton.setIcon(this.self().getZoomIcon(maximize)); + actionButton.set({ + label: this.self().getZoomLabel(maximize), + icon: this.self().getZoomIcon(maximize) + }); osparc.utils.Utils.setIdToWidget(actionButton, this.self().getMaximizeWidgetId(maximize)); qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized")); }, @@ -187,16 +200,17 @@ qx.Class.define("osparc.component.widget.PersistentIframe", { height: divSize.height - this.getToolbarHeight() }); - this.__restartButton.setLayoutProperties({ + const rightOffest = this.hasState("maximized") ? 90 : 100; + this.__reloadButton.setLayoutProperties({ top: (divPos.top - iframeParentPos.top), - right: (iframeParentPos.right - iframeParentPos.left - divPos.right) + 35 + right: (iframeParentPos.right - iframeParentPos.left - divPos.right) + rightOffest }); this.__zoomButton.setLayoutProperties({ top: (divPos.top - iframeParentPos.top), right: (iframeParentPos.right - iframeParentPos.left - divPos.right) }); - this.__restartButton.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); + this.__reloadButton.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); this.__zoomButton.setVisibility(this.isShowToolbar() ? "visible" : "excluded"); }, 0); }, diff --git a/services/static-webserver/client/source/class/osparc/dashboard/GridButtonNew.js b/services/static-webserver/client/source/class/osparc/dashboard/GridButtonNew.js index 5df44d3f15b..aafd8cc3ef8 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/GridButtonNew.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/GridButtonNew.js @@ -48,7 +48,9 @@ qx.Class.define("osparc.dashboard.GridButtonNew", { members: { _buildLayout: function() { const title = this.getChildControl("title"); - title.setValue(this.tr("Empty Study")); + title.setValue(this.tr("Empty") + " " + osparc.product.Utils.getStudyAlias({ + firstUpperCase: true + })); const desc = this.getChildControl("subtitle-text"); desc.setValue(this.tr("Start with an empty study").toString()); diff --git a/services/static-webserver/client/source/class/osparc/dashboard/ListButtonNew.js b/services/static-webserver/client/source/class/osparc/dashboard/ListButtonNew.js index 9eb9d223198..2e5dd9d1d6e 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/ListButtonNew.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/ListButtonNew.js @@ -45,7 +45,9 @@ qx.Class.define("osparc.dashboard.ListButtonNew", { members: { _buildLayout: function() { const title = this.getChildControl("title"); - title.setValue(this.tr("Empty Study")); + title.setValue(this.tr("Empty") + " " + osparc.product.Utils.getStudyAlias({ + firstUpperCase: true + })); const desc = this.getChildControl("description"); desc.setValue(this.tr("Start with an empty study").toString()); 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 0373aebdd07..760a9c8c708 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -440,21 +440,21 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { __addNewStudyButtons: function() { switch (osparc.product.Utils.getProductName()) { case "osparc": - this.__addNewStudyButton(); + this.__addEmptyStudyPlusButton(); break; case "tis": - this.__addNewPlanButtons(); + this.__addTIPPlusButtons(); break; case "s4l": - this.__addNewS4LServiceButtons(); + this.__addS4LPlusButtons(); break; case "s4llite": - this.__addNewS4LLiteServiceButtons(); + this.__addS4LLitePlusButtons(); break; } }, - __addNewStudyButton: function() { + __addEmptyStudyPlusButton: function() { const mode = this._resourcesContainer.getMode(); const newStudyBtn = (mode === "grid") ? new osparc.dashboard.GridButtonNew() : new osparc.dashboard.ListButtonNew(); newStudyBtn.setCardKey("new-study"); @@ -468,7 +468,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { this._resourcesContainer.addNonResourceCard(newStudyBtn); }, - __addNewPlanButtons: function() { + __addTIPPlusButtons: function() { const mode = this._resourcesContainer.getMode(); osparc.data.Resources.get("templates") .then(templates => { @@ -511,8 +511,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { } }, - __addNewS4LServiceButtons: function() { - this.__addNewStudyButton(); + __addS4LPlusButtons: function() { const store = osparc.store.Store.getInstance(); store.getAllServices() .then(services => { @@ -524,7 +523,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { }); }, - __addNewS4LLiteServiceButtons: function() { + __addS4LLitePlusButtons: function() { const store = osparc.store.Store.getInstance(); store.getAllServices() .then(services => { 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 d90cdfd9d74..408cabee75d 100644 --- a/services/static-webserver/client/source/class/osparc/info/CommentUI.js +++ b/services/static-webserver/client/source/class/osparc/info/CommentUI.js @@ -25,18 +25,26 @@ qx.Class.define("osparc.info.CommentUI", { construct: function(comment) { this.base(arguments); - const layout = new qx.ui.layout.Grid(8, 5); - layout.setColumnWidth(0, 32); - layout.setColumnFlex(1, 1); + this.__comment = comment; + + const isMyComment = this.__isMyComment(); + const layout = new qx.ui.layout.Grid(12, 5); + layout.setColumnWidth(isMyComment ? 2 : 0, 32); // thumbnail + layout.setColumnFlex(isMyComment ? 0 : 2, 1); // message content + layout.setColumnAlign(isMyComment ? 0 : 2, isMyComment ? "right" : "left", "top"); // message content this._setLayout(layout); this.setPadding(5); - this.__comment = comment; - this.__buildLayout(); }, members: { + __comment: null, + + __isMyComment: function() { + return this.__comment && osparc.auth.Data.getInstance().getUserId() === this.__comment["user_id"]; + }, + _createChildControlImpl: function(id) { let control; switch (id) { @@ -56,7 +64,7 @@ qx.Class.define("osparc.info.CommentUI", { }); this._add(control, { row: 0, - column: 0, + column: this.__isMyComment() ? 2 : 0, rowSpan: 2 }); break; @@ -71,11 +79,11 @@ qx.Class.define("osparc.info.CommentUI", { break; case "last-updated": control = new qx.ui.basic.Label().set({ - font: "text-13" + font: "text-12" }); this._add(control, { - row: 0, - column: 2 + row: 1, + column: 1 }); break; case "comment-content": @@ -85,9 +93,9 @@ qx.Class.define("osparc.info.CommentUI", { wrap: true }); this._add(control, { - row: 1, - column: 1, - colSpan: 2 + row: 0, + column: this.__isMyComment() ? 0 : 2, + rowSpan: 2 }); break; } diff --git a/services/static-webserver/client/source/class/osparc/info/MergedLarge.js b/services/static-webserver/client/source/class/osparc/info/MergedLarge.js index 48b6aeb7a87..739b1944108 100644 --- a/services/static-webserver/client/source/class/osparc/info/MergedLarge.js +++ b/services/static-webserver/client/source/class/osparc/info/MergedLarge.js @@ -63,14 +63,13 @@ qx.Class.define("osparc.info.MergedLarge", { const extraInfo = this.__extraInfo(); const extraInfoLayout = this.__createExtraInfo(extraInfo); - this._add(extraInfoLayout); const bounds = this.getBounds(); const offset = 30; const widgetWidth = bounds ? bounds.width - offset : 500 - offset; let thumbnailWidth = widgetWidth - 2 * osparc.info.CardLarge.PADDING; const maxThumbnailHeight = extraInfo.length*20; - const hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(3).set({ + const hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(5).set({ alignX: "center" })); hBox.add(extraInfoLayout); @@ -218,7 +217,7 @@ qx.Class.define("osparc.info.MergedLarge", { }, __createExtraInfo: function(extraInfo) { - const moreInfo = osparc.info.StudyUtils.createExtraInfoGrid(extraInfo).set({ + const moreInfo = osparc.info.StudyUtils.createExtraInfoVBox(extraInfo).set({ width: osparc.info.CardLarge.EXTRA_INFO_WIDTH }); @@ -286,7 +285,20 @@ qx.Class.define("osparc.info.MergedLarge", { __createDescription: function() { const maxHeight = 400; - return osparc.info.StudyUtils.createDescription(this.getStudy(), maxHeight); + const descriptionLayout = new qx.ui.container.Composite(new qx.ui.layout.VBox(5).set({ + alignY: "middle" + })); + + const label = new qx.ui.basic.Label(qx.locale.Manager.tr("Description")).set({ + font: "text-13" + }); + descriptionLayout.add(label); + + const description = osparc.info.StudyUtils.createDescriptionMD(this.getStudy(), maxHeight); + description.setValue(this.getStudy().getDescription()); + descriptionLayout.add(description); + + return descriptionLayout; }, __createResources: function() { diff --git a/services/static-webserver/client/source/class/osparc/info/ServiceLarge.js b/services/static-webserver/client/source/class/osparc/info/ServiceLarge.js index 977e62a18fc..b94b4414432 100644 --- a/services/static-webserver/client/source/class/osparc/info/ServiceLarge.js +++ b/services/static-webserver/client/source/class/osparc/info/ServiceLarge.js @@ -202,7 +202,7 @@ qx.Class.define("osparc.info.ServiceLarge", { label: this.tr("ACCESS RIGHTS"), view: this.__createAccessRights(), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openAccessRights : "openAccessRights", ctx: this } @@ -216,7 +216,7 @@ qx.Class.define("osparc.info.ServiceLarge", { label: this.tr("CLASSIFIERS"), view: this.__createClassifiers(), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openClassifiers : "openClassifiers", ctx: this } @@ -232,7 +232,7 @@ qx.Class.define("osparc.info.ServiceLarge", { label: this.tr("QUAILITY"), view: this.__createQuality(), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openQuality : "openQuality", ctx: this } @@ -255,7 +255,7 @@ qx.Class.define("osparc.info.ServiceLarge", { }, __createExtraInfo: function(extraInfo) { - const moreInfo = osparc.info.ServiceUtils.createExtraInfo(extraInfo).set({ + const moreInfo = osparc.info.ServiceUtils.createExtraInfoVBox(extraInfo).set({ width: osparc.info.CardLarge.EXTRA_INFO_WIDTH }); return moreInfo; diff --git a/services/static-webserver/client/source/class/osparc/info/ServiceUtils.js b/services/static-webserver/client/source/class/osparc/info/ServiceUtils.js index c92e6e1e93c..1bb897237f2 100644 --- a/services/static-webserver/client/source/class/osparc/info/ServiceUtils.js +++ b/services/static-webserver/client/source/class/osparc/info/ServiceUtils.js @@ -273,7 +273,7 @@ qx.Class.define("osparc.info.ServiceUtils", { }); }, - createExtraInfo: function(extraInfos) { + createExtraInfoVBox: function(extraInfos) { const grid = new qx.ui.layout.Grid(8, 5); grid.setColumnAlign(0, "right", "middle"); grid.setColumnAlign(1, "left", "middle"); diff --git a/services/static-webserver/client/source/class/osparc/info/StudyLarge.js b/services/static-webserver/client/source/class/osparc/info/StudyLarge.js index 26404f7e303..da1526506f2 100644 --- a/services/static-webserver/client/source/class/osparc/info/StudyLarge.js +++ b/services/static-webserver/client/source/class/osparc/info/StudyLarge.js @@ -31,6 +31,10 @@ qx.Class.define("osparc.info.StudyLarge", { } else if (study instanceof Object) { const studyModel = new osparc.data.model.Study(study); this.setStudy(studyModel); + + if ("resourceType" in study) { + this.__isTemplate = study["resourceType"] === "template"; + } } if (openOptions !== undefined) { @@ -54,6 +58,8 @@ qx.Class.define("osparc.info.StudyLarge", { }, members: { + __isTemplate: null, + __canIWrite: function() { return osparc.data.model.Study.canIWrite(this.getStudy().getAccessRights()); }, @@ -67,9 +73,13 @@ qx.Class.define("osparc.info.StudyLarge", { font: "text-14" }); const titleLayout = this.__createViewWithEdit(title, this.__openTitleEditor); + let text = osparc.product.Utils.getStudyAlias({firstUpperCase: true}) + " Id"; + if (this.__isTemplate) { + text = osparc.product.Utils.getTemplateAlias({firstUpperCase: true}) + " Id"; + } const button = new qx.ui.form.Button(null, "@FontAwesome5Solid/copy/12").set({ - label: osparc.product.Utils.getStudyAlias({firstUpperCase: true}) + " Id", - toolTipText: "Copy " + osparc.product.Utils.getStudyAlias({firstUpperCase: true}) + " Id" + label: text, + toolTipText: "Copy " + text }); button.addListener("execute", () => osparc.utils.Utils.copyTextToClipboard(this.getStudy().getUuid())); let autoStartButton = null; @@ -88,14 +98,34 @@ qx.Class.define("osparc.info.StudyLarge", { } vBox.add(titleAndCopyLayout); + const mainHBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(20)); + const leftVBox = new qx.ui.container.Composite(new qx.ui.layout.VBox(5)); + mainHBox.add(leftVBox, { + flex: 1 + }); + const rightVBox = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)); + mainHBox.add(rightVBox); + vBox.add(mainHBox); + if (osparc.product.Utils.showStudyPreview() && !this.getStudy().isPipelineEmpty()) { - const studyThumbnailExplorer = new osparc.dashboard.StudyThumbnailExplorer(this.getStudy().serialize()); - vBox.add(studyThumbnailExplorer); + leftVBox.add(new osparc.dashboard.StudyThumbnailExplorer(this.getStudy().serialize())); + leftVBox.add(new qx.ui.core.Spacer(15, 15)); } + const descInfo = { + label: this.tr("DESCRIPTION"), + view: osparc.info.StudyUtils.createDescriptionMD(this.getStudy()), + action: { + button: osparc.utils.Utils.getEditButton(), + callback: this.__canIWrite() ? this.__openDescriptionEditor : null, + ctx: this + } + }; + leftVBox.add(osparc.info.StudyUtils.titleWithEditLayout(descInfo)); + leftVBox.add(descInfo.view); const extraInfo = this.__extraInfo(); const extraInfoLayout = this.__createExtraInfo(extraInfo); - vBox.add(extraInfoLayout); + rightVBox.add(extraInfoLayout); const scrollContainer = new qx.ui.container.Scroll(); scrollContainer.add(vBox); @@ -131,7 +161,7 @@ qx.Class.define("osparc.info.StudyLarge", { label: this.tr("ACCESS RIGHTS"), view: osparc.info.StudyUtils.createAccessRights(this.getStudy()), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openAccessRights : "openAccessRights", ctx: this } @@ -150,20 +180,22 @@ qx.Class.define("osparc.info.StudyLarge", { label: this.tr("TAGS"), view: osparc.info.StudyUtils.createTags(this.getStudy()), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openTagsEditor : "openTags", ctx: this } }, + /* "DESCRIPTION": { label: this.tr("DESCRIPTION"), - view: osparc.info.StudyUtils.createDescription(this.getStudy()), + view: osparc.info.StudyUtils.createDescriptionMD(this.getStudy()), action: { button: osparc.utils.Utils.getEditButton(), callback: this.__canIWrite() ? this.__openDescriptionEditor : null, ctx: this } }, + */ "THUMBNAIL": { label: this.tr("THUMBNAIL"), view: this.__createThumbnail(), @@ -184,7 +216,7 @@ qx.Class.define("osparc.info.StudyLarge", { label: this.tr("QUALITY"), view: osparc.info.StudyUtils.createQuality(this.getStudy()), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openQuality : "openQuality", ctx: this } @@ -196,7 +228,7 @@ qx.Class.define("osparc.info.StudyLarge", { label: this.tr("CLASSIFIERS"), view: osparc.info.StudyUtils.createClassifiers(this.getStudy()), action: (this.getStudy().getClassifiers().length || this.__canIWrite()) ? { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.isOpenOptions() ? this.__openClassifiers : "openClassifiers", ctx: this } : null diff --git a/services/static-webserver/client/source/class/osparc/info/StudyMedium.js b/services/static-webserver/client/source/class/osparc/info/StudyMedium.js index 839bebd313b..f1bd237f324 100644 --- a/services/static-webserver/client/source/class/osparc/info/StudyMedium.js +++ b/services/static-webserver/client/source/class/osparc/info/StudyMedium.js @@ -124,7 +124,7 @@ qx.Class.define("osparc.info.StudyMedium", { label: this.tr("QUALITY"), view: osparc.info.StudyUtils.createQuality(this.getStudy()), action: { - button: osparc.utils.Utils.getViewButton(), + button: osparc.utils.Utils.getEditButton(), callback: this.__openQuality, ctx: this } @@ -138,7 +138,7 @@ qx.Class.define("osparc.info.StudyMedium", { extraInfo.push({ label: this.tr("DESCRIPTION"), - view: osparc.info.StudyUtils.createDescription(this.getStudy()) + view: osparc.info.StudyUtils.createDescriptionMD(this.getStudy()) }); return extraInfo; diff --git a/services/static-webserver/client/source/class/osparc/info/StudyUtils.js b/services/static-webserver/client/source/class/osparc/info/StudyUtils.js index 92ae28d6781..5ecbaf2e628 100644 --- a/services/static-webserver/client/source/class/osparc/info/StudyUtils.js +++ b/services/static-webserver/client/source/class/osparc/info/StudyUtils.js @@ -165,7 +165,7 @@ qx.Class.define("osparc.info.StudyUtils", { * @param study {osparc.data.model.Study} Study Model * @param maxHeight {Number} description's maxHeight */ - createDescription: function(study, maxHeight) { + createDescriptionMD: function(study, maxHeight) { const description = new osparc.ui.markdown.Markdown().set({ noMargin: true }); @@ -247,46 +247,57 @@ qx.Class.define("osparc.info.StudyUtils", { return moreInfo; }, + titleWithEditLayout: function(data) { + const titleLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)); + const title = new qx.ui.basic.Label(data.label); + titleLayout.add(title); + if (data.action) { + titleLayout.add(data.action.button); + data.action.button.addListener("execute", () => { + const cb = data.action.callback; + if (typeof cb === "string") { + data.action.ctx.fireEvent(cb); + } else { + cb.call(data.action.ctx); + } + }, this); + } + return titleLayout; + }, + createExtraInfoGrid: function(extraInfos) { const positions = { - ACCESS_RIGHTS: { + THUMBNAIL: { column: 0, - row: 0 - }, - AUTHOR: { - column: 1, - row: 0 + row: 0*3 }, CREATED: { - column: 2, - row: 0 + column: 0, + row: 1*3 }, MODIFIED: { - column: 3, - row: 0 + column: 0, + row: 2*3 }, - THUMBNAIL: { - column: 4, - row: 0, - rowSpan: 4 + ACCESS_RIGHTS: { + column: 0, + row: 3*3 + }, + AUTHOR: { + column: 0, + row: 4*3 }, TAGS: { column: 0, - row: 3, - colSpan: 2 + row: 5*3 }, QUALITY: { - column: 2, - row: 3 + column: 0, + row: 6*3 }, CLASSIFIERS: { - column: 3, - row: 3 - }, - DESCRIPTION: { column: 0, - row: 6, - colSpan: 5 + row: 7*3 } }; @@ -295,8 +306,13 @@ qx.Class.define("osparc.info.StudyUtils", { grid.setColumnAlign(1, "left", "middle"); grid.setColumnAlign(2, "left", "middle"); grid.setColumnAlign(3, "left", "middle"); - grid.setRowHeight(2, 10); // spacer - grid.setRowHeight(5, 10); // spacer + grid.setRowHeight(1*3-1, 10); // spacer + grid.setRowHeight(2*3-1, 10); // spacer + grid.setRowHeight(3*3-1, 10); // spacer + grid.setRowHeight(4*3-1, 10); // spacer + grid.setRowHeight(5*3-1, 10); // spacer + grid.setRowHeight(6*3-1, 10); // spacer + grid.setRowHeight(7*3-1, 10); // spacer const moreInfo = new qx.ui.container.Composite(grid); Object.keys(positions).forEach(key => { @@ -304,20 +320,7 @@ qx.Class.define("osparc.info.StudyUtils", { const extraInfo = extraInfos[key]; const gridInfo = positions[key]; - const titleLayout = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)); - const title = new qx.ui.basic.Label(extraInfo.label); - titleLayout.add(title); - if (extraInfo.action) { - titleLayout.add(extraInfo.action.button); - extraInfo.action.button.addListener("execute", () => { - const cb = extraInfo.action.callback; - if (typeof cb === "string") { - extraInfo.action.ctx.fireEvent(cb); - } else { - cb.call(extraInfo.action.ctx); - } - }, this); - } + const titleLayout = this.titleWithEditLayout(extraInfo); moreInfo.add(titleLayout, { row: gridInfo.row, column: gridInfo.column, 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 4d8c3c90056..ec4e5ea3353 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 @@ -212,16 +212,16 @@ qx.Class.define("osparc.ui.message.Loading", { __createMaximizeButton: function(showMaximizeButton) { const maximize = false; - const maxButton = this.__maxButton = new qx.ui.form.Button(null).set({ + const maxButton = this.__maxButton = osparc.component.widget.PersistentIframe.createToolbarButton(maximize).set({ + label: osparc.component.widget.PersistentIframe.getZoomLabel(maximize), icon: osparc.component.widget.PersistentIframe.getZoomIcon(maximize), - visibility: showMaximizeButton ? "visible" : "excluded", - decorator: null + visibility: showMaximizeButton ? "visible" : "excluded" }); osparc.utils.Utils.setIdToWidget(maxButton, osparc.component.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: 40 + maxWidth: 100 }); maximizeLayout.add(maxButton); maximizeLayout.add(new qx.ui.core.Widget(), { @@ -283,7 +283,10 @@ qx.Class.define("osparc.ui.message.Loading", { this.removeState("maximized"); } const maxButton = this.__maxButton; - maxButton.setIcon(osparc.component.widget.PersistentIframe.getZoomIcon(maximize)); + maxButton.set({ + label: osparc.component.widget.PersistentIframe.getZoomLabel(maximize), + icon: osparc.component.widget.PersistentIframe.getZoomIcon(maximize) + }); osparc.utils.Utils.setIdToWidget(maxButton, osparc.component.widget.PersistentIframe.getMaximizeWidgetId(maximize)); qx.event.message.Bus.getInstance().dispatchByName("maximizeIframe", this.hasState("maximized")); } diff --git a/tests/e2e/portal/2D_Plot.js b/tests/e2e/portal/2D_Plot.js index 2342c28f356..e37a288b902 100644 --- a/tests/e2e/portal/2D_Plot.js +++ b/tests/e2e/portal/2D_Plot.js @@ -1,4 +1,4 @@ -// node 2D_Plot.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node 2D_Plot.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/3D_Anatomical.js b/tests/e2e/portal/3D_Anatomical.js index cd3d0bf328e..73e0082923b 100644 --- a/tests/e2e/portal/3D_Anatomical.js +++ b/tests/e2e/portal/3D_Anatomical.js @@ -1,4 +1,4 @@ -// node 3D_Anatomical.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node 3D_Anatomical.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/3D_EM.js b/tests/e2e/portal/3D_EM.js index be8f42cc6c8..82d911a449b 100644 --- a/tests/e2e/portal/3D_EM.js +++ b/tests/e2e/portal/3D_EM.js @@ -1,4 +1,4 @@ -// node 3D_EM.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node 3D_EM.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/BIOS_VNS_Calibrator.js b/tests/e2e/portal/BIOS_VNS_Calibrator.js index 632817fa9ff..8b42af543a2 100644 --- a/tests/e2e/portal/BIOS_VNS_Calibrator.js +++ b/tests/e2e/portal/BIOS_VNS_Calibrator.js @@ -1,4 +1,4 @@ -// node BIOS_VNS_Calibrator.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node BIOS_VNS_Calibrator.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/Bornstein.js b/tests/e2e/portal/Bornstein.js index e11296b12a6..61bab856553 100644 --- a/tests/e2e/portal/Bornstein.js +++ b/tests/e2e/portal/Bornstein.js @@ -1,4 +1,4 @@ -// node Bornstein.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node Bornstein.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/CC_Human.js b/tests/e2e/portal/CC_Human.js index 0a9e0a6c3b9..2c7fee21416 100644 --- a/tests/e2e/portal/CC_Human.js +++ b/tests/e2e/portal/CC_Human.js @@ -1,4 +1,4 @@ -// node CC_Human.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node CC_Human.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/CC_Rabbit.js b/tests/e2e/portal/CC_Rabbit.js index 66d1bf273ab..cdc080141c0 100644 --- a/tests/e2e/portal/CC_Rabbit.js +++ b/tests/e2e/portal/CC_Rabbit.js @@ -1,4 +1,4 @@ -// node CC_Rabbit.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node CC_Rabbit.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/Kember.js b/tests/e2e/portal/Kember.js index d97030cc597..1c02ed8492e 100644 --- a/tests/e2e/portal/Kember.js +++ b/tests/e2e/portal/Kember.js @@ -1,4 +1,4 @@ -// node kember.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node kember.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/Mattward.js b/tests/e2e/portal/Mattward.js index 0f2f5a8f6da..f818d2c7fae 100644 --- a/tests/e2e/portal/Mattward.js +++ b/tests/e2e/portal/Mattward.js @@ -1,4 +1,4 @@ -// node Mattward.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node Mattward.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/portal/opencor.js b/tests/e2e/portal/opencor.js index 6e3694752b2..b4ef8f19c12 100644 --- a/tests/e2e/portal/opencor.js +++ b/tests/e2e/portal/opencor.js @@ -1,4 +1,4 @@ -// node opencor.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node opencor.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/publications/SarValidation.js b/tests/e2e/publications/SarValidation.js index 29e6dac8b94..b590a69a24a 100644 --- a/tests/e2e/publications/SarValidation.js +++ b/tests/e2e/publications/SarValidation.js @@ -1,4 +1,4 @@ -// node SarValidation.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node SarValidation.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] // master https://osparc-master.speag.com/study/2b7b88be-ea51-11ed-ade4-02420a000d13 // prod https://osparc.io/study/ff72c36a-df81-11ed-9c9e-02420a0b755a diff --git a/tests/e2e/publications/Voila.js b/tests/e2e/publications/Voila.js index 84f42b4953e..9644c6f74a1 100644 --- a/tests/e2e/publications/Voila.js +++ b/tests/e2e/publications/Voila.js @@ -1,4 +1,4 @@ -// node Voila.js [url_prefix] [template_uuid] [start_timeout] [--demo] +// node Voila.js [url_prefix] [template_uuid] [--start_timeout timeout] [--demo] const tutorialBase = require('../tutorials/tutorialBase'); const utils = require('../utils/utils'); diff --git a/tests/e2e/s4l/sim4life-dipole.js b/tests/e2e/s4l/sim4life-dipole.js index 0eb19d33c0b..ff9d17bb66c 100644 --- a/tests/e2e/s4l/sim4life-dipole.js +++ b/tests/e2e/s4l/sim4life-dipole.js @@ -1,4 +1,4 @@ -// node sim4life-dipole.js [url] [user] [password] [timeout] [--demo] +// node sim4life-dipole.js [url] [--user user] [--pass password] [--start_timeout timeout] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('../tutorials/tutorialBase'); diff --git a/tests/e2e/s4l/sim4life-lite.js b/tests/e2e/s4l/sim4life-lite.js index c43ba74120b..1746ef2356c 100644 --- a/tests/e2e/s4l/sim4life-lite.js +++ b/tests/e2e/s4l/sim4life-lite.js @@ -1,4 +1,4 @@ -// node sim4life-lite.js [url] [user] [password] [timeout] [--demo] +// node sim4life-lite.js [url] [--user user] [--pass password] [--start_timeout timeout] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('../tutorials/tutorialBase'); diff --git a/tests/e2e/s4l/sim4life.js b/tests/e2e/s4l/sim4life.js index bbc2ec76317..d347f620927 100644 --- a/tests/e2e/s4l/sim4life.js +++ b/tests/e2e/s4l/sim4life.js @@ -1,4 +1,4 @@ -// node sim4life.js [url] [user] [password] [timeout] [--demo] +// node sim4life.js [url] [--user user] [--pass password] [--start_timeout timeout] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('../tutorials/tutorialBase'); diff --git a/tests/e2e/tutorials/isolve-gpu.js b/tests/e2e/tutorials/isolve-gpu.js index 1a31311c531..4d6ee1f549f 100644 --- a/tests/e2e/tutorials/isolve-gpu.js +++ b/tests/e2e/tutorials/isolve-gpu.js @@ -1,4 +1,4 @@ -// node isolve-gpu.js [url] [user] [password] [--demo] +// node isolve-gpu.js [url] [--user user] [--pass password] [--demo] // https://itisfoundation.github.io/osparc-manual-z43/#/Tutorials/GeneralTutorial diff --git a/tests/e2e/tutorials/isolve-mpi.js b/tests/e2e/tutorials/isolve-mpi.js index 71ac7c49bad..8334a857832 100644 --- a/tests/e2e/tutorials/isolve-mpi.js +++ b/tests/e2e/tutorials/isolve-mpi.js @@ -1,4 +1,4 @@ -// node isolve-mpi.js [url] [user] [password] [--demo] +// node isolve-mpi.js [url] [--user user] [--pass password] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('./tutorialBase'); diff --git a/tests/e2e/tutorials/jupyterlabs.js b/tests/e2e/tutorials/jupyterlabs.js index 8b9573bc01f..6d8ee355b9c 100644 --- a/tests/e2e/tutorials/jupyterlabs.js +++ b/tests/e2e/tutorials/jupyterlabs.js @@ -1,4 +1,4 @@ -// node jupyters.js [url] [user] [password] [--demo] +// node jupyters.js [url] [--user user] [--pass password] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('./tutorialBase'); diff --git a/tests/e2e/tutorials/sleepers.js b/tests/e2e/tutorials/sleepers.js index ee92d5f704e..d161abfe6a1 100644 --- a/tests/e2e/tutorials/sleepers.js +++ b/tests/e2e/tutorials/sleepers.js @@ -1,4 +1,4 @@ -// node sleepers.js [url] [user] [password] [--demo] +// node sleepers.js [url] [--user user] [--pass password] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('./tutorialBase'); diff --git a/tests/e2e/tutorials/ti-plan.js b/tests/e2e/tutorials/ti-plan.js index 4102a2e62e4..846656cc1f0 100644 --- a/tests/e2e/tutorials/ti-plan.js +++ b/tests/e2e/tutorials/ti-plan.js @@ -1,4 +1,4 @@ -// node ti-plan.js [url] [user] [password] [timeout] [--demo] +// node ti-plan.js [url] [--user user] [--pass password] [--start_timeout timeout] [--demo] const utils = require('../utils/utils'); const tutorialBase = require('./tutorialBase'); diff --git a/tests/e2e/utils/auto.js b/tests/e2e/utils/auto.js index c0027672cc0..3f70ff55d66 100644 --- a/tests/e2e/utils/auto.js +++ b/tests/e2e/utils/auto.js @@ -192,7 +192,7 @@ async function dashboardOpenService(page, serviceName) { } const firstChildId = '[osparc-test-id="' + children[idx] + '"]'; await utils.waitAndClick(page, firstChildId); - await __openResource(); + await __openResource(page); return true; } console.log("Creating New Study from service: no service found"); diff --git a/tests/e2e/utils/utils.js b/tests/e2e/utils/utils.js index a2b4d8db671..80cc10e88f3 100644 --- a/tests/e2e/utils/utils.js +++ b/tests/e2e/utils/utils.js @@ -142,7 +142,7 @@ function parseCommandLineArgumentsStudyDispatcherParams(args) { // [url] [download_link] [file_size] [--demo] if (args.length < 4) { - console.log('More arguments expected: [url] [download_link] [file_size] [start_timeout] [--demo]'); + console.log('More arguments expected: [url] [download_link] [file_size] [--start_timeout timeout] [--demo]'); process.exit(1); }