Skip to content

Commit

Permalink
šŸ› [Frontend] Fix: exclude the share with product-everyone group for sā€¦
Browse files Browse the repository at this point in the history
ā€¦tudies (ITISFoundation#6183)
  • Loading branch information
odeimaiz authored Aug 14, 2024
1 parent 0cc540f commit 587f744
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ qx.Class.define("osparc.share.PublishTemplate", {
font: "text-14"
});
this._add(addCollaborators);
addCollaborators.setSerializedDataCopy(this.__potentialTemplateData);

this._add(this.__selectedCollabs);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]; // 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["gid"] && !includeProductEveryone) {
return;
}
org["collabType"] = 1;
potentialCollaborators[org["gid"]] = org;
}
Expand All @@ -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;
Expand Down

0 comments on commit 587f744

Please sign in to comment.