This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: phone input validation component (2699) #2725
Closed
marcoboncoraglio
wants to merge
47
commits into
HospitalRun:master
from
marcoboncoraglio:2699-PhoneInputValidationComponent
Closed
fix: phone input validation component (2699) #2725
marcoboncoraglio
wants to merge
47
commits into
HospitalRun:master
from
marcoboncoraglio:2699-PhoneInputValidationComponent
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/ACJXvtzvQskEz5dyrUzouHZuD8Ke |
marcoboncoraglio
changed the title
2699 phone input validation component
fix - 2699: phone input validation component
Aug 18, 2021
expect(phoneNumberField).toHaveProperty('id', 'phoneNumber0TextInput') | ||
typeWritableAssertion(phoneNumberField, patient.phoneNumbers[0].value) | ||
expect(phoneNumberField).toHaveProperty('id', 'phoneNumber0IntlTelPicker') | ||
// typeWritableAssertion(phoneNumberField, patient.phoneNumbers[0].value) // Haven't been able to get testing-library working with telpicker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out a test case
marcoboncoraglio
changed the title
fix - 2699: phone input validation component
fix: phone input validation component (2699)
Aug 19, 2021
matteovivona
added
the
in progress
indicates that issue/pull request is currently being worked on
label
Oct 2, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #2699
Changes proposed in this pull request:
Add component for phone number validation taking the country into account
Newly added dependencies with Bundlephobia links:
react-intl-tel-input:
https://github.com/patw0929/react-intl-tel-input
https://bundlephobia.com/package/[email protected]
Notes:
There are a few things missing that I was not able to complete/get working as intended.
Error handling: I had to write my own css to get error messages to show with this new component since we aren't using the native TextInput component to handle the error. Also the way the errors are handled might not be ideal as the added library is made to validate the input in the component itself (compared to doing that centrally after setting the patient object in the redux store) - make sure to run it locally to make sure it all makes sense to you.
I wasn't able to get testing-framework to write into the input of this new component, so the test that assures that the component is editable fails.