-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add backTo param handling when opening Report from Search #49641
Add backTo param handling when opening Report from Search #49641
Conversation
@ikevin127 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] |
13d29fc
to
d8cda53
Compare
@@ -1552,6 +1550,12 @@ type Route = { | |||
|
|||
type RoutesValidationError = 'Error: One or more routes defined within `ROUTES` have not correctly used `as const` in their `getRoute` function return value.'; | |||
|
|||
/** | |||
* Represents all routes in the app as a union of literal strings. |
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 added this comment, because I found the RouteIsPlainString
quite confusing. After digging in git blame
I found that this comment was originally there, but got removed in here:
https://github.com/Expensify/App/pull/40017/files#diff-8c80af31c75a0f4fcb67272bd2df5b42c9611c040ecc66584fcd6bde05dbbd78L749
I think having this comment is much better than not having it, because this type is not exported and not used anywhere, so it will 100% confuse others.
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.webmAndroid: mWeb Chromeandroid-mweb.webmiOS: Nativeios.mp4iOS: mWeb Safariios-mweb.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
if (SearchUtils.isReportActionListItemType(item)) { | ||
const reportActionID = item.reportActionID; | ||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(reportID, reportActionID)); | ||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, reportActionID, backTo})); |
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.
Could we use Navigation.getActiveRoute()
instead of passing the queryJSON.inputQuery
and building the route? Same for the other instances of backTo in this 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.
This is a great improvement Carlos! thanks, I tested and it works.
The only small difference is that if I generate backTo
it looks like this: search?foo
whereas generated from getActiveRoute()
it has the extra leading slash: /search?foo
.
But as far as I can see it makes no changes in navigation logic, so I'm fixing 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.
Nice! Yea, I think that should be ok. Thanks for the changes!
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 🚀
We also have this pending comment |
Comment applied, conflicts resolved |
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
if (SearchUtils.isReportActionListItemType(item)) { | ||
const reportActionID = item.reportActionID; | ||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(reportID, reportActionID)); | ||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, reportActionID, backTo})); |
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.
Nice! Yea, I think that should be ok. Thanks for the changes!
✋ 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/luacmartins in version: 9.0.41-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.41-10 🚀
|
Details
backTo
param to/search/view/<reportID>
route, so that App knows what search query to go back tobackTo
param in navigationSearchUtils
Note: This concerns mostly web where you can refresh a page page, and refreshing would clear search history; Only web recording is provided as you cannot "refresh" a native app
Fixed Issues
$ #48817
PROPOSAL:
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 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web-backTo.mp4
MacOS: Desktop