File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
services/static-webserver/client/source/class/osparc
desktop/preferences/pages Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ qx.Class.define("osparc.data.model.Tag", {
3232 tagId : tagData . id ,
3333 name : tagData . name ,
3434 description : tagData . description ,
35+ color : tagData . color ,
3536 accessRights : tagData . accessRights ,
3637 } ) ;
3738 } ,
@@ -53,7 +54,7 @@ qx.Class.define("osparc.data.model.Tag", {
5354
5455 description : {
5556 check : "String" ,
56- nullable : false ,
57+ nullable : true ,
5758 init : null ,
5859 event : "changeDescription"
5960 } ,
Original file line number Diff line number Diff line change @@ -50,7 +50,12 @@ qx.Class.define("osparc.desktop.preferences.pages.TagsPage", {
5050 osparc . utils . Utils . setIdToWidget ( this . __addTagButton , "addTagBtn" ) ;
5151 osparc . data . Resources . get ( "tags" )
5252 . then ( tags => {
53- this . __tagItems = tags . map ( tag => new osparc . form . tag . TagItem ( ) . set ( { ...tag } ) ) ;
53+ this . __tagItems = tags . map ( tagData => {
54+ const tag = new osparc . data . model . Tag ( tagData ) ;
55+ return new osparc . form . tag . TagItem ( ) . set ( {
56+ tag
57+ } ) ;
58+ } ) ;
5459 this . __renderLayout ( ) ;
5560 this . __attachEventHandlers ( ) ;
5661 } )
Original file line number Diff line number Diff line change @@ -26,6 +26,14 @@ qx.Class.define("osparc.form.tag.TagItem", {
2626 } ,
2727
2828 properties : {
29+ tag : {
30+ check : "osparc.data.model.Tag" ,
31+ nullable : false ,
32+ init : null ,
33+ event : "changeTag" ,
34+ apply : "__applyTag" ,
35+ } ,
36+
2937 id : {
3038 check : "Integer"
3139 } ,
@@ -158,6 +166,14 @@ qx.Class.define("osparc.form.tag.TagItem", {
158166 return control || this . base ( arguments , id ) ;
159167 } ,
160168
169+ __applyTag : function ( tag ) {
170+ tag . bind ( "tagId" , this , "id" ) ;
171+ tag . bind ( "name" , this , "name" ) ;
172+ tag . bind ( "description" , this , "description" ) ;
173+ tag . bind ( "color" , this , "color" ) ;
174+ tag . bind ( "accessRights" , this , "accessRights" ) ;
175+ } ,
176+
161177 /**
162178 * Renders this tag item from scratch.
163179 */
You can’t perform that action at this time.
0 commit comments