-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preselect with default schema values #1193 #1224
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we should probably add an example at some point.
- Adds options to createAjv. Clients that want to have preselected default values should pass in the 'useDefaults: true' option to the createAjv method and use the Ajv object in the Actions.init call.
ecd506b
to
8656a24
Compare
I rebased the branch on master and added tests |
8656a24
to
de3858d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good & works. We could improve the tests a bit, see review comments.
t.is(store.getState().jsonforms.core.data.color, 'green'); | ||
}); | ||
|
||
test('should assign defaults to array', t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better name would be "should assign defaults to newly added item within nested object of an array"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, changed the name.
createAjv
method . Clients that want to have preselecteddefault values should pass in the
useDefaults: true
option to thecreateAjv
method and use the Ajv object in theActions.init
call.