-
Notifications
You must be signed in to change notification settings - Fork 391
Add a failWhenUndefined option to the SchemaBasedCondition #2095
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
Add a failWhenUndefined option to the SchemaBasedCondition #2095
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for the contribution ❤️ I'll talk with the team in regards whether we prefer What I don't understand is your comment in the discussion board where the reverse effect and condition did not work for you, i.e.
Looking at the code here and the suggested improvements of |
I created some examples for the "range" rule and the "array contains" rule: https://github.com/clemens-msupply/jsonforms-react-seed/tree/rule-condition-with-undefined-values I reversed the rule by using "not" but it both behaves the same (dependent controls are showing on initial load). Is this what you meant? |
Heads up: We'll take a look at this again soon |
Co-authored-by: Stefan Dirix <sdirix@eclipsesource.com>
Hi there, I experienced the same issue here https://jsonforms.discourse.group/t/default-hide-for-array-contains-value-when-array-undefined/2152. Are there any updates on this? |
I answered in the community thread 👍 |
This PR adds an option to mark the scope of a rule condition as required.
The original proposed solution was to add:
whenUndefined: 'fail' | 'success'
but after understanding the problem a bit better I think the main problem is that you can't define the condition scope as required and adding this option keeps it a bit closer to JSONSchema.
I added a comment about my interpretation about whats happening in the code. Let me know what you think, I might be wrong about it and AJV just does something weird... I also still like
whenUndefined
since it might actually be more user friendly.Original discussion:
https://jsonforms.discourse.group/t/no-rule-validation-for-array-contains-value-when-array-undefined/1308/7