Fix one-expense report loading#50147
Conversation
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-10-08.at.12.01.00.AM.movAndroid: mWeb ChromeScreen.Recording.2024-10-07.at.11.59.51.PM.moviOS: NativeScreen.Recording.2024-10-07.at.11.58.06.PM.moviOS: mWeb SafariScreen.Recording.2024-10-07.at.11.56.12.PM.movMacOS: Chrome / SafariScreen.Recording.2024-10-07.at.11.50.15.PM.movMacOS: DesktopScreen.Recording.2024-10-07.at.11.52.42.PM.mov |
| const mostRecentReportAction = reportActions.at(0); | ||
| const isMostRecentReportIOU = mostRecentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU; | ||
| const isSingleIOUReportAction = reportActions.filter((action) => action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU).length === 1; | ||
| const isSingleExpenseReport = ReportUtils.isExpenseReport(report) && isMostRecentReportIOU && isSingleIOUReportAction; | ||
| const isSingleInvoiceReport = ReportUtils.isInvoiceReport(report) && isMostRecentReportIOU && isSingleIOUReportAction; | ||
| const shouldShowMostRecentReportAction = | ||
| !!mostRecentReportAction && |
There was a problem hiding this comment.
It seems like this case would have already been caught by the !!mostRecentReportAction check, could you elaborate why it wasn't?
There was a problem hiding this comment.
isMostRecentReportIOU is mostRecentReportAction && is IOU
isSingleExpenseReport and isSingleInvoiceReport both also include the check isMostRecentReportIOU
so I'd think they would have been caught by the !!mostRecentReportAction.
Am I misreading the code?
There was a problem hiding this comment.
Hm, but as you mentioned the isMostRecentReportIOU also includes the check for IOU report action type, and that's the main part of this check.
|
Found a console warning while testing and reported it here |
|
@allroundexperts @grgia Do you have any more questions regarding the PR? Any ETA on the review? |
Looks good from my end. |
allroundexperts
left a comment
There was a problem hiding this comment.
Looks good to me!
|
@grgia kind bump here 🙂 |
|
✋ 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/grgia in version: 9.0.47-1 🚀
|
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
Details
Fix one-expense report loading.
Fixed Issues
$ #49853
PROPOSAL: #49853 (comment)
Tests
Offline tests
Same as in the Tests section.
QA Steps
Same as in the Tests section.
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_web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios_web.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mp4