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: reload Share with... list after updating access rights #6218

Merged
merged 5 commits into from
Aug 21, 2024
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.__serializedDataCopy = serializedDataCopy;
this.setSerializedData(serializedDataCopy);

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

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

setSerializedData: 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 @@ -156,7 +156,7 @@ qx.Class.define("osparc.share.Collaborators", {
members: {
_serializedDataCopy: null,
_resourceType: null,
__organizationsAndMembers: null,
__addCollaborators: null,
__collaboratorsModel: null,
__collaborators: null,

Expand Down Expand Up @@ -224,17 +224,16 @@ qx.Class.define("osparc.share.Collaborators", {

__buildLayout: function() {
if (this.__amIOwner()) {
this._createChildControlImpl("add-collaborator");
this.__addCollaborators = this._createChildControlImpl("add-collaborator");
}
this._createChildControlImpl("open-organizations-btn");
this._createChildControlImpl("collaborators-list");
this._createChildControlImpl("study-link");
this._createChildControlImpl("template-link");
},

__createAddCollaboratorSection: function() {
const serializedDataCopy = osparc.utils.Utils.deepCloneObject(this._serializedDataCopy);
// pass resourceType, so that, it it's a template testers can share it with product everyone
// pass resourceType, so that, if 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);
Expand Down Expand Up @@ -365,6 +364,15 @@ qx.Class.define("osparc.share.Collaborators", {
},

_reloadCollaboratorsList: function() {
// reload "Share with..." list
if (this.__addCollaborators) {
const serializedDataCopy = osparc.utils.Utils.deepCloneObject(this._serializedDataCopy);
// pass resourceType, so that, if it's a template testers can share it with product everyone
serializedDataCopy["resourceType"] = this._resourceType;
this.__addCollaborators.setSerializedData(serializedDataCopy);
}

// reload list
this.__collaboratorsModel.removeAll();

const store = osparc.store.Store.getInstance();
Expand Down
Loading