-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for defining a details view on a table control (#725)
Adds support for providing an option `detail-uischema` which takes a UISchema and uses this as the detail view instead of a generated one
- Loading branch information
1 parent
5e03fe3
commit eda12a5
Showing
2 changed files
with
181 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,112 @@ | ||
export default angular.module('jsonforms-examples.array', []) | ||
.value('array.schema', | ||
{ | ||
'type': 'object', | ||
'properties': { | ||
'name': { | ||
'type': 'string' | ||
}, | ||
'vegetarian': { | ||
'type': 'boolean' | ||
}, | ||
'birthDate': { | ||
'type': 'string', | ||
'format': 'date-time' | ||
}, | ||
'nationality': { | ||
'type': 'string', | ||
'enum': ['DE', 'IT', 'JP', 'US', 'RU', 'Other'] | ||
}, | ||
'occupation': { | ||
'type': 'string' | ||
}, | ||
'comments': { | ||
'type': 'array', | ||
'items': { | ||
'type': 'object', | ||
'properties': { | ||
'date': { | ||
'type': 'string', | ||
'format': 'date-time' | ||
}, | ||
'message': { | ||
'type': 'string' | ||
} | ||
{ | ||
'type': 'object', | ||
'properties': { | ||
'name': { | ||
'type': 'string' | ||
}, | ||
'vegetarian': { | ||
'type': 'boolean' | ||
}, | ||
'birthDate': { | ||
'type': 'string', | ||
'format': 'date-time' | ||
}, | ||
'nationality': { | ||
'type': 'string', | ||
'enum': ['DE', 'IT', 'JP', 'US', 'RU', 'Other'] | ||
}, | ||
'occupation': { | ||
'type': 'string' | ||
}, | ||
'comments': { | ||
'type': 'array', | ||
'items': { | ||
'type': 'object', | ||
'properties': { | ||
'date': { | ||
'type': 'string', | ||
'format': 'date-time' | ||
}, | ||
'message': { | ||
'type': 'string' | ||
} | ||
} | ||
} | ||
}, | ||
'required': ['occupation', 'nationality'] | ||
} | ||
} | ||
}, | ||
'required': ['occupation', 'nationality'] | ||
} | ||
) | ||
.value('array.uischema', | ||
{ | ||
'type': 'VerticalLayout', | ||
'elements': [ | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/comments' | ||
}, | ||
'options': { | ||
'submit': true | ||
{ | ||
'type': 'VerticalLayout', | ||
'elements': [ | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/comments' | ||
}, | ||
'options': { | ||
'submit': true, | ||
'detail-uischema': { | ||
'type': 'Group', | ||
'label': 'MyGroup', | ||
'elements': [ | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/date' | ||
}, | ||
'rule': { | ||
'effect': 'HIDE', | ||
'condition': { | ||
'type': 'LEAF', | ||
'scope': { | ||
'$ref': '#/properties/message' | ||
}, | ||
'expectedValue': 'foo' | ||
} | ||
} | ||
}, | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/message' | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} | ||
) | ||
.value('array.uischema-simple', | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/comments' | ||
}, | ||
'label': 'Some more comments', | ||
'options': { | ||
'simple': true | ||
} | ||
{ | ||
'type': 'Control', | ||
'scope': { | ||
'$ref': '#/properties/comments' | ||
}, | ||
'label': 'Some more comments', | ||
'options': { | ||
'simple': true | ||
} | ||
} | ||
) | ||
.value('array.data', | ||
{ | ||
'comments': [ | ||
{ | ||
'date': new Date(), | ||
'message': 'This is an example message' | ||
}, | ||
{ | ||
'date': new Date(), | ||
'message': 'Get ready for booohay' | ||
} | ||
] | ||
} | ||
{ | ||
'comments': [ | ||
{ | ||
'date': new Date(), | ||
'message': 'This is an example message' | ||
}, | ||
{ | ||
'date': new Date(), | ||
'message': 'Get ready for booohay' | ||
} | ||
] | ||
} | ||
) | ||
.name; | ||
.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters