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

Display backend validation errors when submitting the form #792

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

sergei-maertens
Copy link
Member

Closes open-formulieren/open-forms#4510 - requires the backend PR to be merged as that changes the API endpoint used here.

I've opted to collect all the errors at the top and group them by step, rather than trying to weave this in the summary table. User research from Utrecht showed that this was the best way to show validation errors.

Ideally, there would be some aria-describedby options, but that requires a lot more work to link everything together.

Copy link

codecov bot commented Feb 4, 2025

Bundle Report

Changes will increase total bundle size by 6.18kB (0.06%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@open-formulieren/sdk-OpenForms-umd 4.78MB 3.12kB (0.07%) ⬆️
@open-formulieren/sdk-esm 4.75MB 3.07kB (0.06%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @open-formulieren/sdk-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/sdk-*.js 2.03kB 1.01MB 0.2%
assets/nl-*.js 518 bytes 23.36kB 2.27%
assets/en-*.js 518 bytes 22.5kB 2.36%

Files in assets/sdk-*.js:

  • ./src/components/FormProgressIndicator.jsx → Total Size: 2.8kB

  • ./src/components/Summary/ValidationErrors.jsx → Total Size: 3.75kB

  • ./src/components/Form.jsx → Total Size: 2.81kB

  • ./src/components/Summary/GenericSummary.jsx → Total Size: 3.19kB

  • ./src/components/Summary/SubmissionSummary.jsx → Total Size: 3.76kB

Files in assets/nl-*.js:

  • ./src/i18n/compiled/nl.json → Total Size: 25.75kB

Files in assets/en-*.js:

  • ./src/i18n/compiled/en.json → Total Size: 24.88kB
view changes for bundle: @open-formulieren/sdk-OpenForms-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
open-*.js 3.12kB 3.49MB 0.09%

Files in open-*.js:

  • ./src/components/Summary/GenericSummary.jsx → Total Size: 3.19kB

  • ./src/i18n/compiled/en.json → Total Size: 26.91kB

  • ./src/components/Summary/ValidationErrors.jsx → Total Size: 3.75kB

  • ./src/components/Summary/SubmissionSummary.jsx → Total Size: 3.76kB

  • ./src/components/Form.jsx → Total Size: 2.81kB

  • ./src/i18n/compiled/nl.json → Total Size: 25.75kB

  • ./src/components/FormProgressIndicator.jsx → Total Size: 2.8kB

I've opted to collect all the errors at the top and group them by step,
rather than trying to weave this in the summary table. User research
from Utrecht showed that this was the best way to show validation
errors.

Ideally, there would be some aria-describedby options, but that requires
a lot more work to link everything together.
@sergei-maertens sergei-maertens force-pushed the issue/4510-proper-validation-error-display branch from 1355641 to 8a9df63 Compare February 4, 2025 17:19
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 87.17949% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.88%. Comparing base (775bb98) to head (483b4dd).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/components/Summary/SubmissionSummary.jsx 70.00% 3 Missing ⚠️
src/components/Summary/ValidationErrors.jsx 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #792      +/-   ##
==========================================
+ Coverage   83.67%   83.88%   +0.20%     
==========================================
  Files         244      245       +1     
  Lines        4777     4808      +31     
  Branches     1268     1272       +4     
==========================================
+ Hits         3997     4033      +36     
  Misses        747      747              
+ Partials       33       28       -5     
Flag Coverage Δ
storybook 77.48% <91.66%> (+1.23%) ⬆️
vitest 62.70% <32.35%> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sergei-maertens sergei-maertens marked this pull request as ready for review February 4, 2025 17:26
Copy link
Contributor

@vaszig vaszig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing to add/mention!

@sergei-maertens sergei-maertens merged commit c1f7d7e into main Feb 5, 2025
15 of 17 checks passed
@sergei-maertens sergei-maertens deleted the issue/4510-proper-validation-error-display branch February 5, 2025 12:06
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.

it's possible to navigate to the next step under certain conditions, causing validation errors on submit.
2 participants