From 948d0191464b050c1ee7e03f7931d916e9ba84b4 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 12:18:28 +0100 Subject: [PATCH 1/9] removed thumbnail from node's model --- .../client/source/class/osparc/data/model/Node.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 7a37517f8982..8dd647ee009f 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -115,12 +115,6 @@ qx.Class.define("osparc.data.model.Node", { event: "changeServiceUrl" }, - thumbnail: { - check: "String", - nullable: true, - init: "" - }, - portsConnected: { check: "Array", init: [], @@ -478,9 +472,6 @@ qx.Class.define("osparc.data.model.Node", { } this.populateInputOutputData(nodeData); this.populateStates(nodeData); - if (nodeData.thumbnail) { - this.setThumbnail(nodeData.thumbnail); - } if (nodeData.bootOptions) { this.setBootOptions(nodeData.bootOptions); } @@ -1254,7 +1245,6 @@ qx.Class.define("osparc.data.model.Node", { inputAccess: this.getInputAccess(), inputNodes: this.getInputNodes(), inputsRequired: this.getInputsRequired(), - thumbnail: this.getThumbnail(), bootOptions: this.getBootOptions() }; if (!clean) { From f5d8791a32322d8ca2fae6ef61f5f5bf9092dbac Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 13:13:59 +0100 Subject: [PATCH 2/9] minor --- .../client/source/class/osparc/workbench/NodeUI.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/NodeUI.js b/services/static-webserver/client/source/class/osparc/workbench/NodeUI.js index ce0bdb710431..cc1af9a52e30 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/NodeUI.js +++ b/services/static-webserver/client/source/class/osparc/workbench/NodeUI.js @@ -203,9 +203,6 @@ qx.Class.define("osparc.workbench.NodeUI", { __createWindowLayout: function() { const node = this.getNode(); - if (node.getThumbnail()) { - this.setThumbnail(node.getThumbnail()); - } this.getChildControl("chips").show(); From 0d7703e07ff094299cad5731a2ef0a554adec282 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 13:18:21 +0100 Subject: [PATCH 3/9] do not return changed units --- .../client/source/class/osparc/data/model/Node.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/model/Node.js b/services/static-webserver/client/source/class/osparc/data/model/Node.js index 8dd647ee009f..25e6c86e2b69 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/Node.js +++ b/services/static-webserver/client/source/class/osparc/data/model/Node.js @@ -415,9 +415,12 @@ qx.Class.define("osparc.data.model.Node", { __getInputUnits: function() { if (this.isPropertyInitialized("propsForm") && this.getPropsForm()) { - return this.getPropsForm().getChangedXUnits(); + const changedUnits = this.getPropsForm().getChangedXUnits(); + if (Object.keys(changedUnits).length) { + return changedUnits; + } } - return {}; + return null; }, getInput: function(inputId) { From b935428e986267cb1e1c09d860664b3a72ba86dc Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 14:23:33 +0100 Subject: [PATCH 4/9] // move to position (0, 0) --- .../client/source/class/osparc/workbench/WorkbenchUI.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js index 37279ed42c18..19a123cf5473 100644 --- a/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js +++ b/services/static-webserver/client/source/class/osparc/workbench/WorkbenchUI.js @@ -1140,7 +1140,6 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { // create nodes const nodes = model.getNodes(); this.__renderNodes(nodes); - qx.ui.core.queue.Layout.flush(); this.__renderAnnotations(model.getStudy().getUi()); } }, @@ -1154,7 +1153,14 @@ qx.Class.define("osparc.workbench.WorkbenchUI", { nodeUI.addListenerOnce("appear", () => { nNodesToRender--; if (nNodesToRender === 0) { + // all nodes rendered this.__renderEdges(nodes); + + setTimeout(() => { + // move to position (0, 0) + this._workbenchLayoutScroll.scrollToX(0); + this._workbenchLayoutScroll.scrollToY(0); + }, 10); } }, this); this._addNodeUIToWorkbench(nodeUI, node.getPosition()); From e4f3cf63a4b0f4578e5c5f007140a8de8a0a1148 Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 14:36:17 +0100 Subject: [PATCH 5/9] renamings --- .../client/source/class/osparc/data/Resources.js | 2 +- .../client/source/class/osparc/form/tag/TagItem.js | 4 ++-- .../static-webserver/client/source/class/osparc/store/Tags.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index fecd1b5c09eb..afd3b79c0b82 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -1259,7 +1259,7 @@ qx.Class.define("osparc.data.Resources", { method: "POST", url: statics.API + "/tags" }, - put: { + patch: { method: "PATCH", url: statics.API + "/tags/{tagId}" }, diff --git a/services/static-webserver/client/source/class/osparc/form/tag/TagItem.js b/services/static-webserver/client/source/class/osparc/form/tag/TagItem.js index 97600c48bd41..c1a458426c72 100644 --- a/services/static-webserver/client/source/class/osparc/form/tag/TagItem.js +++ b/services/static-webserver/client/source/class/osparc/form/tag/TagItem.js @@ -275,7 +275,7 @@ qx.Class.define("osparc.form.tag.TagItem", { saveButton.setFetching(true); const tagsStore = osparc.store.Tags.getInstance(); if (this.isPropertyInitialized("id")) { - tagsStore.putTag(this.getId(), data) + tagsStore.patchTag(this.getId(), data) .then(tag => this.setTag(tag)) .catch(console.error) .finally(() => { @@ -336,7 +336,7 @@ qx.Class.define("osparc.form.tag.TagItem", { return { name: name.trim(), description: description ? description.trim() : "", - color: color + color: color, }; }, __applyMode: function() { diff --git a/services/static-webserver/client/source/class/osparc/store/Tags.js b/services/static-webserver/client/source/class/osparc/store/Tags.js index dcc0c15cbd64..dbfd6f5ccdd6 100644 --- a/services/static-webserver/client/source/class/osparc/store/Tags.js +++ b/services/static-webserver/client/source/class/osparc/store/Tags.js @@ -88,14 +88,14 @@ qx.Class.define("osparc.store.Tags", { .catch(console.error); }, - putTag: function(tagId, updateData) { + patchTag: function(tagId, updateData) { const params = { url: { tagId }, data: updateData }; - return osparc.data.Resources.getInstance().fetch("tags", "put", params) + return osparc.data.Resources.getInstance().fetch("tags", "patch", params) .then(tagData => { return this.__addToCache(tagData); }) From 49817412f36c986dedf0179feddaf85bc396624e Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 14:38:05 +0100 Subject: [PATCH 6/9] do not patch accessRights --- .../static-webserver/client/source/class/osparc/store/Tags.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/static-webserver/client/source/class/osparc/store/Tags.js b/services/static-webserver/client/source/class/osparc/store/Tags.js index dbfd6f5ccdd6..b736f9e84d87 100644 --- a/services/static-webserver/client/source/class/osparc/store/Tags.js +++ b/services/static-webserver/client/source/class/osparc/store/Tags.js @@ -97,6 +97,9 @@ qx.Class.define("osparc.store.Tags", { }; return osparc.data.Resources.getInstance().fetch("tags", "patch", params) .then(tagData => { + if ("accessRights" in tagData) { + delete tagData["accessRights"]; + } return this.__addToCache(tagData); }) .catch(console.error); From 159e9890d46b7292c0ba27cf32d4eb3db4a999bc Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 14:38:29 +0100 Subject: [PATCH 7/9] comment --- .../static-webserver/client/source/class/osparc/store/Tags.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/static-webserver/client/source/class/osparc/store/Tags.js b/services/static-webserver/client/source/class/osparc/store/Tags.js index b736f9e84d87..c2830262cd9b 100644 --- a/services/static-webserver/client/source/class/osparc/store/Tags.js +++ b/services/static-webserver/client/source/class/osparc/store/Tags.js @@ -98,6 +98,7 @@ qx.Class.define("osparc.store.Tags", { return osparc.data.Resources.getInstance().fetch("tags", "patch", params) .then(tagData => { if ("accessRights" in tagData) { + // accessRights are not patched in this endpoint delete tagData["accessRights"]; } return this.__addToCache(tagData); From ba955e43b4c2e73ad9dbcdc1a86ae524667d168f Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 14:50:02 +0100 Subject: [PATCH 8/9] scroll bar in secondary column --- .../class/osparc/desktop/WorkbenchView.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js index 871afbf33b24..a735b2532d61 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js +++ b/services/static-webserver/client/source/class/osparc/desktop/WorkbenchView.js @@ -790,24 +790,33 @@ qx.Class.define("osparc.desktop.WorkbenchView", { this.__studyOptionsPage.getChildControl("button").show(); this.getChildControl("side-panel-right-tabs").setSelection([this.__studyOptionsPage]); - this.__studyOptionsPage.add(new osparc.info.StudyMedium(study), { + const scrollView = new qx.ui.container.Scroll(); + const secondaryColumnStudyContent = new qx.ui.container.Composite(new qx.ui.layout.VBox(15)).set({ + backgroundColor: "transparent" + }); + scrollView.add(secondaryColumnStudyContent); + this.__studyOptionsPage.add(scrollView, { + flex: 1 + }); + + secondaryColumnStudyContent.add(new osparc.info.StudyMedium(study), { flex: 1 }); - this.__studyOptionsPage.add(this.__getSlideshowSection()); + secondaryColumnStudyContent.add(this.__getSlideshowSection()); - this.__studyOptionsPage.add(this.__getAnnotationsSection()); + secondaryColumnStudyContent.add(this.__getAnnotationsSection()); const snaps = this.__getSnapshotsSection(); snaps.exclude(); const isVCDisabled = osparc.utils.DisabledPlugins.isVersionControlDisabled(); snaps.setVisibility(isVCDisabled ? "excluded" : "visible"); - this.__studyOptionsPage.add(snaps); + secondaryColumnStudyContent.add(snaps); const iters = this.__getIterationsSection(); const isMMDisabled = osparc.utils.DisabledPlugins.isMetaModelingDisabled(); snaps.setVisibility(isMMDisabled ? "excluded" : "visible"); - this.__studyOptionsPage.add(iters); + secondaryColumnStudyContent.add(iters); }, __getSlideshowSection: function() { From a20175df0ca2b38885abe391fc9bf04003c9e7ee Mon Sep 17 00:00:00 2001 From: odeimaiz Date: Thu, 9 Jan 2025 15:44:28 +0100 Subject: [PATCH 9/9] minor fix --- .../client/source/class/osparc/share/Collaborators.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/share/Collaborators.js b/services/static-webserver/client/source/class/osparc/share/Collaborators.js index cdeeb99c419b..6eedcc1483fa 100644 --- a/services/static-webserver/client/source/class/osparc/share/Collaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/Collaborators.js @@ -194,7 +194,7 @@ qx.Class.define("osparc.share.Collaborators", { switch (this._resourceType) { case "study": case "template": - canIShare = osparc.study.Utils.canIWrite(this._serializedDataCopy["accessRights"]); + canIShare = osparc.data.model.Study.canIWrite(this._serializedDataCopy["accessRights"]); break; case "service": canIShare = osparc.service.Utils.canIWrite(this._serializedDataCopy["accessRights"]);