diff --git a/src/components/JsonFormsDemo.tsx b/src/components/JsonFormsDemo.tsx index a8c8d7f..df45ef9 100644 --- a/src/components/JsonFormsDemo.tsx +++ b/src/components/JsonFormsDemo.tsx @@ -7,8 +7,8 @@ import { materialCells, materialRenderers, } from '@jsonforms/material-renderers'; -import RatingControl from './RatingControl'; -import ratingControlTester from '../ratingControlTester'; +//import RatingControl from './RatingControl'; +//import ratingControlTester from '../ratingControlTester'; import schema from '../schema.json'; import uischema from '../uischema.json'; @@ -41,16 +41,12 @@ const classes = { const initialData = { name: 'Send email to Adrian', description: 'Confirm if you have passed the subject\nHereby ...', - done: true, - recurrence: 'Daily', - rating: 3, }; const renderers = [ ...materialRenderers, //register custom renderers - { tester: ratingControlTester, renderer: RatingControl }, -]; + ]; export const JsonFormsDemo: FC = () => { const [data, setData] = useState(initialData); diff --git a/src/schema.json b/src/schema.json index 68c5e37..37a27d9 100644 --- a/src/schema.json +++ b/src/schema.json @@ -4,28 +4,6 @@ "name": { "type": "string", "minLength": 1 - }, - "description": { - "title": "Long Description", - "type": "string" - }, - "done": { - "type": "boolean" - }, - "due_date": { - "type": "string", - "format": "date" - }, - "rating": { - "type": "integer", - "maximum": 5 - }, - "recurrence": { - "type": "string", - "enum": ["Never", "Daily", "Weekly", "Monthly"] - }, - "recurrence_interval": { - "type": "integer" } }, "required": ["name", "due_date"] diff --git a/src/uischema.json b/src/uischema.json index 9e57a63..b6e13e6 100644 --- a/src/uischema.json +++ b/src/uischema.json @@ -1,55 +1,9 @@ { "type": "VerticalLayout", "elements": [ - { - "type": "Control", - "label": "Completed", - "scope": "#/properties/done" - }, { "type": "Control", "scope": "#/properties/name" - }, - { - "type": "HorizontalLayout", - "elements": [ - { - "type": "Control", - "scope": "#/properties/due_date" - }, - { - "type": "Control", - "scope": "#/properties/rating" - } - ] - }, - { - "type": "HorizontalLayout", - "elements": [ - { - "type": "Control", - "scope": "#/properties/recurrence" - }, - { - "type": "Control", - "scope": "#/properties/recurrence_interval", - "rule": { - "effect": "HIDE", - "condition": { - "type": "LEAF", - "scope": "#/properties/recurrence", - "expectedValue": "Never" - } - } - } - ] - }, - { - "type": "Control", - "scope": "#/properties/description", - "options": { - "multi": true - } } ] }