@@ -11,7 +11,7 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
1111 construct : function ( resourceData , showOrganizations = true ) {
1212 this . base ( arguments , "collaboratorsManager" , this . tr ( "Share with" ) ) ;
1313 this . set ( {
14- layout : new qx . ui . layout . VBox ( ) ,
14+ layout : new qx . ui . layout . VBox ( 5 ) ,
1515 allowMinimize : false ,
1616 allowMaximize : false ,
1717 showMinimize : false ,
@@ -65,12 +65,23 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
6565 } ) ;
6666 this . add ( introLabel ) ;
6767
68+ const toolbar = new qx . ui . container . Composite ( new qx . ui . layout . HBox ( 5 ) . set ( {
69+ alignY : "middle" ,
70+ } ) ) ;
6871 const filter = this . __textFilter = new osparc . filter . TextFilter ( "name" , "collaboratorsManager" ) . set ( {
69- allowStretchX : true ,
70- margin : [ 0 , 10 , 5 , 10 ]
72+ allowGrowX : true ,
73+ margin : 0 ,
7174 } ) ;
7275 this . addListener ( "appear" , ( ) => filter . getChildControl ( "textfield" ) . focus ( ) ) ;
73- this . add ( filter ) ;
76+ toolbar . add ( filter , {
77+ flex : 1
78+ } ) ;
79+ const searchButton = new osparc . ui . form . FetchButton ( this . tr ( "Search" ) , "@FontAwesome5Solid/search/12" ) . set ( {
80+ maxHeight : 30 ,
81+ } ) ;
82+ searchButton . addListener ( "exectue" , ( ) => this . __searchUsers ( ) , this ) ;
83+ toolbar . add ( searchButton ) ;
84+ this . add ( toolbar ) ;
7485
7586 const collabButtonsContainer = this . __collabButtonsContainer = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( ) ) ;
7687 const scrollContainer = new qx . ui . container . Scroll ( ) ;
@@ -98,6 +109,22 @@ qx.Class.define("osparc.share.NewCollaboratorsManager", {
98109 this . add ( buttons ) ;
99110 } ,
100111
112+ __searchUsers : function ( ) {
113+ const text = this . __textFilter . getValue ( ) ;
114+ console . log ( "search" , text ) ;
115+ const params = {
116+ data : {
117+ match : text
118+ }
119+ } ;
120+ osparc . data . Resources . fetch ( "users" , "search" , params )
121+ . then ( data => console . log ( data ) )
122+ . catch ( err => {
123+ console . error ( err ) ;
124+ osparc . FlashMessenger . getInstance ( ) . logAs ( err . message , "ERROR" ) ;
125+ } )
126+ } ,
127+
101128 __reloadCollaborators : function ( ) {
102129 let includeProductEveryone = false ;
103130 if ( this . __showOrganizations === false ) {
0 commit comments