Fix a report preview in the comments of one expense report.#44366
Conversation
…eportActions not loaded
…nThreadReportActions not loaded" This reverts commit 725c3dd.
…eportActions not loaded
…x/43034-keep-filtering-logic-when-thread-not-loaded
…x/43034-keep-filtering-logic-when-thread-not-loaded
…x/43034-keep-filtering-logic-when-thread-not-loaded
Reviewer Checklist
Screenshots/VideosiOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-26.at.15.53.39.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-06-26.at.16.09.26.mp4MacOS: Chrome / SafariScreen.Recording.2024-06-26.at.15.37.58.movMacOS: Desktop |
|
@wildan-m How about passing an extra param
App/src/libs/ReportActionsUtils.ts Lines 953 to 956 in a272c4b |
|
@Pujan92 I think that's a good idea. Something like this, right? I'll try to test it. function getCombinedReportActions(reportActions: ReportAction[], transactionThreadReportActions: ReportAction[], reportID?: string, transactionThreadReportID?: string): ReportAction[] {
// There is a chance that transactionThreadReportActions is not loaded yet.
// We only check for emptiness when there are multiple IOUs,
// this will prevent the sub-report preview from being displayed when there is only one IOU.
if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) {
return reportActions;
} |
…x/43034-keep-filtering-logic-when-thread-not-loaded
|
@Pujan92 the PR has been updated |
src/libs/ReportActionsUtils.ts
Outdated
| ): ReportAction[] { | ||
| // There is a chance that transactionThreadReportActions is not loaded yet. | ||
| // We only check for emptiness when there are multiple IOUs, | ||
| // this will prevent the sub-report preview from being displayed when there is only one IOU. |
There was a problem hiding this comment.
Do you think we don't need this comment now?
There was a problem hiding this comment.
@Pujan92 I believe the comment is helpful as it provides a rationale for the necessity of checking for an empty transactionThreadReportID. Perhaps we could consider rephrasing it for clarity, any suggestion?
There was a problem hiding this comment.
// There is a chance that transactionThreadReportActions is not loaded yet.
I thought now that we have the transactionThreadReportID, we don't need to rely on transactionThreadReportActions for that condition(ref). If we go with that then we can omit this comment bcoz the function description is enough to convey. WDYT?
Co-authored-by: Pujan Shah <shahpujan1992@gmail.com>
Co-authored-by: Pujan Shah <shahpujan1992@gmail.com>
| const combinedReportActions = useMemo( | ||
| () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions), | ||
| [allReportActions, transactionThreadReportActions], | ||
| () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions, reportID), |
There was a problem hiding this comment.
| () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions, reportID), | |
| () => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions), |
Let's avoid passing optional parameter reportID like the way how it was earlier
There was a problem hiding this comment.
@Pujan92 on the submitter side, not supplying report ID will create duplicate parent report previews when we create multiple IOUs.
There was a problem hiding this comment.
@Pujan92 reportID has been removed, I can't reproduce the duplicate issue with recent merging, seems the issue come from somewhere else
src/libs/ReportActionsUtils.ts
Outdated
| // There is a chance that transactionThreadReportActions is not loaded yet. | ||
| // We only check for emptiness when there are multiple IOUs, | ||
| // this will prevent the sub-report preview from being displayed when there is only one IOU. | ||
| if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) { |
There was a problem hiding this comment.
| if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) { | |
| if (_.isEmpty(transactionThreadReportID)) { |
There was a problem hiding this comment.
@Pujan92, could you provide further clarification on this suggestion?
There was a problem hiding this comment.
Please check this comment once. I am trying to say transactionThreadReportID is enough to decide whether it is one expense report or not.
There was a problem hiding this comment.
I understand, I think that makes sense. The PR has been updated.
|
@deetergp Just to inform you, We found that |
deetergp
left a comment
There was a problem hiding this comment.
Code looks good and tests 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 production by https://github.com/jasperhuangg in version: 9.0.3-7 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|


@Pujan92 @deetergp
Details
Fix a report preview in the comments of one expense report.
Fixed Issues
$ #43034
PROPOSAL: #43034 (comment) (Alternative)
Tests
Offline tests
QA Steps
Same as Test
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
Kapture.2024-06-25.at.08.06.31.mp4
Android: mWeb Chrome
Kapture.2024-06-25.at.08.11.01.mp4
iOS: Native
Kapture.2024-06-25.at.09.43.27.mp4
iOS: mWeb Safari
Kapture.2024-06-25.at.08.02.23.mp4
MacOS: Chrome / Safari
Kapture.2024-06-25.at.07.50.36.mp4
MacOS: Desktop
Kapture.2024-06-25.at.08.21.51.mp4