File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
services/static-webserver/client/source/class/osparc Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ qx.Class.define("osparc.user.UserDetails", {
277277 user . setContactData ( userData ) ;
278278 // remove the displayed properties from the contact info
279279 Object . keys ( qx . util . PropertyUtil . getProperties ( osparc . data . model . User ) ) . forEach ( prop => delete userData [ prop ] ) ;
280- this . __remainingUserData = userData ;
280+ this . __remainingUserData = osparc . utils . Utils . convertKeysToTitles ( userData ) ;
281281 this . setUser ( user ) ;
282282 }
283283 } )
Original file line number Diff line number Diff line change @@ -1197,6 +1197,18 @@ qx.Class.define("osparc.utils.Utils", {
11971197 return str ;
11981198 } ,
11991199
1200+ camelToTitle : function ( str ) {
1201+ return str
1202+ . replace ( / ( [ A - Z ] ) / g, ' $1' ) // insert space before capital letters
1203+ . replace ( / ^ ./ , c => c . toUpperCase ( ) ) ; // capitalize first letter
1204+ } ,
1205+
1206+ convertKeysToTitles : function ( obj ) {
1207+ return Object . fromEntries (
1208+ Object . entries ( obj ) . map ( ( [ key , value ] ) => [ this . camelToTitle ( key ) , value ] )
1209+ ) ;
1210+ } ,
1211+
12001212 setIdToWidget : ( qWidget , id ) => {
12011213 if ( qWidget . getContentElement && qWidget . getContentElement ( ) && id ) {
12021214 qWidget . getContentElement ( ) . setAttribute ( "osparc-test-id" , id ) ;
You can’t perform that action at this time.
0 commit comments