-
Notifications
You must be signed in to change notification settings - Fork 130
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
SX-2129 Edit phone number Circuit UI component #2512
SX-2129 Edit phone number Circuit UI component #2512
Conversation
Deployment failed with the following error:
View Documentation: https://vercel.com/docs/concepts/teams/roles-and-permissions |
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/phone-number-input #2512 +/- ##
==============================================================
- Coverage 97.15% 87.85% -9.31%
==============================================================
Files 251 200 -51
Lines 19894 21684 +1790
Branches 1226 1313 +87
==============================================================
- Hits 19329 19050 -279
- Misses 551 2582 +2031
- Partials 14 52 +38
|
c2fd1d7
to
6270879
Compare
6270879
to
70ca37c
Compare
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.ts
Outdated
Show resolved
Hide resolved
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.
Thank you for finishing the component and especially for writing such detailed docs. Great job! 🌟
I don't see any logic to handle pasting of a (full) phone number. Have you tested how the component could/would handle this?
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.module.css
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.module.css
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInputService.spec.ts
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.mdx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.mdx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.stories.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.tsx
Outdated
Show resolved
Hide resolved
…ut.tsx Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
…utService.spec.ts Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
…ut.mdx Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
…ut.mdx Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
…circuit-ui-component' into SX-2129-fe-db-edit-phone-number-circuit-ui-component
At the moment we don't handle this scenario (meaning the entire phone number will be pasted in the subscriber number field), the question is: how do we want to handle it? Stripping it and setting the country code and subscriber number values looks error prone in this case because those can have different lengths and it's difficult to determine them 🤔 |
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.
At the moment we don't handle this scenario (meaning the entire phone number will be pasted in the subscriber number field), the question is: how do we want to handle it? Stripping it and setting the country code and subscriber number values looks error prone in this case because those can have different lengths and it's difficult to determine them 🤔
I looked into this when I initially researched this component. It's possible to reliably extract the country code from a complete phone number, assuming that all country codes are known. Given that the component usually only has access to a subset of country codes (from the options
prop), we will only be able to match supported country codes 🤔 I think that's fine though since I would consider unsupported country codes an edge case.
I'm happy to tackle this in a follow-up PR. I don't think it's necessary for the MVP.
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.tsx
Outdated
Show resolved
Hide resolved
packages/circuit-ui/components/PhoneNumberInput/PhoneNumberInput.module.css
Outdated
Show resolved
Hide resolved
…dation hint as additional field
Ah ok I now see your point, indeed the country code can be extracted from a full number if:
Unfortunately I've no capacity to address this right now, so if you agree let's have it in a follow-up PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thank you for addressing all the feedback. This looks great!
Let's merge it back into #2500, then I'll implement the logic for pasting a phone number so we can release the component 🎉
Great! I'll merge it right away then, do you have a rough idea on when we can release the component? |
c8ac908
into
feature/phone-number-input
I'm aiming for early next week 🤞🏻 |
Addresses SX-2129
Purpose
Update edit phone number component
Approach and changes
PhoneNumberInput.tsx
andPhoneNumberInput.service.tsx
readonly
andinvalid
attributes for each field (country code and subscriber number)placeholder
prop to the subscriber numberDefinition of done