Repository navigation
feat: add is valid phone number - #697
Conversation
| const metionWithoutSMSDomain = Str.removeSMSDomain(mention); | ||
| if ( | ||
| !Str.isValidMention(match) || | ||
| (new RegExp(`^${Constants.CONST.REG_EXP.PHONE_PART}$`).test(metionWithoutSMSDomain) && !Str.isValidPhoneNumber(metionWithoutSMSDomain)) |
There was a problem hiding this comment.
can we reuse phoneRegex here?
There was a problem hiding this comment.
@hungvu193 We can't because those are two different Regex
There was a problem hiding this comment.
ah ok, can you create a variable for it?
| */ | ||
|
|
||
| isValidPhoneNumber(phone) { | ||
| return parsePhoneNumber(this.removeSMSDomain(phone)).possible; |
There was a problem hiding this comment.
I saw you already remove sms domain inside ExpensifyMark, do we really need to remove sms domain once again here?
There was a problem hiding this comment.
@hungvu193 i updated, please check again
|
Unassigned myself, will review once @hungvu193 approves. Its important for some Expensify-specific automations that the internal engineer is auto-assigned, so hopefully once @hungvu193 approves I'll be auto-assigned back to the review. If that doesn't happen just ping me. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2024-05-14.at.11.05.21.movMacOS: Desktop |
|
All yours @blimpich |
blimpich
left a comment
There was a problem hiding this comment.
Few comments, otherwise looks good.
Do we have a plan to create a follow up PR to upgrade App's expensify-common library? Otherwise this change won't work in the app right?
| if (!Str.isValidMention(match)) { | ||
| const phoneNumberRegex = new RegExp(`^${Constants.CONST.REG_EXP.PHONE_PART}$`); | ||
| const mention = g2.slice(1); | ||
| const metionWithoutSMSDomain = Str.removeSMSDomain(mention); |
There was a problem hiding this comment.
| const metionWithoutSMSDomain = Str.removeSMSDomain(mention); | |
| const mentionWithoutSMSDomain = Str.removeSMSDomain(mention); |
|
Yeah, we will have a PR to upgrade expensify-common. |
Co-authored-by: Benjamin Limpich <blimpich@expensify.com>
Co-authored-by: Benjamin Limpich <blimpich@expensify.com>
|
@blimpich i updated, please check again |
blimpich
left a comment
There was a problem hiding this comment.
Looks good! Will approve but will wait to merge until the merge freeze is officially over.
|
@blimpich Can we merge this now? |
|
Merge freeze/slush isn't over yet, hopefully will merge tomorrow 🙂 Sorry for the delay |
|
Just got the all clear. Lets merge 🎉 |
|
🚀Published to npm in v2.0.4 |
Fixed Issues
$ Expensify/App#41078
Tests
QA