Content-Length: 274278 | pFad | https://github.com/internetarchive/openlibrary/pull/9607

3C Replace jQuery `validate` in admin and support forms by rebecca-shoptaw · Pull Request #9607 · internetarchive/openlibrary · GitHub
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

Replace jQuery validate in admin and support forms #9607

Conversation

rebecca-shoptaw
Copy link
Collaborator

@rebecca-shoptaw rebecca-shoptaw commented Jul 22, 2024

Subtask of #9605.

Feature. Replaces jQuery validate required field and email validation with built-in HTML validation to improve performance, JS-disabled functionality, and internationalization.

Technical

Quite simple! Just removed the validate class (which triggers the plugin), and replaced each class="required" with the HTML required attribute and each class="email" with the HTML type="email" attribute.

Also involved some CSS fixes to keep input styling consistent, same fixes should hold for all relevant PRs.

Testing

  1. Go to one of the relevant forms, i.e. /contact
  2. Enter a badly formatted email and/or leave a required field blank, hit submit
  3. The submission should fail and you should see an HTML-native error message

Screenshot

Stakeholders

@cdrini

@rebecca-shoptaw rebecca-shoptaw marked this pull request as ready for review July 22, 2024 16:27
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.21%. Comparing base (ce16a79) to head (79cca8c).
Report is 39 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9607      +/-   ##
==========================================
+ Coverage   16.06%   16.21%   +0.15%     
==========================================
  Files          90       90              
  Lines        4769     4786      +17     
  Branches      832      829       -3     
==========================================
+ Hits          766      776      +10     
- Misses       3480     3486       +6     
- Partials      523      524       +1     

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

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Nice, lgtm! Tested the admin people page, and the /contact page, and both worked! Also tested the registration to make sure the type=email CSS didn't cause a css leak.

@cdrini cdrini self-assigned this Jul 22, 2024
@cdrini cdrini merged commit 800bcab into internetarchive:master Jul 22, 2024
5 checks passed
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.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/internetarchive/openlibrary/pull/9607

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy