-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Hide contact option if we don't include P2P option #42142
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-03.at.2.13.46.in.the.afternoon.movAndroid: mWeb ChromeScreen.Recording.2024-06-03.at.1.05.29.in.the.afternoon.moviOS: NativeScreen.Recording.2024-06-03.at.3.34.15.in.the.afternoon.moviOS: mWeb SafariScreen.Recording.2024-06-03.at.1.44.21.in.the.afternoon.movMacOS: Chrome / SafariScreen.Recording.2024-06-03.at.1.04.16.in.the.afternoon.movMacOS: DesktopScreen.Recording.2024-06-03.at.2.02.45.in.the.afternoon.mov |
@@ -1827,7 +1827,7 @@ function getOptions( | |||
return option; | |||
}); | |||
|
|||
const havingLoginPersonalDetails = options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail); | |||
const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : []; |
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.
based on your comment shouldn't we cleanup includePersonalDetails
if it's redundant?
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.
@getusha I updated to cleanup includePersonalDetails
.
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.
Nice I like that.
NAB: We could remove the variable havingLoginPersonalDetails
since its unnecessary.
src/libs/OptionsListUtils.ts
Outdated
@@ -1917,7 +1915,7 @@ function getOptions( | |||
} | |||
} | |||
|
|||
if (includePersonalDetails) { | |||
if (includeP2P) { |
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.
this condition will not be redundant? we're assigning an empty array above.
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.
@getusha You're right, I updated.
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.
@nkdengineer I am still not sure if we want to keep the code that was under this condition. could you please confirm that?
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.
@getusha The code that was under this condition is used to create personal detail option so it's necessary.
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.
@nkdengineer sorry, i was just confused because the code was supposed to run only under that condition right? removing only the condition didn't make any sense, can you check it again? and lets make sure we test this thoroughly.
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.
const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : [];
-
We update this to only filter
havingLoginPersonalDetails
ifincludeP2P
istrue
-
The code under the condition is calculated the personal detail option based on
havingLoginPersonalDetails
so we need to keep this code. we can remove the condition because we applied the condition at point 1.
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.
Makes sense, thanks
@nkdengineer i am not able to see workspaces on distance expense on Screen.Recording.2024-05-28.at.3.01.49.in.the.afternoon.mov |
@getusha I still see the the workspace option on the latest main. Screen.Recording.2024-05-30.at.18.46.54.mov |
@getusha Any update here. |
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.
LGTM & tests well
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.
Great work guys, made it very easy for me!
@@ -1827,7 +1827,7 @@ function getOptions( | |||
return option; | |||
}); | |||
|
|||
const havingLoginPersonalDetails = options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail); | |||
const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : []; |
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.
Nice I like that.
NAB: We could remove the variable havingLoginPersonalDetails
since its unnecessary.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.81-11 🚀
|
Details
Hide contact option if we don't include P2P option
Fixed Issues
$ #40790
PROPOSAL: #40790 (comment)
Tests
P2PDistance
Offline tests
Same as above
QA Steps
P2PDistance
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.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
Android: Native
Screen.Recording.2024-05-14.at.16.39.55.mov
Android: mWeb Chrome
Screen.Recording.2024-05-14.at.16.33.20.mov
iOS: Native
Screen.Recording.2024-05-14.at.16.40.51.mov
iOS: mWeb Safari
Screen.Recording.2024-05-14.at.16.33.59.mov
MacOS: Chrome / Safari
Screen.Recording.2024-05-14.at.16.30.34.mov
MacOS: Desktop
Screen.Recording.2024-05-14.at.16.44.43.mov