diff --git a/services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js b/services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js index 04be2898461..ad0a78c20c1 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/GridButtonBase.js @@ -77,33 +77,26 @@ qx.Class.define("osparc.dashboard.GridButtonBase", { MODIFIED: { row: 0, column: 0, - rowSpan: 1, - colSpan: 2 }, UI_MODE: { row: 0, - column: 3, - colSpan: 1 + column: 1, }, UPDATES: { row: 0, - column: 4, - colSpan: 1 + column: 2, }, TSR: { row: 1, column: 0, - colSpan: 2 }, HITS: { row: 1, - column: 2, - colSpan: 1 + column: 1, }, PERMISSION: { row: 1, - column: 4, - colSpan: 1 + column: 2, } } }, @@ -173,7 +166,6 @@ qx.Class.define("osparc.dashboard.GridButtonBase", { case "footer": { const fgrid = new qx.ui.layout.Grid(); fgrid.setSpacing(2); - fgrid.setRowFlex(2, 1); fgrid.setColumnFlex(0, 1); control = new qx.ui.container.Composite().set({ backgroundColor: "background-card-overlay", 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 70a3554ae41..804986735a7 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js @@ -924,8 +924,9 @@ qx.Class.define("osparc.dashboard.StudyBrowser", { if (filterData.text) { this.__changeContext("search"); } else { - // Back to My Workspace - this.__changeContext("studiesAndFolders", null, null); + const workspaceId = this.getCurrentWorkspaceId(); + const folderId = this.getCurrentFolderId(); + this.__changeContext("studiesAndFolders", workspaceId, folderId); } }); } diff --git a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowserHeader.js b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowserHeader.js index 54235a08c45..36cb6375e26 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowserHeader.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/StudyBrowserHeader.js @@ -185,9 +185,21 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", { return control || this.base(arguments, id); }, + __titleTapped: function() { + const workspaceId = this.getCurrentWorkspaceId(); + const folderId = null; + this.setCurrentFolderId(folderId); + this.fireDataEvent("locationChanged", { + workspaceId, + folderId, + }); + }, + __buildLayout: function() { this.getChildControl("icon"); const title = this.getChildControl("workspace-title"); + title.resetCursor(); + title.removeListener("tap", this.__titleTapped, this); this.getChildControl("breadcrumbs"); this.getChildControl("edit-button").exclude(); this.resetAccessRights(); @@ -198,27 +210,16 @@ qx.Class.define("osparc.dashboard.StudyBrowserHeader", { this.__setIcon("@FontAwesome5Solid/search/24"); title.set({ value: this.tr("Search results"), - cursor: "auto", }); } else if (currentContext === "workspaces") { this.__setIcon(osparc.store.Workspaces.iconPath(32)); title.set({ value: this.tr("Shared Workspaces"), - cursor: "auto", }) } else if (currentContext === "studiesAndFolders") { const workspaceId = this.getCurrentWorkspaceId(); - title.set({ - cursor: "pointer" - }); - title.addListener("tap", () => { - const folderId = null; - this.setCurrentFolderId(folderId); - this.fireDataEvent("locationChanged", { - workspaceId, - folderId, - }); - }); + title.setCursor("pointer"); + title.addListener("tap", this.__titleTapped, this); const workspace = osparc.store.Workspaces.getInstance().getWorkspace(workspaceId); if (workspace) { const thumbnail = workspace.getThumbnail(); 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 912f838486f..598e0575d22 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 @@ -82,14 +82,14 @@ qx.Class.define("osparc.data.model.Study", { workspaceId: { check: "Number", - init: true, + init: null, nullable: true, event: "changeWorkspaceId" }, folderId: { check: "Number", - init: true, + init: null, nullable: true, event: "changeFolderId" }, @@ -103,9 +103,9 @@ qx.Class.define("osparc.data.model.Study", { description: { check: "String", - nullable: false, + nullable: true, event: "changeDescription", - init: "" + init: null }, prjOwner: { @@ -356,11 +356,7 @@ qx.Class.define("osparc.data.model.Study", { jsonObject[key] = this.getUi().serialize(); return; } - const value = this.get(key); - if (value !== null) { - // only put the value in the payload if there is a value - jsonObject[key] = value; - } + jsonObject[key] = this.get(key); }); return jsonObject; }, diff --git a/services/static-webserver/client/source/class/osparc/service/PricingUnitsList.js b/services/static-webserver/client/source/class/osparc/service/PricingUnitsList.js index fac14e0449d..f7dcc85a457 100644 --- a/services/static-webserver/client/source/class/osparc/service/PricingUnitsList.js +++ b/services/static-webserver/client/source/class/osparc/service/PricingUnitsList.js @@ -64,30 +64,16 @@ qx.Class.define("osparc.service.PricingUnitsList", { __populateList: function(pricingUnits) { this.getChildControl("pricing-units-container").removeAll(); - if (pricingUnits.length === 0) { + if (pricingUnits.length) { + const pUnits = new osparc.study.PricingUnits(pricingUnits, null, false); + this.getChildControl("pricing-units-container").add(pUnits); + } else { const notFound = new qx.ui.basic.Label().set({ value: this.tr("No Tiers found"), font: "text-14" }); this.getChildControl("pricing-units-container").add(notFound); - return; } - - pricingUnits.forEach(pricingUnit => { - const pUnit = new osparc.study.PricingUnit(pricingUnit).set({ - allowGrowY: false - }); - this.getChildControl("pricing-units-container").add(pUnit); - }); - - const buttons = this.getChildControl("pricing-units-container").getChildren(); - const keepDefaultSelected = () => { - buttons.forEach(btn => { - btn.setValue(btn.getUnitData().isDefault()); - }); - }; - keepDefaultSelected(); - buttons.forEach(btn => btn.addListener("execute", () => keepDefaultSelected())); } } }); diff --git a/services/static-webserver/client/source/class/osparc/study/PricingUnits.js b/services/static-webserver/client/source/class/osparc/study/PricingUnits.js index 2f3fe92d2ac..5238825a838 100644 --- a/services/static-webserver/client/source/class/osparc/study/PricingUnits.js +++ b/services/static-webserver/client/source/class/osparc/study/PricingUnits.js @@ -18,14 +18,15 @@ qx.Class.define("osparc.study.PricingUnits", { extend: qx.ui.container.Composite, - construct: function(pricingUnits, preselectedPricingUnit) { + construct: function(pricingUnits, preselectedPricingUnit, changeSelectionAllowed = true) { this.base(arguments); this.set({ - layout: new qx.ui.layout.HBox(5) + layout: new qx.ui.layout.HBox(5), + allowGrowY: false, }); - this.__buildLayout(pricingUnits, preselectedPricingUnit); + this.__buildLayout(pricingUnits, preselectedPricingUnit, changeSelectionAllowed); }, properties: { @@ -38,7 +39,7 @@ qx.Class.define("osparc.study.PricingUnits", { }, members: { - __buildLayout: function(pricingUnits, preselectedPricingUnit) { + __buildLayout: function(pricingUnits, preselectedPricingUnit, changeSelectionAllowed) { const buttons = []; pricingUnits.forEach(pricingUnit => { const button = new osparc.study.PricingUnit(pricingUnit); @@ -47,7 +48,12 @@ qx.Class.define("osparc.study.PricingUnits", { }); const groupOptions = new qx.ui.form.RadioGroup(); - buttons.forEach(btn => groupOptions.add(btn)); + buttons.forEach(btn => { + groupOptions.add(btn); + btn.bind("value", btn, "backgroundColor", { + converter: selected => selected ? "background-main-1" : "transparent" + }); + }); if (preselectedPricingUnit) { const buttonFound = buttons.find(button => button.getUnitData().getPricingUnitId() === preselectedPricingUnit["pricingUnitId"]); @@ -63,12 +69,19 @@ qx.Class.define("osparc.study.PricingUnits", { }); } - buttons.forEach(button => button.addListener("changeValue", e => { - if (e.getData()) { - const selectedUnitId = button.getUnitData().getPricingUnitId(); - this.setSelectedUnitId(selectedUnitId); + buttons.forEach(button => { + if (!changeSelectionAllowed) { + button.setCursor("default"); } - })); + button.addListener("execute", () => { + if (changeSelectionAllowed) { + const selectedUnitId = button.getUnitData().getPricingUnitId(); + this.setSelectedUnitId(selectedUnitId); + } else { + buttons.forEach(btn => btn.setValue(btn.getUnitData().isDefault())); + } + }); + }); } } }); diff --git a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js index 071db993e30..c8da28a0c48 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -164,10 +164,34 @@ qx.Class.define("osparc.widget.NodeOutputs", { for (let i=0; i { if ("resp" in presignedLinkData && presignedLinkData.resp) { diff --git a/services/static-webserver/client/source/class/osparc/workbench/DiskUsageController.js b/services/static-webserver/client/source/class/osparc/workbench/DiskUsageController.js index 5510906f2bb..c0a3a8e835d 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/DiskUsageController.js +++ b/services/static-webserver/client/source/class/osparc/workbench/DiskUsageController.js @@ -119,10 +119,10 @@ qx.Class.define("osparc.workbench.DiskUsageController", { let freeSpace = osparc.utils.Utils.bytesToSize(diskHostUsage.free); let warningLevel = this.__getWarningLevel(diskHostUsage.free); - if ("STATE_VOLUMES" in data.usage) { - const diskVolsUsage = data.usage["STATE_VOLUMES"]; + if ("STATES_VOLUMES" in data.usage) { + const diskVolsUsage = data.usage["STATES_VOLUMES"]; if (diskVolsUsage["used_percent"] > diskHostUsage["used_percent"]) { - // "STATE_VOLUMES" is more critical so it takes over + // "STATES_VOLUMES" is more critical so it takes over freeSpace = osparc.utils.Utils.bytesToSize(diskVolsUsage.free); warningLevel = this.__getWarningLevel(diskVolsUsage.free); } diff --git a/services/static-webserver/client/source/class/osparc/workbench/DiskUsageIndicator.js b/services/static-webserver/client/source/class/osparc/workbench/DiskUsageIndicator.js index 496b94079cb..173b3689524 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/DiskUsageIndicator.js +++ b/services/static-webserver/client/source/class/osparc/workbench/DiskUsageIndicator.js @@ -160,10 +160,10 @@ qx.Class.define("osparc.workbench.DiskUsageIndicator", { let progress = `${diskHostUsage["used_percent"]}%`; let labelDiskSize = osparc.utils.Utils.bytesToSize(diskHostUsage.free); let toolTipText = this.tr("Disk usage"); - if ("STATE_VOLUMES" in diskUsage["usage"]) { - const diskVolsUsage = diskUsage["usage"]["STATE_VOLUMES"]; + if ("STATES_VOLUMES" in diskUsage["usage"]) { + const diskVolsUsage = diskUsage["usage"]["STATES_VOLUMES"]; if (diskVolsUsage["used_percent"] > diskHostUsage["used_percent"]) { - // "STATE_VOLUMES" is more critical so it takes over + // "STATES_VOLUMES" is more critical so it takes over color1 = this.__getIndicatorColor(diskVolsUsage.free); progress = `${diskVolsUsage["used_percent"]}%`; labelDiskSize = osparc.utils.Utils.bytesToSize(diskVolsUsage.free);