File tree Expand file tree Collapse file tree 1 file changed +85
-0
lines changed
services/static-webserver/client/source/class/osparc/data/model Expand file tree Collapse file tree 1 file changed +85
-0
lines changed Original file line number Diff line number Diff line change 1+ /* ************************************************************************
2+
3+ osparc - the simcore frontend
4+
5+ https://osparc.io
6+
7+ Copyright:
8+ 2024 IT'IS Foundation, https://itis.swiss
9+
10+ License:
11+ MIT: https://opensource.org/licenses/MIT
12+
13+ Authors:
14+ * Odei Maiz (odeimaiz)
15+
16+ ************************************************************************ */
17+
18+ /**
19+ * Class that stores Tag data.
20+ */
21+
22+ qx . Class . define ( "osparc.data.model.Tag" , {
23+ extend : qx . core . Object ,
24+
25+ /**
26+ * @param tagData {Object} Object containing the serialized Tag Data
27+ */
28+ construct : function ( tagData ) {
29+ this . base ( arguments ) ;
30+
31+ this . set ( {
32+ tagId : tagData . id ,
33+ name : tagData . name ,
34+ description : tagData . description ,
35+ accessRights : tagData . accessRights ,
36+ } ) ;
37+ } ,
38+
39+ properties : {
40+ tagId : {
41+ check : "Number" ,
42+ nullable : true ,
43+ init : null ,
44+ event : "changeTagId"
45+ } ,
46+
47+ name : {
48+ check : "String" ,
49+ nullable : false ,
50+ init : null ,
51+ event : "changeName"
52+ } ,
53+
54+ description : {
55+ check : "String" ,
56+ nullable : false ,
57+ init : null ,
58+ event : "changeDescription"
59+ } ,
60+
61+ color : {
62+ check : "Color" ,
63+ event : "changeColor" ,
64+ init : "#303030"
65+ } ,
66+
67+ accessRights : {
68+ check : "Object" ,
69+ nullable : false ,
70+ init : null ,
71+ event : "changeAccessRights"
72+ } ,
73+ } ,
74+
75+ members : {
76+ serialize : function ( ) {
77+ const jsonObject = { } ;
78+ const propertyKeys = this . self ( ) . getProperties ( ) ;
79+ propertyKeys . forEach ( key => {
80+ jsonObject [ key ] = this . get ( key ) ;
81+ } ) ;
82+ return jsonObject ;
83+ }
84+ }
85+ } ) ;
You can’t perform that action at this time.
0 commit comments