@@ -132,16 +132,29 @@ qx.Class.define("osparc.info.CommentAdd", {
132132 } ,
133133
134134 __notifyUserTapped : function ( ) {
135- if ( this . __conversationId ) {
136- this . __postNotify ( ) ;
137- } else {
138- // create new conversation first
139- osparc . study . Conversations . addConversation ( this . __studyId )
140- . then ( data => {
141- this . __conversationId = data [ "conversationId" ] ;
142- this . __postNotify ( ) ;
143- } )
144- }
135+ const showOrganizations = false ;
136+ const showAccessRights = false ;
137+ const recipientsManager = new osparc . share . NewCollaboratorsManager ( currentStudy , showOrganizations , showAccessRights ) ;
138+ // OM: extend NewCollaboratorsManager to only allow one user selected
139+ recipientsManager . setCaption ( this . tr ( "Notify user" ) ) ;
140+ recipientsManager . getActionButton ( ) . setLabel ( this . tr ( "Notify" ) ) ;
141+ recipientsManager . addListener ( "addCollaborators" , e => {
142+ const data = e . getData ( ) ;
143+ const userGids = data [ "selectedGids" ] ;
144+ if ( userGids && userGids . length ) {
145+ const userGid = parseInt ( userGids [ 0 ] ) ;
146+ if ( this . __conversationId ) {
147+ this . __postNotify ( userGid ) ;
148+ } else {
149+ // create new conversation first
150+ osparc . study . Conversations . addConversation ( this . __studyId )
151+ . then ( data => {
152+ this . __conversationId = data [ "conversationId" ] ;
153+ this . __postNotify ( userGid ) ;
154+ } ) ;
155+ }
156+ }
157+ } ) ;
145158 } ,
146159
147160 __addComment : function ( ) {
0 commit comments