-
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: navigate to parent report on delete track expense #55015
base: main
Are you sure you want to change the base?
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] |
@daledah After deleting the track expense, the self-dm appears 2 times in the stack. I'm not sure why it happens for now. Can you pls check? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-01-15.at.12.17.11.movAndroid: mWeb ChromeScreen.Recording.2025-01-15.at.11.54.59.moviOS: NativeScreen.Recording.2025-01-15.at.11.57.46.moviOS: mWeb SafariScreen.Recording.2025-01-15.at.11.54.27.movMacOS: Chrome / SafariScreen.Recording.2025-01-15.at.11.49.44.movMacOS: DesktopScreen.Recording.2025-01-15.at.14.44.38.mov |
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
@puneetlath can you please take a look at this issue? Thanks |
src/libs/Navigation/Navigation.ts
Outdated
@@ -428,6 +428,13 @@ function getTopMostCentralPaneRouteFromRootState() { | |||
return getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>); | |||
} | |||
|
|||
function getPreviousTrackReport(reportID?: string) { |
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 find this function name/behavior confusing. What is a "previous track report"? Would you mind explaining that to me in plan english?
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.
What do you think if we rename this function getReportRouteByID
?
src/libs/Navigation/Navigation.ts
Outdated
@@ -442,6 +449,19 @@ function removeScreenFromNavigationState(screen: Screen) { | |||
}); | |||
} | |||
|
|||
function removeScreenByKey(key: string) { |
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.
What are we removing it from? Is it from the navigation state? If so I would suggest:
function removeScreenByKey(key: string) { | |
function removeScreenFromNavigationStateByKey(key: string) { |
src/libs/ReportUtils.ts
Outdated
@@ -4437,7 +4437,7 @@ function goBackToDetailsPage(report: OnyxEntry<Report>, backTo?: string) { | |||
} | |||
} | |||
|
|||
function navigateBackOnDeleteTransaction(backRoute: Route | undefined, isFromRHP?: boolean) { | |||
function navigateBackOnDeleteTransaction(backRoute: Route | undefined, isFromRHP?: boolean, reportID?: string) { |
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.
What reportID is being passed here? Is it the reportID that the transaction itself is on?
src/libs/ReportUtils.ts
Outdated
@@ -4447,7 +4447,13 @@ function navigateBackOnDeleteTransaction(backRoute: Route | undefined, isFromRHP | |||
return; | |||
} | |||
if (isFromRHP) { | |||
Navigation.dismissModal(); | |||
if (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.
How do we know that just because a reportID is passed that this is a tracked expense?
Sorry for the delay here. I have a handful of questions. |
@puneetlath I updated |
@@ -428,6 +428,13 @@ function getTopMostCentralPaneRouteFromRootState() { | |||
return getTopmostCentralPaneRoute(navigationRef.getRootState() as State<RootStackParamList>); | |||
} | |||
|
|||
function getReportRouteByID(reportID?: string) { |
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.
Ok sorry, one more dumb question. Why isn't the report route just /r/<reportID>
?
Explanation of Change
Fixed Issues
$ #54058
PROPOSAL: #54058 (comment)
Tests
Offline tests
Same as above
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)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: Nativehttps://github.com/user-attachments/assets/2022e45e-a88a-4d94-b597-0e0f7a6c5561
mmary>
Android: mWeb Chrome
Screen.Recording.2025-01-09.at.17.24.54.mov
iOS: Native
Screen.Recording.2025-01-09.at.17.25.31.mov
iOS: mWeb Safari
Screen.Recording.2025-01-09.at.17.26.15.mov
MacOS: Chrome / Safari
Screen.Recording.2025-01-09.at.17.20.19.mov
MacOS: Desktop
Uploading Screen Recording 2025-01-09 at 17.27.08.mov…