@@ -45,6 +45,13 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
4545 column : osparc . dashboard . ListButtonBase . POS . LOCK_STATUS
4646 } ) ;
4747 break ;
48+ case "avatar-group" :
49+ control = new osparc . ui . basic . AvatarGroup ( 24 , "left" , 100 ) ;
50+ this . _add ( control , {
51+ row : 0 ,
52+ column : osparc . dashboard . ListButtonBase . POS . AVATAR_GROUP
53+ } ) ;
54+ break ;
4855 case "tags" :
4956 control = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 3 ) . set ( {
5057 alignY : "middle"
@@ -236,8 +243,27 @@ qx.Class.define("osparc.dashboard.ListButtonItem", {
236243 const label = this . getChildControl ( "owner" ) ;
237244 const user = this . __createOwner ( value ) ;
238245 label . setValue ( user ) ;
246+
247+ // remove this, testing purposes
248+ if ( osparc . utils . DisabledPlugins . isSimultaneousAccessEnabled ( ) && this . getResourceType ( ) === "study" ) {
249+ const avatarGroup = this . getChildControl ( "avatar-group" ) ;
250+ const allUsers = [
251+ { name : "Alice" , avatar : "https://i.pravatar.cc/150?img=1" } ,
252+ { name : "Bob" , avatar : "https://i.pravatar.cc/150?img=2" } ,
253+ { name : "Charlie" , avatar : "https://i.pravatar.cc/150?img=3" } ,
254+ { name : "Dana" , avatar : "https://i.pravatar.cc/150?img=4" } ,
255+ { name : "Eve" , avatar : "https://i.pravatar.cc/150?img=5" } ,
256+ { name : "Frank" , avatar : "https://i.pravatar.cc/150?img=6" } ,
257+ ] ;
258+ // Random number of users between 1 and 6
259+ const randomCount = Math . floor ( Math . random ( ) * 6 ) + 1 ;
260+ // Shuffle the array and take the first randomCount users
261+ const shuffled = allUsers . sort ( ( ) => 0.5 - Math . random ( ) ) ;
262+ const randomUsers = shuffled . slice ( 0 , randomCount ) ;
263+ avatarGroup . setUsers ( randomUsers ) ;
264+ }
265+
239266 this . __makeItemResponsive ( label ) ;
240- return ;
241267 } ,
242268
243269 _applyAccessRights : function ( value ) {
0 commit comments