-
Notifications
You must be signed in to change notification settings - Fork 3k
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 a report preview in the comments of one expense report. #44366
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 |
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.
Thanks @wildan-m , suggested some minor changes.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we don't need this comment now?
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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>
@@ -157,8 +158,8 @@ function ReportActionsView({ | |||
// Get a sorted array of reportActions for both the current report and the transaction thread report associated with this report (if there is one) | |||
// so that we display transaction-level and report-level report actions in order in the one-transaction view | |||
const combinedReportActions = useMemo( | |||
() => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportActions), | |||
[allReportActions, transactionThreadReportActions], | |||
() => ReportActionsUtils.getCombinedReportActions(allReportActions, transactionThreadReportID ?? null, transactionThreadReportActions, reportID), |
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.
() => 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pujan92 reportID
has been removed, I can't reproduce the duplicate issue with recent merging, seems the issue come from somewhere else
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.
Thanks!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (isEmptyObject(transactionThreadReportActions) && _.isEmpty(transactionThreadReportID)) { | |
if (_.isEmpty(transactionThreadReportID)) { |
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.
@Pujan92, could you provide further clarification on this suggestion?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, I think that makes sense. The PR has been updated.
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, Thanks! :)
@deetergp Just to inform you, We found that |
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.
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 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
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