Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/components/JsonFormsDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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<object>(initialData);
Expand Down
22 changes: 0 additions & 22 deletions src/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
46 changes: 0 additions & 46 deletions src/uischema.json
Original file line number Diff line number Diff line change
@@ -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
}
}
]
}