-
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
fix: Approver field in tag editor shows user email instead of user name #52961
Conversation
@eh2077 The lint warrning is caused because I have added
|
@etCoderDysto Please fix lint errors |
@etCoderDysto I'd like to refrain from using Let's step back a little bit before jumping to fixing. I think the reason you need to add So, I think you can try something like const tagApprover = PolicyUtils.getTagApproverRule(policyID, route.params?.tagName)?.approver ?? '';
const approverText = useMemo(() => {
const approver = PersonalDetailsUtils.getPersonalDetailByEmail(tagApprover);
return approver?.displayName ?? tagApprover;
}, [policyID, route.params?.tagName, tagApprover]); |
This makes sense. I will make this change, and test it. Thanks! |
@@ -52,6 +53,12 @@ function TagSettingsPage({route, navigation}: TagSettingsPageProps) { | |||
navigation.setParams({tagName: currentPolicyTag?.name}); | |||
}, [tagName, currentPolicyTag, navigation]); | |||
|
|||
const tagApprover = PolicyUtils.getTagApproverRule(policyID, route.params?.tagName)?.approver ?? ''; | |||
const approverText = useMemo(() => { | |||
const approver = PersonalDetailsUtils.getPersonalDetailByEmail(tagApprover); |
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 method should be lightweight right? Do we still need to use the useMemo hook 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.
Ahh yes, there is no expensive calculation in the useMemo since we took out getTagApproverRule
from the hook. I will push a change.
@etCoderDysto @eh2077 how is it looking? Do you think this can be ready for review / checklist completed today? |
@mountiny I have a small change to make. It will be ready for further review in 30 minutes. |
@eh2077 Pr is ready for further review. |
Reviewer Checklist
Screenshots/VideosAndroid: Native0-android.mp4Android: mWeb Chrome0-mobile-chrome.mp4iOS: Native0-ios.mp4iOS: mWeb Safari0-mobile-safari.mp4MacOS: Chrome / Safari0-web.mp4MacOS: Desktop0-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 and tested well!
✋ 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/mountiny in version: 9.0.68-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.68-7 🚀
|
Explanation of Change
Fixed Issues
$ #52678
PROPOSAL: #52678 (comment)
Tests
Precondition
Offline tests
Same as test steps
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Precondition
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.mp4
Android: mWeb Chrome
Android.chrome.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.safari.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4