-
Notifications
You must be signed in to change notification settings - Fork 347
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
Adds regex validation for PhoneNumberFormField
same as in backend and validate onBlur
instead of onSubmit
#5789
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
when, we start typing it, the error is showing, doesn't seem good, any other approach have in mind |
For validating on submit, we'll have to update everywhere it's used manually as it would become outside the scope of the reusable component. |
Isn't this better, user will be aware immediatley if it's wrong instead rather than waiting to submit and come back |
PhoneNumberFormField
PhoneNumberFormField
same as in backend and validate onBlur
instead of onSubmit
there is a bug in the field, that is why cypress is failing
|
👋 Hi, @rithviknishad, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@rithviknishad The page is crashing when opening advanced filters on User page. |
I've resolved the crash; not the issue #5846 |
@rithviknishad fix the cypress |
LGTM |
@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
…nd validate `onBlur` instead of `onSubmit` (#5789) * Adds custom as you type validation for `PhoneNumberFormField` * validation for support numbers * fix priority * validate onBlur * improved validation and formatting * skip formatting if country disabled * fix length * fix * fix cypress
WHAT
🤖 Generated by Copilot at 0f5f660
The pull request enhances the validation of phone number and email inputs in the form components. It refactors the
EmailValidator
function to use a genericRegexValidator
function and adds a newPhoneNumberValidator
function. It also modifies thePhoneNumberFormField
component to use the new validator and show error messages.Proposed Changes
PhoneNumberFormField
#5788@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 0f5f660
EmailValidator
function to use a genericRegexValidator
function and add new validators for phone numbers and email addresses (link)PhoneNumberFormField
component to import and use the newPhoneNumberValidator
function and theFieldError
type fromFieldValidators.tsx
(link)error
toPhoneNumberFormField
component to store and display the validation error message fromPhoneNumberValidator
(link, link)error
state to the parentFormField
component as part of thefield
prop to enable the validation logic and error handling (link)