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

Submission errors #366

Merged
merged 2 commits into from
Jan 30, 2021
Merged

Conversation

alanpoulain
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tickets N/A
License MIT
Doc PR TODO

When submitting a form (create or edit), submission errors (errors returned by the server) will be automatically displayed for the corresponding field.

It uses marmelab/react-admin#5778 and therefore will be only available for react-admin >= 3.12.

Validation errors don't follow a RFC or a convention, so it will only work if API Platform is used as the backend.
For other backends, the schemaAnayzer getSubmissionErrors method needs to be changed to map the submission errors correctly.

An external library (final-form-submit-errors) is also used by default to clear the submit error when the related form field is changed.

This PR also adds missing props SimpleForm and Datagrid in guessers.

@alanpoulain alanpoulain force-pushed the feat/submission-errors branch from e90832f to 437fbf0 Compare January 30, 2021 16:40
@alanpoulain alanpoulain merged commit bc4141a into api-platform:main Jan 30, 2021
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.

1 participant