@@ -77,6 +77,8 @@ qx.Class.define("osparc.user.UserDetails", {
7777 } ,
7878
7979 members : {
80+ __remainingUserData : null ,
81+
8082 _createChildControlImpl : function ( id ) {
8183 let control ;
8284 switch ( id ) {
@@ -97,6 +99,7 @@ qx.Class.define("osparc.user.UserDetails", {
9799 break ;
98100 case "top-info" : {
99101 const grid = new qx . ui . layout . Grid ( 10 , 6 ) ;
102+ grid . setColumnWidth ( 0 , 80 ) ;
100103 grid . setColumnFlex ( 1 , 1 ) ;
101104 grid . setColumnAlign ( 0 , "right" , "middle" ) ;
102105 control = new qx . ui . container . Composite ( grid ) ;
@@ -107,6 +110,7 @@ qx.Class.define("osparc.user.UserDetails", {
107110 }
108111 case "middle-info" : {
109112 const grid = new qx . ui . layout . Grid ( 10 , 6 ) ;
113+ grid . setColumnWidth ( 0 , 80 ) ;
110114 grid . setColumnFlex ( 1 , 1 ) ;
111115 grid . setColumnAlign ( 0 , "right" , "middle" ) ;
112116 control = new qx . ui . container . Composite ( grid ) ;
@@ -251,14 +255,16 @@ qx.Class.define("osparc.user.UserDetails", {
251255 column : 1
252256 } ) ;
253257 break ;
254- case "extra-info" :
255- control = new osparc . ui . basic . JsonTreeWidget ( ) ;
258+ case "extra-info" : {
259+ const divId = this . getUserGroupId ( ) + "_user_details" ;
260+ control = osparc . wrapper . JsonFormatter . getInstance ( ) . createContainer ( divId ) ;
256261 const container = new qx . ui . container . Scroll ( ) ;
257262 container . add ( control ) ;
258263 this . _add ( container , {
259264 flex : 1
260265 } ) ;
261266 break ;
267+ }
262268 }
263269 return control || this . base ( arguments , id ) ;
264270 } ,
@@ -279,11 +285,11 @@ qx.Class.define("osparc.user.UserDetails", {
279285 userData [ "userName" ] = "userName" ; // fix this
280286 const user = new osparc . data . model . User ( userData ) ;
281287 user . setContactData ( userData ) ;
282- this . setUser ( user ) ;
283288 // remove the displayed properties from the contact info
284289 Object . keys ( qx . util . PropertyUtil . getProperties ( osparc . data . model . User ) ) . forEach ( prop => delete userData [ prop ] ) ;
290+ this . __remainingUserData = userData ;
285291 console . log ( "Remaining User data" , userData ) ;
286- this . getChildControl ( "extra-info" ) . setJson ( userData ) ;
292+ this . setUser ( user ) ;
287293 }
288294 } )
289295 . catch ( err => {
@@ -295,8 +301,6 @@ qx.Class.define("osparc.user.UserDetails", {
295301 __applyUser : function ( user ) {
296302 this . setCaption ( user . getUserName ( ) ) ;
297303
298- this . getChildControl ( "thumbnail" ) . setSource ( user . createThumbnail ( this . self ( ) . THUMBNAIL_SIZE ) ) ;
299-
300304 // top grid
301305 this . getChildControl ( "userName" ) . setValue ( user . getUserName ( ) ) ;
302306 this . getChildControl ( "fullname" ) . setValue ( [ user . getFirstName ( ) , user . getLastName ( ) ] . filter ( Boolean ) . join ( " " ) ) ;
@@ -305,13 +309,23 @@ qx.Class.define("osparc.user.UserDetails", {
305309 this . getChildControl ( "user-id" ) . setValue ( String ( user . getUserId ( ) ) ) ;
306310 this . getChildControl ( "group-id" ) . setValue ( String ( user . getGroupId ( ) ) ) ;
307311
312+ this . getChildControl ( "thumbnail" ) . setSource ( user . createThumbnail ( this . self ( ) . THUMBNAIL_SIZE ) ) ;
313+
308314 // middle grid
309315 this . getChildControl ( "institution" ) . setValue ( user . getInstitution ( ) || "-" ) ;
310316 this . getChildControl ( "address" ) . setValue ( user . getAddress ( ) || "-" ) ;
311317 this . getChildControl ( "city" ) . setValue ( user . getCity ( ) || "-" ) ;
312318 this . getChildControl ( "state" ) . setValue ( user . getState ( ) || "-" ) ;
313319 this . getChildControl ( "country" ) . setValue ( user . getCountry ( ) || "-" ) ;
314320 this . getChildControl ( "postal-code" ) . setValue ( user . getPostalCode ( ) || "-" ) ;
321+
322+ this . getChildControl ( "extra-info" ) ;
323+ setTimeout ( ( ) => this . __setExtraInfo ( ) , 100 ) ;
324+ } ,
325+
326+ __setExtraInfo : function ( ) {
327+ const divId = this . getUserGroupId ( ) + "_user_details" ;
328+ osparc . wrapper . JsonFormatter . getInstance ( ) . setJson ( this . __remainingUserData , divId ) ;
315329 } ,
316330 }
317331} ) ;
0 commit comments