Skip to content

Commit 587f744

Browse files
authored
šŸ› [Frontend] Fix: exclude the share with product-everyone group for studies (#6183)
1 parent 0cc540f commit 587f744

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

ā€Žservices/static-webserver/client/source/class/osparc/share/AddCollaborators.jsā€Ž

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ qx.Class.define("osparc.share.AddCollaborators", {
3131
construct: function(serializedDataCopy) {
3232
this.base(arguments);
3333

34-
this.setSerializedDataCopy(serializedDataCopy);
34+
this.__serializedDataCopy = serializedDataCopy;
3535

3636
this._setLayout(new qx.ui.layout.VBox(5));
3737

@@ -72,10 +72,6 @@ qx.Class.define("osparc.share.AddCollaborators", {
7272
return control || this.base(arguments, id);
7373
},
7474

75-
setSerializedDataCopy: function(serializedDataCopy) {
76-
this.__serializedDataCopy = serializedDataCopy;
77-
},
78-
7975
__buildLayout: function() {
8076
this.getChildControl("intro-text");
8177

ā€Žservices/static-webserver/client/source/class/osparc/share/Collaborators.jsā€Ž

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ qx.Class.define("osparc.share.Collaborators", {
233233
},
234234

235235
__createAddCollaboratorSection: function() {
236-
const addCollaborators = new osparc.share.AddCollaborators(this._serializedDataCopy);
236+
const serializedDataCopy = osparc.utils.Utils.deepCloneObject(this._serializedDataCopy);
237+
// pass resourceType, so that, it it's a template testers can share it with product everyone
238+
serializedDataCopy["resourceType"] = this._resourceType;
239+
const addCollaborators = new osparc.share.AddCollaborators(serializedDataCopy);
237240
addCollaborators.addListener("addCollaborators", e => this._addEditors(e.getData()), this);
238241
return addCollaborators;
239242
},

ā€Žservices/static-webserver/client/source/class/osparc/share/PublishTemplate.jsā€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ qx.Class.define("osparc.share.PublishTemplate", {
5454
font: "text-14"
5555
});
5656
this._add(addCollaborators);
57-
addCollaborators.setSerializedDataCopy(this.__potentialTemplateData);
5857

5958
this._add(this.__selectedCollabs);
6059

ā€Žservices/static-webserver/client/source/class/osparc/store/Store.jsā€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,15 @@ qx.Class.define("osparc.store.Store", {
559559
.then(values => {
560560
const orgs = values[0]; // array
561561
const members = values[1]; // object
562+
const productEveryone = values[2]; // entry
562563
const potentialCollaborators = {};
563564
orgs.forEach(org => {
564565
if (org["accessRights"]["read"]) {
566+
// maybe because of migration script, some users have access to the product everyone group
567+
// rely on the includeProductEveryone argument to exclude it if necessary
568+
if (org["gid"] === productEveryone["gid"] && !includeProductEveryone) {
569+
return;
570+
}
565571
org["collabType"] = 1;
566572
potentialCollaborators[org["gid"]] = org;
567573
}
@@ -580,7 +586,6 @@ qx.Class.define("osparc.store.Store", {
580586
"collabType": 2
581587
};
582588
}
583-
const productEveryone = values[2]; // entry
584589
if (includeProductEveryone && productEveryone) {
585590
productEveryone["collabType"] = 0;
586591
potentialCollaborators[productEveryone["gid"]] = productEveryone;

0 commit comments

Comments
Ā (0)