Support for Enumerated Values in Entities
User Interface: 5.3.1-Ultimate
Within the attributes of an Entity, it will be possible to define enumerated values. This functionality allows us to define a set of values for attributes of type "string", "number" and "integer" (for example, to define options in a selector).
For these attributes to be enumerated, the value must be between one of these defined values.
When defining the schema of the Entity, it is defined as an "enum" type:
{
"properties": {
"name": {
"type": "string"
},
"surnames": {
"type": "string"
},
"gender": {
"type": "string",
"enum": [
"male",
"female",
"not specified"
]
},
"officecode": {
"type": "integer",
"enum": [
100,
101,
102,
200,
201,
202
]
},
"identifier": {
"type": "number"
}
}
}
When working with the Entity CRUD, a selector with the allowed types will be shown for these attributes:
In the CRUD Gadgets of the Dashboards, this will work the same way:
In addition, the case where the field is not required has been taken into account. For example, if the "gender" field is changed from required to optional:
After updating the schema of the Entity, it will be possible to verify that in the CRUD of the Entity the selector allows to choose an empty option.
This also occurs in the CRUD Gadget of the Dashboards.