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! |
|
|
||
| const tagApprover = PolicyUtils.getTagApproverRule(policyID, route.params?.tagName)?.approver ?? ''; | ||
| const approverText = useMemo(() => { | ||
| const approver = PersonalDetailsUtils.getPersonalDetailByEmail(tagApprover); |
There was a problem hiding this comment.
This method should be lightweight right? Do we still need to use the useMemo hook here?
There was a problem hiding this comment.
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 |
|
✋ 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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