@@ -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 } ,
0 commit comments