From 08228fd38c0ec7ba43de29955832c01872705111 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 16:48:46 +0200 Subject: [PATCH 1/4] not needed --- .../client/source/class/osparc/share/AddCollaborators.js | 6 +----- .../client/source/class/osparc/share/PublishTemplate.js | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js b/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js index c4a8074e556..dea8508408f 100644 --- a/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js @@ -31,7 +31,7 @@ qx.Class.define("osparc.share.AddCollaborators", { construct: function(serializedDataCopy) { this.base(arguments); - this.setSerializedDataCopy(serializedDataCopy); + this.__serializedDataCopy = serializedDataCopy; this._setLayout(new qx.ui.layout.VBox(5)); @@ -72,10 +72,6 @@ qx.Class.define("osparc.share.AddCollaborators", { return control || this.base(arguments, id); }, - setSerializedDataCopy: function(serializedDataCopy) { - this.__serializedDataCopy = serializedDataCopy; - }, - __buildLayout: function() { this.getChildControl("intro-text"); diff --git a/services/static-webserver/client/source/class/osparc/share/PublishTemplate.js b/services/static-webserver/client/source/class/osparc/share/PublishTemplate.js index 00cc5ac4832..6572c24a900 100644 --- a/services/static-webserver/client/source/class/osparc/share/PublishTemplate.js +++ b/services/static-webserver/client/source/class/osparc/share/PublishTemplate.js @@ -54,7 +54,6 @@ qx.Class.define("osparc.share.PublishTemplate", { font: "text-14" }); this._add(addCollaborators); - addCollaborators.setSerializedDataCopy(this.__potentialTemplateData); this._add(this.__selectedCollabs); From d2b3dcf2f863e552e1e97675e144c92addd9082e Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 16:49:07 +0200 Subject: [PATCH 2/4] wire "resourceType" --- .../client/source/class/osparc/share/Collaborators.js | 5 ++++- 1 file changed, 4 insertions(+), 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 47b84ef84cd..57d3b53bc59 100644 --- a/services/static-webserver/client/source/class/osparc/share/Collaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/Collaborators.js @@ -233,7 +233,10 @@ qx.Class.define("osparc.share.Collaborators", { }, __createAddCollaboratorSection: function() { - const addCollaborators = new osparc.share.AddCollaborators(this._serializedDataCopy); + const serializedDataCopy = osparc.utils.Utils.deepCloneObject(this._serializedDataCopy); + // pass resourceType, so that, it it's a template testers can share it with product everyone + serializedDataCopy["resourceType"] = this._resourceType; + const addCollaborators = new osparc.share.AddCollaborators(serializedDataCopy); addCollaborators.addListener("addCollaborators", e => this._addEditors(e.getData()), this); return addCollaborators; }, From 7961e4e4fa24721bdd31f941f35933002cff951f Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 16:53:38 +0200 Subject: [PATCH 3/4] rely on the includeProductEveryone argument to exclude it if necessary --- .../client/source/class/osparc/store/Store.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/store/Store.js b/services/static-webserver/client/source/class/osparc/store/Store.js index 4760436b0de..404840a5ccf 100644 --- a/services/static-webserver/client/source/class/osparc/store/Store.js +++ b/services/static-webserver/client/source/class/osparc/store/Store.js @@ -559,9 +559,15 @@ qx.Class.define("osparc.store.Store", { .then(values => { const orgs = values[0]; // array const members = values[1]; // object + const productEveryone = values[2]; // number const potentialCollaborators = {}; orgs.forEach(org => { if (org["accessRights"]["read"]) { + // maybe because of migration script, some users have access to the product everyone group + // rely on the includeProductEveryone argument to exclude it if necessary + if (org["gid"] === productEveryone && !includeProductEveryone) { + return; + } org["collabType"] = 1; potentialCollaborators[org["gid"]] = org; } @@ -580,7 +586,6 @@ qx.Class.define("osparc.store.Store", { "collabType": 2 }; } - const productEveryone = values[2]; // entry if (includeProductEveryone && productEveryone) { productEveryone["collabType"] = 0; potentialCollaborators[productEveryone["gid"]] = productEveryone; From 35593cb00aba056627f58107aa417792a57f9ca1 Mon Sep 17 00:00:00 2001 From: Odei Maiz Date: Tue, 13 Aug 2024 16:55:03 +0200 Subject: [PATCH 4/4] minor --- .../client/source/class/osparc/store/Store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/static-webserver/client/source/class/osparc/store/Store.js b/services/static-webserver/client/source/class/osparc/store/Store.js index 404840a5ccf..3e211ccfa7c 100644 --- a/services/static-webserver/client/source/class/osparc/store/Store.js +++ b/services/static-webserver/client/source/class/osparc/store/Store.js @@ -559,13 +559,13 @@ qx.Class.define("osparc.store.Store", { .then(values => { const orgs = values[0]; // array const members = values[1]; // object - const productEveryone = values[2]; // number + const productEveryone = values[2]; // entry const potentialCollaborators = {}; orgs.forEach(org => { if (org["accessRights"]["read"]) { // maybe because of migration script, some users have access to the product everyone group // rely on the includeProductEveryone argument to exclude it if necessary - if (org["gid"] === productEveryone && !includeProductEveryone) { + if (org["gid"] === productEveryone["gid"] && !includeProductEveryone) { return; } org["collabType"] = 1;