@@ -166,9 +166,9 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
166166 membersCtrl . setDelegate ( {
167167 createItem : ( ) => new osparc . desktop . wallets . MemberListItem ( ) ,
168168 bindItem : ( ctrl , item , id ) => {
169- ctrl . bindProperty ( "id " , "model" , null , item , id ) ;
170- ctrl . bindProperty ( "id " , "key" , null , item , id ) ;
171- ctrl . bindProperty ( "gid " , "gid" , null , item , id ) ;
169+ ctrl . bindProperty ( "userId " , "model" , null , item , id ) ;
170+ ctrl . bindProperty ( "userId " , "key" , null , item , id ) ;
171+ ctrl . bindProperty ( "groupId " , "gid" , null , item , id ) ;
172172 ctrl . bindProperty ( "thumbnail" , "thumbnail" , null , item , id ) ;
173173 ctrl . bindProperty ( "name" , "title" , null , item , id ) ;
174174 ctrl . bindProperty ( "accessRights" , "accessRights" , null , item , id ) ;
@@ -183,16 +183,16 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
183183 "border-radius" : "16px"
184184 } ) ;
185185 item . addListener ( "promoteToAccountant" , e => {
186- const walletMember = e . getData ( ) ;
187- this . __promoteToAccountant ( walletMember ) ;
186+ const listedMember = e . getData ( ) ;
187+ this . __promoteToAccountant ( listedMember ) ;
188188 } ) ;
189189 item . addListener ( "demoteToMember" , e => {
190- const walletMember = e . getData ( ) ;
191- this . __demoteToMember ( walletMember ) ;
190+ const listedMember = e . getData ( ) ;
191+ this . __demoteToMember ( listedMember ) ;
192192 } ) ;
193193 item . addListener ( "removeMember" , e => {
194- const walletMember = e . getData ( ) ;
195- this . __deleteMember ( walletMember ) ;
194+ const listedMember = e . getData ( ) ;
195+ this . __deleteMember ( listedMember ) ;
196196 } ) ;
197197 }
198198 } ) ;
@@ -216,12 +216,14 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
216216 wallet . getAccessRights ( ) . forEach ( accessRights => {
217217 const gid = parseInt ( accessRights [ "gid" ] ) ;
218218 if ( Object . prototype . hasOwnProperty . call ( potentialCollaborators , gid ) ) {
219+ // only users or groupMe
219220 const collab = potentialCollaborators [ gid ] ;
220221 const collaborator = { } ;
222+ collaborator [ "userId" ] = gid === myGroupId ? osparc . auth . Data . getInstance ( ) . getUserId ( ) : collab . getUserId ( ) ;
221223 collaborator [ "groupId" ] = collab . getGroupId ( ) ;
222224 collaborator [ "thumbnail" ] = collab . getThumbnail ( ) ;
223225 collaborator [ "name" ] = collab . getLabel ( ) ;
224- collaborator [ "login" ] = "getLogin" in collab ? collab . getLogin ( ) : collab . getDescription ( ) ;
226+ collaborator [ "login" ] = gid === myGroupId ? osparc . auth . Data . getInstance ( ) . getEmail ( ) : collab . getLogin ( ) ;
225227 collaborator [ "accessRights" ] = {
226228 read : accessRights [ "read" ] ,
227229 write : accessRights [ "write" ] ,
@@ -287,7 +289,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
287289 } ) ;
288290
289291 // push 'WALLET_SHARED' notification
290- const potentialCollaborators = osparc . store . Groups . getInstance ( ) . getPotentialCollaborators ( )
292+ const potentialCollaborators = osparc . store . Groups . getInstance ( ) . getPotentialCollaborators ( ) ;
291293 gids . forEach ( gid => {
292294 if ( gid in potentialCollaborators && "getUserId" in potentialCollaborators [ gid ] ) {
293295 // it's a user, not an organization
@@ -298,7 +300,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
298300 } ) ;
299301 } ,
300302
301- __promoteToAccountant : function ( walletMember ) {
303+ __promoteToAccountant : function ( listedMember ) {
302304 const wallet = this . __currentModel ;
303305 if ( wallet === null ) {
304306 return ;
@@ -307,7 +309,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
307309 const params = {
308310 url : {
309311 "walletId" : wallet . getWalletId ( ) ,
310- "groupId" : walletMember [ "gid" ]
312+ "groupId" : listedMember [ "gid" ] ,
311313 } ,
312314 data : this . self ( ) . getWriteAccess ( )
313315 } ;
@@ -318,7 +320,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
318320 } ) ;
319321 } ,
320322
321- __demoteToMember : function ( walletMember ) {
323+ __demoteToMember : function ( listedMember ) {
322324 const wallet = this . __currentModel ;
323325 if ( wallet === null ) {
324326 return ;
@@ -327,7 +329,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
327329 const params = {
328330 url : {
329331 "walletId" : wallet . getWalletId ( ) ,
330- "groupId" : walletMember [ "gid" ]
332+ "groupId" : listedMember [ "gid" ] ,
331333 } ,
332334 data : this . self ( ) . getReadAccess ( )
333335 } ;
@@ -338,7 +340,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
338340 } ) ;
339341 } ,
340342
341- __deleteMember : function ( walletMember ) {
343+ __deleteMember : function ( listedMember ) {
342344 const wallet = this . __currentModel ;
343345 if ( wallet === null ) {
344346 return ;
@@ -347,7 +349,7 @@ qx.Class.define("osparc.desktop.wallets.MembersList", {
347349 const params = {
348350 url : {
349351 "walletId" : wallet . getWalletId ( ) ,
350- "groupId" : walletMember [ "gid" ]
352+ "groupId" : listedMember [ "gid" ] ,
351353 }
352354 } ;
353355 osparc . data . Resources . fetch ( "wallets" , "deleteAccessRights" , params )
0 commit comments