diff --git a/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js b/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js index dea8508408f..148eead1bf9 100644 --- a/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/AddCollaborators.js @@ -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)); @@ -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"); diff --git a/services/static-webserver/client/source/class/osparc/share/Collaborators.js b/services/static-webserver/client/source/class/osparc/share/Collaborators.js index 57d3b53bc59..47163863b82 100644 --- a/services/static-webserver/client/source/class/osparc/share/Collaborators.js +++ b/services/static-webserver/client/source/class/osparc/share/Collaborators.js @@ -156,7 +156,7 @@ qx.Class.define("osparc.share.Collaborators", { members: { _serializedDataCopy: null, _resourceType: null, - __organizationsAndMembers: null, + __addCollaborators: null, __collaboratorsModel: null, __collaborators: null, @@ -224,9 +224,8 @@ 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"); @@ -234,7 +233,7 @@ qx.Class.define("osparc.share.Collaborators", { __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); @@ -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();