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

Epic in-progress: validation overhaul for registration form #9198

Conversation

rebecca-shoptaw
Copy link
Collaborator

@rebecca-shoptaw rebecca-shoptaw commented Apr 30, 2024

Feature/refactor. Adds extensive pre-submit validation to the registration form, showing error messages and preventing submission in the event of badly formatted or already-taken entries.

Note: Several of the tasks for this project are distributed among different issues, as noted in the checklist below, but the full project overview/checklist will be maintained here for simplicity.

Full Project Checklist

Required form behavior / tasks

Other Requirements

  • We need to communicate that screen name is public
    • Already done, if a little inelegantly
  • Clicking submit/pressing enter, any empty fields will be highlighted red, and the error text next to the field will say “This field is required”
    • Fixed in this project branch via built-in HTML required attribute

Fun possibilities

  • Generate username suggestions using the existing function that appends digits in the backend
  • Disable submit button until all inputs are entered
  • Do some kind of animation then check mark or x to indicate whether username is available (a very common and nice thing in forms)
  • Move formatting checks out of account.py API endpoint and into realtime_account_validation.js to avoid unnecessary API calls

Technical

To avoid duplication and merge conflicts, the current changes in this branch are limited to:

  1. Adding HTML validation to prevent bad form submission (via extra attributes in forms.py and a new class in form.py)
  2. Adding email spamchecks currently only used after form submission to the pre-submission checks (so that, for instance, an error message will show if an email provider is not recognized)

Testing

Testing is currently (mostly) blocked by #9190, which will fix the realtime error-rendering bug.
In the meantime, the HTML validation can still be tested like so:

  1. Log out (if logged in)
  2. Go to the sign up page
  3. Enter a badly formatted email address, password or screenname, or leave one of the inputs empty
  4. Attempt to submit the form -- you should get an error message and be unable to submit

Screenshot

[To be added]

Stakeholders

@cdrini

@rebecca-shoptaw
Copy link
Collaborator Author

Transferring task list to #7694 and fixes to separate sub-issues.

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