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

Add FieldErrorTemplate and FieldHelpTemplate #3104

Closed
1 task done
heath-freenome opened this issue Sep 9, 2022 · 1 comment · Fixed by #3109
Closed
1 task done

Add FieldErrorTemplate and FieldHelpTemplate #3104

heath-freenome opened this issue Sep 9, 2022 · 1 comment · Fixed by #3109
Assignees
Labels
feature Is a feature request

Comments

@heath-freenome
Copy link
Member

heath-freenome commented Sep 9, 2022

Prerequisites

What theme are you using?

core

Is your feature request related to a problem? Please describe.

The ErrorList and Help components are hidden inside of the SchemaField implementation and really need to be exported as new templates so that users (and themes) can customise them.

Describe the solution you'd like

Add two new templates by refactoring the components out of SchemaField in core. This will required adding new types for the templates and adding them to the TemplatesType in utils.

Describe alternatives you've considered

No response

@heath-freenome heath-freenome added needs triage Initial label given, to be assigned correct labels and assigned feature Is a feature request labels Sep 9, 2022
@heath-freenome heath-freenome removed the needs triage Initial label given, to be assigned correct labels and assigned label Sep 9, 2022
@heath-freenome
Copy link
Member Author

@epicfaace @nickgros @jacqueswho I hopefully will get to this within a week

heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 12, 2022
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 12, 2022
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 12, 2022
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 12, 2022
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates
heath-freenome added a commit that referenced this issue Sep 12, 2022
* fix: #3104 by adding new templates
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates

* - Added concurrency to build to (hopefully) avoid javascript memory issues on the server

* - Added tests for the help and error display given the new capabilities
- Also, removed the `tagName` from the `schema examples` since it was not really needed

* - Responded to reviewer feedback

* - Added `NODE_OPTIONS` to both build scripts in `ci.yml` not just one

* - Fix array tests
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 13, 2022
- Updated the `FieldHelpProps` to add an optional `hasErrors` boolean flag needed by bootstrap-4
- In `antd`, refactored the `FieldErrorTemplate` out of the `FieldTemplate`
  - Updated the `templates` to add in the new `FieldErrorTemplate`
- In `bootstrap-4`, `chakra-ui`, `fluent-ui`, `material-ui` and `mui` refactored the `FieldErrorTemplate` and `FieldHelpTemplate` out of the `FieldTemplate`
  - In some cases, added a missing `id` for one or both of the new templates
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for those tests where missing `id`s were added
- In `semantic-ui`, renamed the `RawErrors` and `HelpField` to `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated both of those components to use the new properties from the interfaces and to render ids where appropriate
  - Changed `FieldTemplate` to simply render `errors` and `help` now that the templates are used
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for tests where missing `id`s were added
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 13, 2022
- Updated the `FieldHelpProps` to add an optional `hasErrors` boolean flag needed by bootstrap-4
- In `antd`, refactored the `FieldErrorTemplate` out of the `FieldTemplate`
  - Updated the `templates` to add in the new `FieldErrorTemplate`
- In `bootstrap-4`, `chakra-ui`, `fluent-ui`, `material-ui` and `mui` refactored the `FieldErrorTemplate` and `FieldHelpTemplate` out of the `FieldTemplate`
  - In some cases, added a missing `id` for one or both of the new templates
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for those tests where missing `id`s were added
- In `semantic-ui`, renamed the `RawErrors` and `HelpField` to `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated both of those components to use the new properties from the interfaces and to render ids where appropriate
  - Changed `FieldTemplate` to simply render `errors` and `help` now that the templates are used
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for tests where missing `id`s were added
- Updated the `CHANGELOG` accordingly
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 13, 2022
- Updated the `FieldHelpProps` to add an optional `hasErrors` boolean flag needed by bootstrap-4
- In `antd`, refactored the `FieldErrorTemplate` out of the `FieldTemplate`
  - Updated the `templates` to add in the new `FieldErrorTemplate`
- In `bootstrap-4`, `chakra-ui`, `fluent-ui`, `material-ui` and `mui` refactored the `FieldErrorTemplate` and `FieldHelpTemplate` out of the `FieldTemplate`
  - In some cases, added a missing `id` for one or both of the new templates
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for those tests where missing `id`s were added
- In `semantic-ui`, renamed the `RawErrors` and `HelpField` to `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated both of those components to use the new properties from the interfaces and to render ids where appropriate
  - Changed `FieldTemplate` to simply render `errors` and `help` now that the templates are used
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for tests where missing `id`s were added
- Updated the `CHANGELOG` accordingly
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Sep 13, 2022
- Updated the `FieldHelpProps` to add an optional `hasErrors` boolean flag needed by bootstrap-4
- In `antd`, refactored the `FieldErrorTemplate` out of the `FieldTemplate`
  - Updated the `templates` to add in the new `FieldErrorTemplate`
- In `bootstrap-4`, `chakra-ui`, `fluent-ui`, `material-ui` and `mui` refactored the `FieldErrorTemplate` and `FieldHelpTemplate` out of the `FieldTemplate`
  - In some cases, added a missing `id` for one or both of the new templates
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for those tests where missing `id`s were added
- In `semantic-ui`, renamed the `RawErrors` and `HelpField` to `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated both of those components to use the new properties from the interfaces and to render ids where appropriate
  - Changed `FieldTemplate` to simply render `errors` and `help` now that the templates are used
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for tests where missing `id`s were added
- Updated the `CHANGELOG` accordingly
heath-freenome added a commit that referenced this issue Sep 13, 2022
- Updated the `FieldHelpProps` to add an optional `hasErrors` boolean flag needed by bootstrap-4
- In `antd`, refactored the `FieldErrorTemplate` out of the `FieldTemplate`
  - Updated the `templates` to add in the new `FieldErrorTemplate`
- In `bootstrap-4`, `chakra-ui`, `fluent-ui`, `material-ui` and `mui` refactored the `FieldErrorTemplate` and `FieldHelpTemplate` out of the `FieldTemplate`
  - In some cases, added a missing `id` for one or both of the new templates
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for those tests where missing `id`s were added
- In `semantic-ui`, renamed the `RawErrors` and `HelpField` to `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated both of those components to use the new properties from the interfaces and to render ids where appropriate
  - Changed `FieldTemplate` to simply render `errors` and `help` now that the templates are used
  - Updated the `templates` to add in the new `FieldErrorTemplate` and `FieldHelpTemplate`
  - Updated snapshots for tests where missing `id`s were added
- Updated the `CHANGELOG` accordingly
ranihorev pushed a commit to ranihorev/react-jsonschema-form that referenced this issue Sep 14, 2022
* fix: rjsf-team#3104 by adding new templates
- Updated the `CHANGELOG.md` appropriately
- Updated the documentation to discuss the new `ArraySchemaField` field and the `FieldErrorTemplate` and `FieldHelpTemplate` templates
- Updated `ArrayField` to get the new `ArraySchemaField` when rendering the `children` of an array item
- Updated `fields/index.ts` to add `ArraySchemaField` as `SchemaField`
- Refactored the `ErrorList` component from inside `SchemaField.tsx` as the new `FieldErrorTemplate`
- Refactored the `Help` component from inside `SchemaField.tsx` as the new `FieldHelpTemplate`
- Updated `SchemaField` to get the `FieldErrorTemplate` and `FieldHelpTemplate` from the `registry`/`uiOptions` using `getTemplate()`
  - Used these templates to render the `errors` and `help` components to the Field
- Updated the tests to verify the new `ArraySchemaField`, `FieldErrorTemplate` and `FieldHelpTemplate` implementations
- Updated the `types.ts` in the `utils` package to add new `FieldErrorProps` and `FieldHelpProps` as well as `FieldErrorTemplate` and `FieldHelpTemplate` to the `TemplatesType`
- Updated the `getTemplates()` tests to add the two new templates

* - Added concurrency to build to (hopefully) avoid javascript memory issues on the server

* - Added tests for the help and error display given the new capabilities
- Also, removed the `tagName` from the `schema examples` since it was not really needed

* - Responded to reviewer feedback

* - Added `NODE_OPTIONS` to both build scripts in `ci.yml` not just one

* - Fix array tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants