Fix / Generic consents validation message & show message after submission #551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I introduced a bug with this PR #537
Bug
After my change, the error message always showed up initially (before form submission) and I noticed that the
<CustomRegisterField />
can be used for all types of fields. In the situation I tested it with I have only seen checkboxes.Fix
I reused the already present (generic)
field_required
error message which equals the message "This field is required" without any specificity or guidance. It originally was "This field is required, please fill in {{field}} to continue.", but the field name can be "technical" such as "broadcaster_terms" which we considered an issue. We originally wanted the extra information (such as please fill in or check the box) to guide users, but keeping this intact for all types but this requires a lot of work and translation maintenance. In the end we think (and hope) the message is clear enough.I also wrote an e2e test to prevent the bug from happening.
Ticket: https://videodock.atlassian.net/browse/OTT-1928