Skip to content

Commit 55ac409

Browse files
committed
Nicer wallet members list
1 parent 4d8f5ed commit 55ac409

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ qx.Class.define("osparc.data.model.User", {
2828
construct: function(userData) {
2929
this.base(arguments);
3030

31-
let label = userData["login"];
32-
if ("first_name" in userData && userData["first_name"]) {
33-
label = osparc.utils.Utils.firstsUp(userData["first_name"]);
34-
if (userData["last_name"]) {
35-
label += " " + osparc.utils.Utils.firstsUp(userData["last_name"]);
36-
}
37-
}
31+
const label = this.self().namesToLabel(userData["first_name"], userData["last_name"]) || userData["login"];
3832
this.set({
3933
userId: userData.id,
4034
groupId: userData.gid,
@@ -90,6 +84,17 @@ qx.Class.define("osparc.data.model.User", {
9084
},
9185

9286
statics: {
87+
namesToLabel: function(firstName, lastName) {
88+
let label = "";
89+
if (firstName) {
90+
label = osparc.utils.Utils.firstsUp(firstName);
91+
if (lastName) {
92+
label += " " + osparc.utils.Utils.firstsUp(lastName);
93+
}
94+
}
95+
return label;
96+
},
97+
9398
emailToThumbnail: function(email) {
9499
return osparc.utils.Avatar.getUrl(email, 32)
95100
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
221221
collaborator["groupId"] = collab.getGroupId();
222222
collaborator["thumbnail"] = collab.getThumbnail();
223223
collaborator["name"] = collab.getLabel();
224-
collaborator["login"] = "getLogin" in collab ? collab.getLogin() : "";
224+
collaborator["login"] = "getLogin" in collab ? collab.getLogin() : collab.getDescription();
225225
collaborator["accessRights"] = {
226226
read: accessRights["read"],
227227
write: accessRights["write"],

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ qx.Class.define("osparc.desktop.wallets.WalletListItem", {
6464
},
6565

6666
events: {
67+
"openShareWallet": "qx.event.type.Data",
6768
"openEditWallet": "qx.event.type.Data",
6869
"buyCredits": "qx.event.type.Data",
6970
"toggleFavourite": "qx.event.type.Data"

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ qx.Class.define("osparc.store.Groups", {
9292
this.setEveryoneProductGroup(productEveryoneGroup);
9393
this.setOrganizations(orgs);
9494
this.setGroupMe(groupMe);
95+
const myAuthData = osparc.auth.Data.getInstance();
96+
groupMe.set({
97+
label: osparc.data.model.User.namesToLabel(myAuthData.getFirstName(), myAuthData.getLastName()),
98+
description: myAuthData.getEmail(),
99+
thumbnail: osparc.data.model.User.emailToThumbnail(myAuthData.getEmail()),
100+
})
95101
return orgs;
96102
});
97103
},

0 commit comments

Comments
 (0)