-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -227,7 +227,7 @@ function Search({queryJSON}: SearchProps) { | |
} | ||
|
||
const ListItem = SearchUtils.getListItem(type, status); | ||
const data = SearchUtils.getSections(type, status, searchResults.data, searchResults.search); | ||
const data = SearchUtils.getSections(type, status, searchResults.data, searchResults.search, queryJSON.inputQuery); | ||
const sortedData = SearchUtils.getSortedSections(type, status, data, sortBy, sortOrder); | ||
const sortedSelectedData = sortedData.map((item) => mapToItemWithSelectionInfo(item, selectedTransactions, canSelectMultiple)); | ||
|
||
|
@@ -294,13 +294,15 @@ function Search({queryJSON}: SearchProps) { | |
SearchActions.createTransactionThread(hash, item.transactionID, reportID, item.moneyRequestReportActionID); | ||
} | ||
|
||
const backTo = ROUTES.SEARCH_CENTRAL_PANE.getRoute({query: queryJSON.inputQuery}); | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Could we use There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! Yea, I think that should be ok. Thanks for the changes! |
||
return; | ||
} | ||
|
||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute(reportID)); | ||
Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID, backTo})); | ||
}; | ||
|
||
const fetchMoreResults = () => { | ||
|
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 ingit 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.