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

[#5039] Fix email registration errors #5098

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Feb 11, 2025

Closes #5039

Changes

  • Email registration used nonField errors for a combination of fields and these were not shown on the frontend. Fixed these by showing them on the top of the modal.

Checklist

Check off the items that are completed or not relevant.

  • Impact on features

    • Checked copying a form
    • Checked import/export of a form
    • Config checks in the configuration overview admin page
    • Problem detection in the admin email digest is handled
  • Release management

    • I have labelled the PR as "needs-backport" accordingly
  • I have updated the translations assets (you do NOT need to provide translations)

    • Ran ./bin/makemessages_js.sh
    • Ran ./bin/compilemessages_js.sh
  • Dockerfile/scripts

    • Updated the Dockerfile with the necessary scripts from the ./bin folder
  • Commit hygiene

    • Commit messages refer to the relevant Github issue
    • Commit messages explain the "why" of change, not the how

@vaszig vaszig added the needs-backport Fix must be backported to stable release branch label Feb 11, 2025
@vaszig vaszig force-pushed the fix/5039-not-showing-errors-in-email-registration branch from 216c18b to 3ebd8a0 Compare February 11, 2025 07:28
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.73%. Comparing base (2ff785d) to head (791b5d8).
Report is 26 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5098      +/-   ##
==========================================
- Coverage   96.74%   96.73%   -0.02%     
==========================================
  Files         771      774       +3     
  Lines       26636    26657      +21     
  Branches     3467     3468       +1     
==========================================
+ Hits        25770    25787      +17     
- Misses        605      608       +3     
- Partials      261      262       +1     

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

@vaszig vaszig marked this pull request as draft February 11, 2025 09:38
@vaszig vaszig force-pushed the fix/5039-not-showing-errors-in-email-registration branch from 3ebd8a0 to 791b5d8 Compare February 19, 2025 09:30
@vaszig vaszig marked this pull request as ready for review February 19, 2025 09:30
Copy link
Contributor

@viktorvanwijk viktorvanwijk left a comment

Choose a reason for hiding this comment

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

Works as expected :). As you already pointed out, though, might be nice if there is a solution which will work for all option forms, not only this plugin.

return (
<ValidationErrorsProvider errors={relevantErrors}>
{nonFieldErrors && (
<>
{nonFieldErrors.map(([_, message], index) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

index doesn't seem to be used. Is there a reason you included it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I had included this because I thought I would use it for the key, I can remove it.

Copy link
Member

Choose a reason for hiding this comment

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

you still need to provide a key though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you mean?We do not use anywhere a key for the ErrorMessage component that's why I didn't. I thought that this is needed for lists.

Copy link
Member

Choose a reason for hiding this comment

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

whenever you array.map(foo => <component />), the component must get the key. See https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-backport Fix must be backported to stable release branch
Projects
None yet
3 participants