Reorganize JS for registration form and add loading indicator #9604
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.
Closes #9603.
Feature. Reorganizes registration validation js to add a loading indicator at the correct point in the validation process and remove the delay between submission and validation.
Technical
Fairly simple! Involved moving the recaptcha info to a div with
data-size="invisible"
per the recaptcha docs and adjusting the order of the JS checks.The original
grecaptcha.execute()
implementation was nested in a click handler rather than a submit handler, as the latter never actually fired, but I'm hoping that now that the recaptcha is no longer linked directly to the submit button a submit handler should work just fine.Testing
/account/create
Results of partial GitPod testing:
With the line
grecaptcha.execute()
replaced withsignupForm.submit()
since it doesn't work locally:✅ If all inputs are valid, the submit button becomes a loading indicator and then the page refreshes
✅ HTML errors appear immediately following submit button press, and the submit button does not become a loading indicator
Screenshot
Stakeholders
@cdrini