[No QA] Refactor ReportUtils GetIcons... without changing any logic#64339
[No QA] Refactor ReportUtils GetIcons... without changing any logic#64339
GetIcons... without changing any logic#64339Conversation
| /** | ||
| * Helper function to get the icons for an expense request. Only to be used in getIcons(). | ||
| */ | ||
| function getIconsForExpenseRequest(report: OnyxInputOrEntry<Report>, personalDetails: OnyxInputOrEntry<PersonalDetailsList>, policy: OnyxInputOrEntry<Policy>): Icon[] { |
There was a problem hiding this comment.
The helper functions all use the existing blocks
| policy?: OnyxInputOrEntry<Policy>, | ||
| invoiceReceiverPolicy?: OnyxInputOrEntry<Policy>, | ||
| ): Icon[] { |
There was a problem hiding this comment.
GetIcons is the root function
| it('does not export getIconsForChatThread', () => { | ||
| // @ts-expect-error the test is asserting that it's undefined, so the TS error is normal | ||
| expect(ReportUtils.getIconsForChatThread).toBeUndefined(); |
There was a problem hiding this comment.
I don't want anyone to accidentally hardcode avatars by exporting these functions
| @@ -0,0 +1,535 @@ | |||
| import Onyx from 'react-native-onyx'; | |||
There was a problem hiding this comment.
We can remove this file before merging.
|
@grgia can you open this pr up for review |
Reviewer Checklist
Screenshots/VideosAndroid: mWeb ChromeScreen.Recording.2025-06-18.at.4.53.24.PM.moviOS: mWeb SafariScreen.Recording.2025-06-18.at.4.52.09.PM.movMacOS: Chrome / SafariScreen.Recording.2025-06-18.at.4.48.49.PM.movMacOS: DesktopScreen.Recording.2025-06-18.at.4.52.59.PM.mov |
allgandalf
left a comment
There was a problem hiding this comment.
code LGTM, testing a bit and will approve then
| it('does not export getIconsForChatThread', () => { | ||
| // @ts-expect-error the test is asserting that it's undefined, so the TS error is normal | ||
| expect(ReportUtils.getIconsForChatThread).toBeUndefined(); |
| /** | ||
| * Helper function to get the icons for an expense request. Only to be used in getIcons(). | ||
| */ | ||
| function getIconsForExpenseRequest(report: OnyxInputOrEntry<Report>, personalDetails: OnyxInputOrEntry<PersonalDetailsList>, policy: OnyxInputOrEntry<Policy>): Icon[] { |
allgandalf
left a comment
There was a problem hiding this comment.
lets remove the tests please before merging
|
@chiragsalian Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🎯 @allgandalf, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #64432. |
|
@neil-marcellini Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
The auto assigner went off, sorry guys |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
✋ 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/inimaga in version: 9.1.69-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/inimaga in version: 9.1.69-0 🚀
|
|
🚀 Deployed to staging by https://github.com/inimaga in version: 9.1.69-0 🚀
|
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.1.69-3 🚀
|


Explanation of Change
I added tests to main in #64331. Checked that they passed.
The aim of this PR is to decouple this PR without changing how it acts
I tested by running the tests.
Fixed Issues
Part of #64337
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop