Skip to content

Render null if no field is matched with the given schema #981

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

Merged
merged 2 commits into from
Jun 11, 2018
Merged

Render null if no field is matched with the given schema #981

merged 2 commits into from
Jun 11, 2018

Conversation

AhmetTanakol
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented May 23, 2018

Coverage Status

Coverage increased (+0.3%) to 88.027% when pulling e8a7e45 on AhmetTanakol:applicable-field into 587e744 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, please check comment

@@ -69,23 +72,28 @@ export class MaterialInputControl extends Control<ControlProps, ControlState> {
};

const showDescription = !isDescriptionHidden(visible, description, this.state.isFocused);
const field = _.maxBy(fields, r => r.tester(uischema, schema));
if (field === undefined || field.tester(uischema, schema) === NOT_APPLICABLE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I think this isn't a very common scenario, so I asked myself whether we should a console.warn here, otherwise this might get hard to debug. What do you think (would also apply to other control renderers)?

@AhmetTanakol
Copy link
Contributor Author

updated

@edgarmueller edgarmueller merged commit 3289342 into eclipsesource:master Jun 11, 2018
@edgarmueller edgarmueller added this to the 2.0.2 milestone Jun 15, 2018
@AhmetTanakol AhmetTanakol deleted the applicable-field branch June 20, 2018 08:31
eneufeld pushed a commit to eneufeld/jsonforms that referenced this pull request Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants