-
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
[CP Staging] Fix opening receipt page from IOU report leads to not found page #39419
[CP Staging] Fix opening receipt page from IOU report leads to not found page #39419
Conversation
@dukenv0307 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] |
Additional video of:
Screen.Recording.2024-04-03.at.00.15.51.mov
Screen.Recording.2024-04-03.at.00.10.40.mov
Screen.Recording.2024-04-03.at.00.02.06.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-02.at.23.36.02.movAndroid: mWeb ChromeScreen.Recording.2024-04-02.at.23.31.31.moviOS: NativeScreen.Recording.2024-04-02.at.23.46.04.moviOS: mWeb SafariScreen.Recording.2024-04-02.at.23.32.25.movMacOS: Chrome / SafariScreen.Recording.2024-04-02.at.23.25.52.movMacOS: DesktopScreen.Recording.2024-04-02.at.23.47.44.mov |
Hey @bernhardoj |
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 fix this for track expense too
Ah yes, I can reproduce it after re-login. The transaction reportID for track expense is set to chat report optimistically, Lines 1252 to 1255 in 35b4d1b
but looks like BE doesn't save that, so when re-login, the reportID is lost (it becomes '0'). |
@shubham1206agra Do I need to review this PR? |
Fixed for track expense too. |
@dukenv0307 Please continue. |
src/pages/TransactionReceiptPage.tsx
Outdated
const moneyRequestReportID = ReportUtils.isMoneyRequestReport(report) ? report?.reportID : report?.parentReportID; | ||
const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(report); | ||
|
||
const shouldShowNotFoundPage = !isTrackExpenseReport && (moneyRequestReportID ?? '') !== transaction?.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.
This might not be most optimal way to handle this.
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.
Just updated again, lmk if you have any suggestion
@shubham1206agra Is it the expected that BE doesn't save |
@bernhardoj Lint check is failing. |
fixed lint. |
@dukenv0307 Don't worry about this. I have discussed this internally, and BE behaviour is correct. I will correct optimistic FE behaviour in other PR. |
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, all yours @iwiznia.
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.
works great
Untitled.mov
const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(report); | ||
|
||
// eslint-disable-next-line rulesdir/no-negated-variables | ||
const shouldShowNotFoundPage = isTrackExpenseReport ? !transaction : (moneyRequestReportID ?? '') !== transaction?.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.
NAB - for brevity
const isTrackExpenseReport = ReportUtils.isTrackExpenseReport(report); | |
// eslint-disable-next-line rulesdir/no-negated-variables | |
const shouldShowNotFoundPage = isTrackExpenseReport ? !transaction : (moneyRequestReportID ?? '') !== transaction?.reportID; | |
// eslint-disable-next-line rulesdir/no-negated-variables | |
const shouldShowNotFoundPage = ReportUtils.isTrackExpenseReport(report) ? !transaction : (moneyRequestReportID ?? '') !== transaction?.reportID; |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
…-page [CP Staging] Fix opening receipt page from IOU report leads to not found page (cherry picked from commit 935df86)
🚀 Cherry-picked to staging by https://github.com/marcaaron in version: 1.4.59-3 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.60-13 🚀
|
Details
The not found page shows because the report ID doesn't match the transaction report ID. This PR fixes it by getting the correct report ID.
Fixed Issues
$ #39404
PROPOSAL: #39404 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
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-04-03.at.00.08.57.mov
Android: mWeb Chrome
Screen.Recording.2024-04-03.at.00.11.31.mov
iOS: Native
Screen.Recording.2024-04-03.at.00.08.42.mov
iOS: mWeb Safari
Screen.Recording.2024-04-03.at.00.07.33.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-03.at.00.03.42.mov
MacOS: Desktop
Screen.Recording.2024-04-03.at.00.05.21.mov