Hi,
With react using the ratings example I am trying to render it when array selection is ‘selection_2’ however it is always showing. The default renderer of string works as expected and shows with selection of ‘selection_1’. Any ideas?
Schema
{
"type": "object",
"properties": {
"content_name": {
"type": "string",
"minLength": 3
},
"selection": {
"type": "string",
"title": "Select your option",
"oneOf": [
{
"const": "selection_1",
"title": "selection 1 show only string"
},
{
"const": "selection_2",
"title": "selection 2 show only rating"
}
]
},
"some-string": {
"type": "string"
},
"some-rating": {
"type": "integer"
}
},
"additionalProperties": true,
"required": [
"content_name"
]
}
uiSchema
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/content_name"
},
{
"type": "Control",
"scope": "#/properties/selection"
},
{
"type": "Control",
"scope": "#/properties/some-string",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/selection",
"schema": {
"enum": [
"selection_1"
]
}
}
}
},
{
"type": "Control",
"scope": "#/properties/some-rating",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/selection",
"schema": {
"enum": [
"selection_2"
]
}
}
}
}
]
}
Tester
import { rankWith, scopeEndsWith } from '@jsonforms/core';
export default rankWith(
3, // Increase rank as needed
scopeEndsWith('rating')
);