Skip to content

Commit 0d18a1b

Browse files
authored
🎨 [Frontend] New Collaborators: Info button with tooltip (#8075)
1 parent d0874a0 commit 0d18a1b

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

services/static-webserver/client/source/class/osparc/filter/CollaboratorToggleButton.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,38 @@ qx.Class.define("osparc.filter.CollaboratorToggleButton", {
2424
appearance: "tagbutton"
2525
});
2626

27-
if (collaborator["collabType"] === 0) {
28-
this.setLabel(this.tr("Public"));
29-
} else {
30-
let label = collaborator.getLabel();
31-
if ("getEmail" in collaborator && collaborator.getEmail()) {
32-
label += ` (${collaborator.getEmail()})`;
33-
}
34-
this.setLabel(label);
35-
}
36-
37-
if (collaborator.getDescription()) {
38-
const ttt = collaborator.getLabel() + "<br>" + collaborator.getDescription();
39-
this.setToolTipText(ttt);
40-
}
41-
4227
let iconPath = null;
28+
let label = null;
29+
let toolTipText = "";
4330
switch (collaborator["collabType"]) {
4431
case 0:
4532
iconPath = "@FontAwesome5Solid/globe/14";
33+
label = this.tr("Public");
34+
toolTipText = this.tr("Public to all users");
4635
break;
4736
case 1:
4837
iconPath = "@FontAwesome5Solid/users/14";
38+
label = collaborator.getLabel();
39+
toolTipText = collaborator.getDescription();
4940
break;
50-
case 2:
41+
case 2: {
5142
iconPath = "@FontAwesome5Solid/user/14";
43+
label = collaborator.getLabel();
44+
if (collaborator.getEmail()) {
45+
toolTipText += collaborator.getEmail() + "<br>";
46+
}
47+
if (collaborator.getFirstName()) {
48+
toolTipText += [collaborator.getFirstName(), collaborator.getLastName()].join(" ").trim();
49+
}
5250
break;
51+
}
5352
}
5453
this.setIcon(iconPath);
54+
this.setLabel(label);
55+
if (toolTipText) {
56+
const infoButton = new osparc.ui.hint.InfoHint(toolTipText);
57+
this._add(infoButton);
58+
}
5559

5660
this.getChildControl("check");
5761
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
1919
showMaximize: false,
2020
autoDestroy: true,
2121
modal: true,
22-
width: 400,
22+
width: 330,
2323
maxHeight: 500,
2424
clickAwayClose: true
2525
});

0 commit comments

Comments
 (0)