-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Optimizing getPersonalDetailByEmail
using key-value pair object mapping
#39477
Optimizing getPersonalDetailByEmail
using key-value pair object mapping
#39477
Conversation
Hi, @rojiphil is there any kind of tests i should make here? |
Yes. We will have to take a clear use case of the API and test with that to ensure that it works as expected. |
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.
Code looks good. Please complete the author checklist with test videos for verifying getPersonalDetailByEmail
.
@@ -77,7 +84,7 @@ function getPersonalDetailsByIDs(accountIDs: number[], currentUserAccountID: num | |||
} | |||
|
|||
function getPersonalDetailByEmail(email: string): PersonalDetails | undefined { | |||
return (Object.values(allPersonalDetails ?? {}) as PersonalDetails[]).find((detail) => detail?.login === email); | |||
return emailToPersonalDetailsCache[email.toLowerCase()]; |
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.
Let us have a test case around verifying policyApproverName
here in Workflows page which uses getPersonalDetailByEmail
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.
Okay added some test steps to test this
👋 @rojiphil will you be able to re-review this today? |
Yes @trjExpensify. Will review this today. |
Reviewer Checklist
Screenshots/VideosAndroid: Native38960-android-native.mp4Android: mWeb Chrome38960-mweb-chrome.mp4iOS: Native38960-ios-native.mp4iOS: mWeb Safari38960-mweb-safari.mp4MacOS: Chrome / Safari38960-web-safari.mp4MacOS: Desktop38960-desktop.mp4 |
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
✋ 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 staging by https://github.com/luacmartins in version: 1.4.61-0 🚀
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.4.61-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
|
Details
Fixed Issues
$ #38960
PROPOSAL: #38960 (comment)
Tests
Offline tests
The same steps as in the tests
QA Steps
The same steps as in the tests
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2024-04-04.at.8.27.12.AM.mov
MacOS: Desktop