fix: tag name in RHP is not correct#38988
Conversation
|
Under review, I'm investigating the App/src/libs/TransactionUtils.ts Line 396 in d0a78c8 |
|
@ntdiary In the case you mentioned here, it works properly in both main branch and this branch.
|
Yesterday, while adjusting the tags order in oldDot, I encountered a scenario where the weight was only |
I am trying to reproduce it |
@tienifr, thank you very much for your patience! It's strange, I wasn't able to reproduce it again either. Additionally, @NikkiWines, PR #38881 seems to have fixed issue #37783 as well, so continuing this PR might not make much sense. If possible, maybe we can offer some compensation to @tienifr and then close this issue? As for the replacement of |
|
Ah yep, so there was an effective dupe of the issue - that's definitely frustrating. I'll start an internal discussion on compensation since work was done here. |
|
@NikkiWines @ntdiary Besides fixing the main issue, my solution also uses the orderWeight as the id to put in the route instead of tagIndex. Should we proceed with it? |
I do still like the idea of updating our usage of Let me double check with the team and I'll get back to you tomorrow on whether or not to proceed. Otherwise we can provide 50% compensation for the investment into the issue and time-spent 🙇 |
|
Sorry for the delay here - I've got consensus that we should move forward with the change to use |
src/libs/PolicyUtils.ts
Outdated
|
|
||
| const policyTagKeys = getSortedTagKeys(policyTagList ?? {}); | ||
| const policyTagKey = policyTagKeys[tagIndex] ?? ''; | ||
| const policyTagKey = policyTagKeys[orderWeight] ?? ''; |
There was a problem hiding this comment.
return Object.values(policyTagList).find((policy) => policy.orderWeight === orderWeight)?.name ?? '';
@tienifr, I think your previous code would be more semantically and functionally appropriate.
In addition, we can also comment, currently, the orderWeight and tagIndex values are the same, and we want to migrate from tagIndex to orderWeight, and finally attach the discussion link. :)
There was a problem hiding this comment.
@ntdiary, I believe adding a comment is unnecessary as the function is straightforward enough to understand on its own.
src/libs/PolicyUtils.ts
Outdated
| const policyTagKey = policyTagKeys[tagIndex] ?? ''; | ||
|
|
||
| return policyTagList?.[policyTagKey]?.name ?? ''; | ||
| return Object.values(policyTagList ?? {}).find((policy) => policy.orderWeight === orderWeight)?.name ?? ''; |
There was a problem hiding this comment.
policyTagList ?? {}
@tienifr, eh , why do we add ?? here ? I think if policyTagList is undefined or null, it should have returned early in the above condition. 🤔
There was a problem hiding this comment.
Ah, That makes sense. I updated
Reviewer Checklist
Screenshots/VideosAndroid: Native38988-android-native.mp4Android: mWeb Chrome38988-android-chrome.mp4iOS: Native38988-ios-native.mp4iOS: mWeb Safari38988-ios-safari.mp4MacOS: Chrome / Safari38988-web.mp4MacOS: Desktop38988-desktop.mp4 |
NikkiWines
left a comment
There was a problem hiding this comment.
Looks good, one minor naming request
Co-authored-by: Nikki Wines <nikkiwines@expensify.com>
|
I am testing again after merging main. |
|
@NikkiWines I tested and it worked 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/NikkiWines in version: 1.4.63-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|

Details
Fixed Issues
$ #37783
PROPOSAL: #37783 (comment)
Tests
Precondition:
First level: State
Second level: Region
Offline tests
QA Steps
Precondition:
First level: State
Second level: Region
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
Screen.Recording.2024-03-26.at.16.42.12.mov
Android: mWeb Chrome
Screen.Recording.2024-03-26.at.16.36.43.mov
iOS: Native
Screen.Recording.2024-03-26.at.16.43.44.mov
iOS: mWeb Safari
Screen.Recording.2024-03-26.at.16.39.06.mov
MacOS: Chrome / Safari
Screen.Recording.2024-03-26.at.16.25.11.mov
MacOS: Desktop
Screen.Recording.2024-03-26.at.16.29.03.mov