Skip to content

Commit d21852f

Browse files
committed
hideMyself property
1 parent a53bbe3 commit d21852f

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

services/static-webserver/client/source/class/osparc/navigation/NavigationBar.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ qx.Class.define("osparc.navigation.NavigationBar", {
254254
case "avatar-group": {
255255
const maxWidth = osparc.WindowSizeTracker.getInstance().isCompactVersion() ? 80 : 150;
256256
control = new osparc.ui.basic.AvatarGroup(26, "right", maxWidth).set({
257+
hideMyself: true,
257258
alignY: "middle",
258259
visibility: "excluded",
259260
});
@@ -353,11 +354,8 @@ qx.Class.define("osparc.navigation.NavigationBar", {
353354
if (this.getStudy() && data["project_uuid"] === this.getStudy().getUuid()) {
354355
const projectState = data["data"];
355356
const currentUserGroupIds = osparc.study.Utils.state.getCurrentGroupIds(projectState);
356-
// remove myself from the list of users
357-
const filteredUserGroupIds = currentUserGroupIds.filter(gid => gid !== osparc.store.Groups.getInstance().getMyGroupId());
358-
// show the rest of the users in the avatar group
359357
const avatarGroup = this.getChildControl("avatar-group");
360-
avatarGroup.setUserGroupIds(filteredUserGroupIds);
358+
avatarGroup.setUserGroupIds(currentUserGroupIds);
361359
}
362360
}
363361
}, this);

services/static-webserver/client/source/class/osparc/ui/basic/AvatarGroup.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ qx.Class.define("osparc.ui.basic.AvatarGroup", {
4343
document.addEventListener("pointermove", this.__onGlobalPointerMove);
4444
},
4545

46+
properties: {
47+
hideMyself: {
48+
check: "Boolean",
49+
init: false,
50+
}
51+
},
52+
4653
members: {
4754
__avatarSize: null,
4855
__maxVisible: null,
@@ -60,6 +67,12 @@ qx.Class.define("osparc.ui.basic.AvatarGroup", {
6067
return;
6168
}
6269
this.__userGroupIds = userGroupIds || [];
70+
71+
if (this.isHideMyself()) {
72+
// remove myself from the list of users
73+
userGroupIds = userGroupIds.filter(gid => gid !== osparc.store.Groups.getInstance().getMyGroupId());
74+
}
75+
6376
const usersStore = osparc.store.Users.getInstance();
6477
const userPromises = userGroupIds.map(userGroupId => usersStore.getUser(userGroupId));
6578
const users = [];

services/static-webserver/client/source/class/osparc/workbench/NodeUI.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ qx.Class.define("osparc.workbench.NodeUI", {
288288
});
289289
break;
290290
case "avatar-group":
291-
control = new osparc.ui.basic.AvatarGroup(20, "right");
291+
control = new osparc.ui.basic.AvatarGroup(20, "right").set({
292+
hideMyself: true,
293+
});
292294
this.getChildControl("middle-container").addAt(control, 2, {
293295
flex: 1
294296
});

0 commit comments

Comments
 (0)