-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[NoQA] Add falsey checks and _.compact()
to places where we access SMS logins from personal details
#18159
Conversation
…rom personal details
_.compact()
to places where we access SMS logins from personal details
@NikkiWines Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
Looking good, a couple things. Is there any way we can test this?
@@ -39,6 +39,10 @@ Onyx.connect({ | |||
* @returns {String} | |||
*/ | |||
function formatPhoneNumber(number) { | |||
if (!number) { | |||
return ''; |
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.
I think this is a good approach, but I'm unsure if it's going to be okay, in all uses, for it to be an empty string.
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.
I originally had it to just return number
, but my thinking was that if we're passed an incorrect falsey value (like undefined
or 0
or something), it would be better to just return an empty string.
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.
Yeah totally. What I'm saying is what will the caller of the function do with ''
? Hopefully it's fine, but it's used all over the place so how do we verify that it works?
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 least it definitely won't crash if we return ''
, since the caller expects a string.
|
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.
I think this looks good, I will run a quick internal build os I can test this in web on my account
Reviewer Checklist
Screenshots/VideosI have tested just using the web build from above going to the lounge chat after signing in but I guess its hard to replicate, the app did not crash and seems to show all participants correctly so I will go ahead and merge this Mobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
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.
I'm happy with the code, I have an idea to reproduce the error so I'll try testing really quickly.
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.
I wasn't able to figure out how to test, I think we'll have to see how it works. The code looks good.
_.compact()
to places where we access SMS logins from personal details_.compact()
to places where we access SMS logins from personal details
Add falsey checks and `_.compact()` to places where we access SMS logins from personal details (cherry picked from commit 237c8cd)
…-18159 🍒 Cherry pick PR #18159 to staging 🍒
🧪🧪 Use the links below to test this build in android and iOS. Happy testing! 🧪🧪 |
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 1.3.8-6 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.8-8 🚀
|
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|
Details
Fixed Issues
https://expensify.slack.com/archives/C049HHMV9SM/p1682358290819999
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android