Skip to content
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

Merged
merged 3 commits into from
Jan 23, 2019

Conversation

AlexandraBuzila
Copy link
Member

  • Adds options to createAjv method . 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.

@coveralls
Copy link

coveralls commented Jan 14, 2019

Coverage Status

Coverage decreased (-0.3%) to 88.155% when pulling 7592526 on AlexandraBuzila:fix-1193 into b339754 on eclipsesource:master.

Copy link
Contributor

@edgarmueller edgarmueller left a 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.
@AlexandraBuzila
Copy link
Member Author

I rebased the branch on master and added tests

Copy link
Contributor

@edgarmueller edgarmueller left a 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.

packages/core/test/util/renderer.test.ts Outdated Show resolved Hide resolved
t.is(store.getState().jsonforms.core.data.color, 'green');
});

test('should assign defaults to array', t => {
Copy link
Contributor

@edgarmueller edgarmueller Jan 22, 2019

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"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, changed the name.

packages/core/test/util/renderer.test.ts Outdated Show resolved Hide resolved
@edgarmueller edgarmueller added this to the 2.2.0 milestone Jan 22, 2019
@edgarmueller edgarmueller removed the request for review from eneufeld January 22, 2019 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants