-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Custom add button text per array in schema #3130
Labels
feature
Is a feature request
Comments
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Sep 22, 2022
- In `@rjsf/utils`, updated the `IconButtonProps` type to add `uiSchema` which required adding the `T` and `F` generics to it and the associated `ButtonTemplates` in `TemplatesType` - Also added `uiSchema` to the `ArrayFieldTemplateItemType` - In `@rjsf/core`, updated the `IconButton`-based components to pass `uiSchema` - Updated `ArrayField` to pass `uiSchema` to the `ArrayFieldTemplateItemType` creating in `renderArrayFieldItem()` - Updated `IconButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `antd`, `bootstrap-4`, `chakra-ui`, `material-ui`, `mui` and `semantic-ui` themes, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `fluent-ui` theme, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `ArrayFieldItemTemplate` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - Updated the `custom-templates.md` to add the `uiSchema` as a prop for `IconButtons` and `ArrayFieldItemTemplate` - Updated the `CHANGELOG.md` accordingly
8 tasks
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Sep 22, 2022
- In `@rjsf/utils`, updated the `IconButtonProps` type to add `uiSchema` which required adding the `T` and `F` generics to it and the associated `ButtonTemplates` in `TemplatesType` - Also added `uiSchema` to the `ArrayFieldTemplateItemType` - In `@rjsf/core`, updated the `IconButton`-based components to pass `uiSchema` - Updated `ArrayField` to pass `uiSchema` to the `ArrayFieldTemplateItemType` creating in `renderArrayFieldItem()` - Updated `IconButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `antd`, `bootstrap-4`, `chakra-ui`, `material-ui`, `mui` and `semantic-ui` themes, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `fluent-ui` theme, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `ArrayFieldItemTemplate` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - Updated the `custom-templates.md` to add the `uiSchema` as a prop for `IconButtons` and `ArrayFieldItemTemplate` - Updated the `CHANGELOG.md` accordingly
heath-freenome
added a commit
that referenced
this issue
Sep 22, 2022
- In `@rjsf/utils`, updated the `IconButtonProps` type to add `uiSchema` which required adding the `T` and `F` generics to it and the associated `ButtonTemplates` in `TemplatesType` - Also added `uiSchema` to the `ArrayFieldTemplateItemType` - In `@rjsf/core`, updated the `IconButton`-based components to pass `uiSchema` - Updated `ArrayField` to pass `uiSchema` to the `ArrayFieldTemplateItemType` creating in `renderArrayFieldItem()` - Updated `IconButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `antd`, `bootstrap-4`, `chakra-ui`, `material-ui`, `mui` and `semantic-ui` themes, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `FieldTemplate` to pass `uiSchema` to `WrapIfAdditional` - Updated `ArrayFieldItemTemplate` and `WrapIfAdditional` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - In the `fluent-ui` theme, updated the `IconButton`-based components to pass `uiSchema` - Updated `IconButton` and `AddButton` to strip out the `uiSchema` before passing props to the button - Updated `ArrayFieldItemTemplate` to take `uiSchema` and pass it to the icon buttons - Updated `ArrayFieldTemplate` and `ObjectFieldTemplate` to pass `uiSchema` to the icon buttons - Updated the `custom-templates.md` to add the `uiSchema` as a prop for `IconButtons` and `ArrayFieldItemTemplate` - Updated the `CHANGELOG.md` accordingly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
What theme are you using?
material-ui
Is your feature request related to a problem? Please describe.
The add item button used in the Array Field Template can only be customized globally, not per-field.
Describe the solution you'd like
Ability to either specify an AddButtonTemplate per field, or simply supplying the
uiOptions
as a prop to the AddButton used in the ArrayFieldTemplate (to support adding customui:something
properties per field, and using that ui option in a custom AddButton template)Describe alternatives you've considered
Currently have a custom ArrayFieldTemplate in my codebase that passes the
uiOptions
prop to the AddButtonThe text was updated successfully, but these errors were encountered: