From b3d318b1f7a87e16f62db51fadaf6ef529268ce2 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 13:58:18 +0100 Subject: [PATCH 01/13] null values are fine --- .../client/source/class/osparc/data/model/Study.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 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 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; }, From 218bc645d837df0107b83d88b25a359905d5a670 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 14:31:46 +0100 Subject: [PATCH 02/13] fix tap on header title --- .../osparc/dashboard/StudyBrowserHeader.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) 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(); From 425e0443be34949def211a68137d0c0dffb6933d Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 17:07:50 +0100 Subject: [PATCH 03/13] eTags --- .../class/osparc/desktop/StudyEditor.js | 3 ++ .../source/class/osparc/widget/NodeOutputs.js | 31 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) 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 774eb0d508e..a2b05ee449e 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -840,6 +840,9 @@ qx.Class.define("osparc.desktop.StudyEditor", { __getStudyDiffs: function() { const newObj = this.getStudy().serialize(); const delta = osparc.wrapper.JsonDiffPatch.getInstance().diff(this.__studyDataInBackend, newObj); + console.log("asd newObj", newObj); + console.log("asd studyDataInBackend", this.__studyDataInBackend); + console.log("asd delta", delta); if (delta) { // lastChangeDate and creationDate should not be taken into account as data change delete delta["creationDate"]; 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..7337d329907 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -49,7 +49,14 @@ qx.Class.define("osparc.widget.NodeOutputs", { ports: node.getMetaData().outputs }); - node.addListener("changeOutputs", () => this.__outputsChanged(), this); + node.addListener("changeOutputs", e => { + const currentOutputs = e.getData(); + const oldOutputs = e.getOldData(); + if (JSON.stringify(currentOutputs) !== JSON.stringify(oldOutputs)) { + console.log("changeOutputs"); + this.__outputsChanged(); + } + }, this); this.addListener("appear", () => this.__makeLabelsResponsive(), this); this.addListener("resize", () => this.__makeLabelsResponsive(), this); @@ -164,10 +171,31 @@ qx.Class.define("osparc.widget.NodeOutputs", { for (let i=0; i { if ("resp" in presignedLinkData && presignedLinkData.resp) { From 8fa0ecbc900fc589be8c17faca4baef2c015fe31 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 17:30:04 +0100 Subject: [PATCH 04/13] rename --- .../source/class/osparc/workbench/DiskUsageController.js | 6 +++--- .../source/class/osparc/workbench/DiskUsageIndicator.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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); From deea77768353fe13f3c0e4069e2daee0f36e1995 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 17:44:06 +0100 Subject: [PATCH 05/13] check if the eTag changed before requesting the presigned link again --- .../client/source/class/osparc/widget/NodeOutputs.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 7337d329907..817e2db6569 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -171,11 +171,14 @@ qx.Class.define("osparc.widget.NodeOutputs", { for (let i=0; i Date: Wed, 30 Oct 2024 17:46:42 +0100 Subject: [PATCH 06/13] cleanup --- .../client/source/class/osparc/desktop/StudyEditor.js | 3 --- .../client/source/class/osparc/widget/NodeOutputs.js | 11 ++--------- 2 files changed, 2 insertions(+), 12 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 a2b05ee449e..774eb0d508e 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js +++ b/services/static-webserver/client/source/class/osparc/desktop/StudyEditor.js @@ -840,9 +840,6 @@ qx.Class.define("osparc.desktop.StudyEditor", { __getStudyDiffs: function() { const newObj = this.getStudy().serialize(); const delta = osparc.wrapper.JsonDiffPatch.getInstance().diff(this.__studyDataInBackend, newObj); - console.log("asd newObj", newObj); - console.log("asd studyDataInBackend", this.__studyDataInBackend); - console.log("asd delta", delta); if (delta) { // lastChangeDate and creationDate should not be taken into account as data change delete delta["creationDate"]; 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 817e2db6569..a60551bd914 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -49,14 +49,7 @@ qx.Class.define("osparc.widget.NodeOutputs", { ports: node.getMetaData().outputs }); - node.addListener("changeOutputs", e => { - const currentOutputs = e.getData(); - const oldOutputs = e.getOldData(); - if (JSON.stringify(currentOutputs) !== JSON.stringify(oldOutputs)) { - console.log("changeOutputs"); - this.__outputsChanged(); - } - }, this); + node.addListener("changeOutputs", () => this.__outputsChanged(), this); this.addListener("appear", () => this.__makeLabelsResponsive(), this); this.addListener("resize", () => this.__makeLabelsResponsive(), this); @@ -176,7 +169,7 @@ qx.Class.define("osparc.widget.NodeOutputs", { // check if the eTag changed before requesting the presigned link again const eTag = value["eTag"]; const valueField = this.__getValueField(i); - if (eTag && valueField.eTag && eTag === valueField.eTag) { + if (valueField && eTag && valueField.eTag && eTag === valueField.eTag) { continue; } } From 83ef9fe484f406c0f17b31ce5678a817911b87d1 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 17:47:53 +0100 Subject: [PATCH 07/13] minor --- .../client/source/class/osparc/widget/NodeOutputs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a60551bd914..a9ffd76bee7 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -169,7 +169,7 @@ qx.Class.define("osparc.widget.NodeOutputs", { // check if the eTag changed before requesting the presigned link again const eTag = value["eTag"]; const valueField = this.__getValueField(i); - if (valueField && eTag && valueField.eTag && eTag === valueField.eTag) { + if (eTag && valueField && valueField.eTag && eTag === valueField.eTag) { continue; } } From 94233c0657b24fb099124c3233a6f554deda4adc Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 18:11:46 +0100 Subject: [PATCH 08/13] fix open location --- .../class/osparc/dashboard/SearchBarFilter.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js index b836a93ef44..36976a3cf5b 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js @@ -161,6 +161,20 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { } }, + __textFiledValueChanged: function() { + this.__filter(); + }, + + __listenToTextFiledChanges: function() { + const textField = this.getChildControl("text-field"); + textField.addListener("changeValue", this.__textFiledValueChanged, this); + }, + + __unlistenToTextFiledChanges: function() { + const textField = this.getChildControl("text-field"); + textField.removeListener("changeValue", this.__textFiledValueChanged, this); + }, + __attachEventHandlers: function() { const textField = this.getChildControl("text-field"); textField.addListener("tap", () => this.__showFilterMenu(), this); @@ -172,7 +186,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { this.__hideFilterMenu(); } }, this); - textField.addListener("changeValue", () => this.__filter(), this); + this.__listenToTextFiledChanges(); const resetButton = this.getChildControl("reset-button"); resetButton.addListener("execute", () => this.__resetFilters(), this); @@ -349,9 +363,16 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { } }, - resetFilters: function() { + resetFilters: function(silent = true) { this.__removeChips(); + + if (silent) { + this.__unlistenToTextFiledChanges(); + } this.getChildControl("text-field").resetValue(); + if (silent) { + this.__listenToTextFiledChanges(); + } }, __resetFilters: function() { From d8bf268e3d05a5f9a34b00a6a558561dd03c9ce3 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 18:26:56 +0100 Subject: [PATCH 09/13] minor --- .../client/source/class/osparc/widget/NodeOutputs.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 a9ffd76bee7..c8da28a0c48 100644 --- a/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js +++ b/services/static-webserver/client/source/class/osparc/widget/NodeOutputs.js @@ -168,8 +168,8 @@ qx.Class.define("osparc.widget.NodeOutputs", { // it's a file in storage. // check if the eTag changed before requesting the presigned link again const eTag = value["eTag"]; - const valueField = this.__getValueField(i); - if (eTag && valueField && valueField.eTag && eTag === valueField.eTag) { + const valueWidget = this.__getValueWidget(i); + if (eTag && valueWidget && valueWidget.eTag && eTag === valueWidget.eTag) { continue; } } @@ -177,10 +177,10 @@ qx.Class.define("osparc.widget.NodeOutputs", { } }, - __getValueField: function(row) { - let children = this.__gridLayout.getChildren(); + __getValueWidget: function(row) { + const children = this.__gridLayout.getChildren(); for (let i=0; i Date: Wed, 30 Oct 2024 18:32:20 +0100 Subject: [PATCH 10/13] undo --- .../class/osparc/dashboard/SearchBarFilter.js | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js index 36976a3cf5b..f42a86d57fd 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js @@ -161,20 +161,6 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { } }, - __textFiledValueChanged: function() { - this.__filter(); - }, - - __listenToTextFiledChanges: function() { - const textField = this.getChildControl("text-field"); - textField.addListener("changeValue", this.__textFiledValueChanged, this); - }, - - __unlistenToTextFiledChanges: function() { - const textField = this.getChildControl("text-field"); - textField.removeListener("changeValue", this.__textFiledValueChanged, this); - }, - __attachEventHandlers: function() { const textField = this.getChildControl("text-field"); textField.addListener("tap", () => this.__showFilterMenu(), this); @@ -186,7 +172,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { this.__hideFilterMenu(); } }, this); - this.__listenToTextFiledChanges(); + textField.addListener("changeValue", () => this.__filter(), this); const resetButton = this.getChildControl("reset-button"); resetButton.addListener("execute", () => this.__resetFilters(), this); @@ -363,16 +349,9 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { } }, - resetFilters: function(silent = true) { + resetFilters: function(silent = false) { this.__removeChips(); - - if (silent) { - this.__unlistenToTextFiledChanges(); - } this.getChildControl("text-field").resetValue(); - if (silent) { - this.__listenToTextFiledChanges(); - } }, __resetFilters: function() { From e6eb2c701f03d5f6c6e15148e4a7158f4ff1779a Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 18:32:53 +0100 Subject: [PATCH 11/13] not needed --- .../client/source/class/osparc/dashboard/SearchBarFilter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js index f42a86d57fd..b836a93ef44 100644 --- a/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js +++ b/services/static-webserver/client/source/class/osparc/dashboard/SearchBarFilter.js @@ -349,7 +349,7 @@ qx.Class.define("osparc.dashboard.SearchBarFilter", { } }, - resetFilters: function(silent = false) { + resetFilters: function() { this.__removeChips(); this.getChildControl("text-field").resetValue(); }, From 8c0a34af38ce54278e3a2fe094615c6d6769f7df Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Wed, 30 Oct 2024 18:41:56 +0100 Subject: [PATCH 12/13] fix after search --- .../client/source/class/osparc/dashboard/StudyBrowser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 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 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); } }); } From 90e8ede1b9541a8fa1d4398852b5d9ed0d1ac99a Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Fri, 1 Nov 2024 09:19:05 +0100 Subject: [PATCH 13/13] minor --- .../class/osparc/dashboard/GridButtonBase.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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",