-
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
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
if (isEmptyObject(policyTagList)) { | ||
return ''; | ||
} | ||
|
||
const policyTagKeys = getSortedTagKeys(policyTagList ?? {}); | ||
const policyTagKey = policyTagKeys[tagIndex] ?? ''; | ||
const policyTagKey = policyTagKeys[orderWeight] ?? ''; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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. :)
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.
Looks good, one minor naming request
Co-authored-by: Nikki Wines <[email protected]>
I am testing again after merging main. |
@NikkiWines I tested and it worked 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.
✋ 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 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-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