Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [Frontend] Fix: exclude the share with product-everyone group for studies #6183

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading