Skip to content

Commit 5021976

Browse files
committed
renaming
1 parent 1e99456 commit 5021976

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

services/static-webserver/client/source/class/osparc/share/NewCollaboratorsManager.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
2929
this.__renderLayout();
3030

3131
this.__selectedCollaborators = [];
32-
this.__visibleCollaborators = {};
33-
this.__reloadCollaborators();
32+
this.__potentialCollaborators = {};
33+
this.__reloadPotentialCollaborators();
3434

3535
this.center();
3636
this.open();
@@ -49,7 +49,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
4949
__orgsButton: null,
5050
__shareButton: null,
5151
__selectedCollaborators: null,
52-
__visibleCollaborators: null,
52+
__potentialCollaborators: null,
5353

5454
getActionButton: function() {
5555
return this.__shareButton;
@@ -121,7 +121,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
121121
});
122122
},
123123

124-
__reloadCollaborators: function() {
124+
__reloadPotentialCollaborators: function() {
125125
let includeProductEveryone = false;
126126
if (this.__showOrganizations === false) {
127127
includeProductEveryone = false;
@@ -135,18 +135,19 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
135135
// all users can share services with ProductEveryone
136136
includeProductEveryone = true;
137137
}
138-
const potentialCollaborators = osparc.store.Groups.getInstance().getPotentialCollaborators(false, includeProductEveryone)
139-
this.__visibleCollaborators = potentialCollaborators;
140-
const anyCollaborator = Object.keys(potentialCollaborators).length;
138+
139+
this.__potentialCollaborators = osparc.store.Groups.getInstance().getPotentialCollaborators(false, includeProductEveryone)
140+
const anyCollaborator = Object.keys(this.__potentialCollaborators).length;
141141
// tell the user that belonging to an organization is required to start sharing
142142
this.__introLabel.setVisibility(anyCollaborator ? "excluded" : "visible");
143143
this.__orgsButton.setVisibility(anyCollaborator ? "excluded" : "visible");
144-
145144
// or start sharing
146145
this.__textFilter.setVisibility(anyCollaborator ? "visible" : "excluded");
147146
this.__collabButtonsContainer.setVisibility(anyCollaborator ? "visible" : "excluded");
148147
this.__shareButton.setVisibility(anyCollaborator ? "visible" : "excluded");
149-
this.__addEditors();
148+
149+
const potentialCollaborators = Object.values(this.__potentialCollaborators);
150+
this.__addPotentialCollaborators(potentialCollaborators);
150151
},
151152

152153
__collaboratorButton: function(collaborator) {
@@ -164,11 +165,9 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
164165
return collaboratorButton;
165166
},
166167

167-
__addEditors: function() {
168-
const visibleCollaborators = Object.values(this.__visibleCollaborators);
169-
168+
__addPotentialCollaborators: function(potentialCollaborators) {
170169
// sort them first
171-
visibleCollaborators.sort((a, b) => {
170+
potentialCollaborators.sort((a, b) => {
172171
if (a["collabType"] > b["collabType"]) {
173172
return 1;
174173
}
@@ -194,15 +193,15 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
194193
}
195194

196195
const existingCollaborators = existingCollabs.map(c => parseInt(c));
197-
visibleCollaborators.forEach(visibleCollaborator => {
196+
potentialCollaborators.forEach(potentialCollaborator => {
198197
// do not list the visibleCollaborators that are already collaborators
199-
if (existingCollaborators.includes(visibleCollaborator.getGroupId())) {
198+
if (existingCollaborators.includes(potentialCollaborator.getGroupId())) {
200199
return;
201200
}
202-
if (this.__showOrganizations === false && visibleCollaborator["collabType"] !== 2) {
201+
if (this.__showOrganizations === false && potentialCollaborator["collabType"] !== 2) {
203202
return;
204203
}
205-
this.__collabButtonsContainer.add(this.__collaboratorButton(visibleCollaborator));
204+
this.__collabButtonsContainer.add(this.__collaboratorButton(potentialCollaborator));
206205
});
207206
},
208207

0 commit comments

Comments
 (0)