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

pc/modals: Validate phone and email even when they're optional #2308

Merged
merged 1 commit into from
Jan 24, 2023

Conversation

ssangervasi
Copy link
Contributor

@ssangervasi ssangervasi commented Jan 20, 2023

Closes #2220

Code Changes

  • Extracted Yup conditionals to a helper module.
  • Gave the fields validation rules, but are explicitly optional when they should be.
  • Cypress test.

Steps to Confirm

  • "required" inputs should behave as before
  • "optional" inputs should be require a valid format if they're filled, or be left blank.
    • The only invalid input that the phone field accepted seemed to be really long (>15 char) digits.

Pre-Merge Checklist

Description Of Changes

With the default config, phone is optional but it's been input with too many digits:
long-phon

@ssangervasi ssangervasi force-pushed the ssangervasi/fides/2220/pc-phone-verif branch from 6aa9a53 to a1e71c7 Compare January 24, 2023 18:29
@ssangervasi ssangervasi merged commit e84a79d into main Jan 24, 2023
@ssangervasi ssangervasi deleted the ssangervasi/fides/2220/pc-phone-verif branch January 24, 2023 18:30
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.

Phone Number Format not validated on Front End
3 participants