-
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: the user is navigated without showing the Not Found Page when deleting a money request or IOU report #33041
Conversation
src/pages/home/ReportScreen.js
Outdated
@@ -317,7 +326,8 @@ function ReportScreen({ | |||
prevOnyxReportID === routeReportID && | |||
!onyxReportID && | |||
prevReport.statusNum === CONST.REPORT.STATUS.OPEN && | |||
(report.statusNum === CONST.REPORT.STATUS.CLOSED || (!report.statusNum && !prevReport.parentReportID && prevReport.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM))) | |||
(report.statusNum === CONST.REPORT.STATUS.CLOSED || (!report.statusNum && !prevReport.parentReportID && prevReport.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM))) || | |||
((ReportUtils.isMoneyRequest(prevReport) || ReportUtils.isMoneyRequestReport(prevReport)) && _.isEqual(report, defaultProps.report)) |
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.
Instead of comparing to the default report props, let's just reuse the !report.statusNum
condition
(!report.statusNum && ((!prevReport.parentReportID && prevReport.chatType === CONST.REPORT.CHAT_TYPE.POLICY_ROOM) || (the new condition)))
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.
@s77rt I don't think this gonna work. since the code that you provided need prevReport.statusNum === CONST.REPORT.STATUS.OPEN
But I added a console.log the prevReport.statusNum is 1 which means 'SUBMITTED' not 'OPEN'
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.
That makes sense. In that case just use _.isEmpty(report)
instead of comparing with default prop (it's a little more readable)
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 updated. Please help review again.
@dukenv0307 Conflicts please |
@s77rt Updated. |
@dukenv0307 If we delete a IOU request the report will show skeleton view, can we prevent that as well? ios.mov |
@s77rt I think showing a loading screen after deleting makes sense since this is like normal navigation. But if you insist, we can update the condition of showing ReportActionsSkeletonView App/src/pages/home/ReportScreen.js Line 467 in aa1d87c
to {((!isReportReadyForDisplay && !wasReportAccessibleRef.current) || isLoadingInitialReportActions || isLoading) && <ReportActionsSkeletonView />} Please let me know your opinion on this |
I don't think that's a blocker. |
@dukenv0307 Can you please specify that the user should not see the not found page |
Reviewer Checklist
Screenshots/VideosAndroid: NativeCan't test due to an ongoing issue https://expensify.slack.com/archives/C01GTK53T8Q/p1702883604941629 Android: mWeb Chromemweb-chrome.moviOS: Nativeios.moviOS: mWeb Safarimweb-safari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
Updated in test steps
I don't think I fully understand your point. Should we keep the current showing loading screen when navigating logic or update the code so that the loading screen does not appear |
Yes. |
✋ 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/francoisl in version: 1.4.15-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 1.4.15-5 🚀
|
Details
When deleting a money request or IOU report, the user is navigated without showing the Not Found Page
Fixed Issues
$ #28969
PROPOSAL: #28969 (comment)
Tests
Offline tests
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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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)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
android-resize.mov
Android: mWeb Chrome
chrome-resize.mov
iOS: Native
ios-resize.mov
iOS: mWeb Safari
safari-resize.mov
MacOS: Chrome / Safari
web-resize.mov
MacOS: Desktop
desktop-resize.mov