Skip to content

Commit 5cfb0d7

Browse files
committed
wallet members list
1 parent 20e35b5 commit 5cfb0d7

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

services/static-webserver/client/source/class/osparc/data/model/User.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ qx.Class.define("osparc.data.model.User", {
4040
groupId: userData.gid,
4141
label: label,
4242
login: userData.login,
43-
thumbnail: osparc.utils.Avatar.getUrl(userData.login, 32),
43+
thumbnail: this.self().emailToThumbnail(userData.login),
4444
accessRights: userData.accessRights,
4545
});
4646
},
@@ -87,5 +87,11 @@ qx.Class.define("osparc.data.model.User", {
8787
init: "",
8888
event: "changeThumbnail",
8989
},
90+
},
91+
92+
statics: {
93+
emailToThumbnail: function(email) {
94+
return osparc.utils.Avatar.getUrl(email, 32)
95+
},
9096
}
9197
});

services/static-webserver/client/source/class/osparc/desktop/wallets/MembersList.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,16 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
217217
const gid = accessRights["gid"];
218218
if (Object.prototype.hasOwnProperty.call(potentialCollaborators, parseInt(gid))) {
219219
const collab = potentialCollaborators[parseInt(gid)];
220-
// Do not override collaborator object
221-
const collaborator = osparc.utils.Utils.deepCloneObject(collab);
222-
if ("first_name" in collaborator) {
223-
collaborator["thumbnail"] = osparc.utils.Avatar.getUrl(collaborator["login"], 32);
224-
collaborator["name"] = osparc.utils.Utils.firstsUp(
225-
`${"first_name" in collaborator && collaborator["first_name"] != null ?
226-
collaborator["first_name"] : collaborator["login"]}`,
227-
`${"last_name" in collaborator && collaborator["last_name"] != null ?
228-
collaborator["last_name"] : ""}`
229-
);
230-
}
231-
collaborator["accessRights"] = accessRights;
220+
const collaborator = {};
221+
collaborator["groupId"] = collab.getGroupId();
222+
collaborator["thumbnail"] = collab.getThumbnail();
223+
collaborator["name"] = collab.getLabel();
224+
collaborator["login"] = "getLogin" in collab ? collab.getLogin() : "";
225+
collaborator["accessRights"] = {
226+
read: accessRights["read"],
227+
write: accessRights["write"],
228+
delete: accessRights["delete"],
229+
};
232230
let options = [];
233231
if (canIWrite) {
234232
// accountant...

services/static-webserver/client/source/class/osparc/store/Groups.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ qx.Class.define("osparc.store.Groups", {
9090
});
9191
this.setEveryoneGroup(everyoneGroup);
9292
this.setEveryoneProductGroup(productEveryoneGroup);
93-
this.setGroupMe(groupMe);
9493
this.setOrganizations(orgs);
94+
this.setGroupMe(groupMe);
9595
return orgs;
9696
});
9797
},

0 commit comments

Comments
 (0)