Skip to content

Commit 0fd8fda

Browse files
committed
tag property
1 parent 95f14de commit 0fd8fda

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

services/static-webserver/client/source/class/osparc/data/model/Tag.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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
},

services/static-webserver/client/source/class/osparc/desktop/preferences/pages/TagsPage.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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
})

services/static-webserver/client/source/class/osparc/form/tag/TagItem.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff 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
*/

0 commit comments

Comments
 (0)