Skip to content

Commit

Permalink
Merge branch 'master' into mai/upgrade-requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov authored Aug 21, 2024
2 parents 9be1445 + eee527f commit 5009358
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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.__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

0 comments on commit 5009358

Please sign in to comment.