-
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
Vue: Disable ArrayListRenderer add if control.data.length exceeds or is equal to maxItems #2154
Vue: Disable ArrayListRenderer add if control.data.length exceeds or is equal to maxItems #2154
Conversation
✅ Deploy Preview for jsonforms-examples ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks for the contribution ❤️. Much appreciated.
Please check the comments and add tests for the new use case(s). Also the build must succeed, it seems the linter is complaining.
…nstead of control.rootschema, and referenced appliedOptions.restrict
Thanks for the feedback @sdirix. I have also implemented minItems checking on the delete button. I've left one comment on your review. But besides this it should be ready for re-evaluation |
Besides the Vuetify renderers (ListWithDetail, ArrayControlRenderer, AdditionalProperties, AnyOfStringOrEnumControlRenderer, MultiStringControlRenderer, PasswordControlRenderer, StringControlRenderer, StringMaskControlRenderer, ArrayLayoutRenderer), restrict is used in various string and number renderers, see MaterialAnyOfStringOrEnumControl, MuiInputNumberFormat, MuiInputText, NumberFormatCell, TextCell.
You can set it in each Ui Schema options, e.g.
Or globally via the config
|
@sdirix Thanks for the comments about the appliedOptions.restrict. I have added this to the control. I have also addressed your latest points |
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.
Thanks for the contribution ❤️
The included ArrayListRenderer in Vue-Vanilla would allow more items to be added to an array than the schema allowed.
This PR uses the maxItems value from the schema (if present) and disables the add button if the control.data array is an equal, or greater, length to the maxItems value in the schema