Repository navigation
Show the CREATED report action when the expense report was created during harvest #75511
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
Merged
cristipaval
merged 45 commits into
Expensify:main
from
hoangzinh:74580-show-created-action-for-harvest-expense-report
Dec 15, 2025
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
3327196
Add utils to check harvest report and get originalID
hoangzinh ce26920
Display created action for harvest expense reports
hoangzinh dbf6eeb
Fix translation key
hoangzinh a2f2bde
only return CONCIERGE ID for harvest created expense report
hoangzinh a5c5f9d
Fix bug, incorrect report id
hoangzinh 8967b60
Add tests for harvest-created reports and CREATED action visibility
hoangzinh 9ba2172
Context menu: copy harvest-created CREATED action as localized summar…
hoangzinh 793e382
feat(i18n): add HarvestCreatedExpenseReportParams import and translat…
hoangzinh bbfb1cb
Fix linter
hoangzinh d55abef
chore(i18n): include reportUrl in HarvestCreatedExpenseReportParams a…
hoangzinh 65e2025
Fix type error
hoangzinh 3d8b12c
Fix type error
hoangzinh d11506f
Add unit test for getHarvestCreatedExpenseReportMessage
hoangzinh 90e1db5
perf: optimize React.memo comparison and fix stale closure
hoangzinh c6628b1
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh b20161b
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh 358e6ef
Run prettier
hoangzinh 21c1b53
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh b890608
refactor: update harvestCreatedExpenseReport to use reportName instea…
hoangzinh d14c02b
refactor: pass reportNameValuePairs as separate props for better perf…
hoangzinh dd5751b
Fix eslint
hoangzinh e09c019
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh a978219
refactor: extract getReportURLForCurrentContext to navigation helper
hoangzinh 068e15e
fix: show harvest created expense report action in LHN
hoangzinh 0cedc66
fix: show harvest created expense report action in one-transaction view
hoangzinh fefd125
Hide leave thread for harvest created action
hoangzinh 8091288
refactor: use isHarvestReport flag instead of reportNameValuePairs in…
hoangzinh 2b6891e
Run prettier
hoangzinh 803326c
fix: UI is blink for harvest created one transaction report
hoangzinh 6f17bd6
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh f60382e
Fix merge main
hoangzinh a849805
Apply suggestions from code review
hoangzinh 2ab32b4
Refactor as suggested.
hoangzinh 65ca1c6
Run prettier
hoangzinh cc1046d
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh aa2b2c2
Fix eslint
hoangzinh 221acc1
Run prettier
hoangzinh da37ec7
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh 1dfb917
Use getNonEmptyStringOnyxID
hoangzinh 06b9ed4
Fix render repeated MoneyRequestView
hoangzinh c215ffd
fix: hide join thread option for harvest created expense reports
hoangzinh cbcaa7b
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh 302a04f
revert: harvest created expense report message in LHN
hoangzinh 42840d9
Merge branch 'main' into 74580-show-created-action-for-harvest-expens…
hoangzinh 124ab7b
Fix react-compiler-compliance-check
hoangzinh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/libs/Navigation/helpers/getReportURLForCurrentContext.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import {getEnvironmentURL} from '@libs/Environment/Environment'; | ||
| import Navigation from '@libs/Navigation/Navigation'; | ||
| import ROUTES from '@src/ROUTES'; | ||
| import isSearchTopmostFullScreenRoute from './isSearchTopmostFullScreenRoute'; | ||
|
|
||
| let environmentURL: string; | ||
| getEnvironmentURL().then((url: string) => (environmentURL = url)); | ||
|
|
||
| /** | ||
| * Generates a URL for a report that respects the current navigation context. | ||
| * When in a search context, includes backTo parameter to preserve search state. | ||
| * Otherwise, returns a simple report URL. | ||
| */ | ||
| function getReportURLForCurrentContext(reportID: string | undefined): string { | ||
| if (!reportID) { | ||
| return `${environmentURL}/r/`; | ||
| } | ||
| const isInSearchContext = isSearchTopmostFullScreenRoute(); | ||
| if (!isInSearchContext) { | ||
| return `${environmentURL}/${ROUTES.REPORT_WITH_ID.getRoute(reportID)}`; | ||
| } | ||
|
|
||
| // Navigation can return routes with a leading slash or missing when still mounting. | ||
| // Normalize everything to match the path shape used by ROUTES helpers. | ||
| const normalizeRoute = (route?: string) => { | ||
| if (!route) { | ||
| return undefined; | ||
| } | ||
| return route.startsWith('/') ? route.substring(1) : route; | ||
| }; | ||
|
|
||
| const activeRoute = normalizeRoute(Navigation.getActiveRoute()); | ||
|
|
||
| let backToRoute: string | undefined; | ||
|
|
||
| if (activeRoute) { | ||
| const [, queryString = ''] = activeRoute.split('?'); | ||
| if (queryString) { | ||
| const params = new URLSearchParams(queryString); | ||
| const encodedBackTo = params.get('backTo'); | ||
| if (encodedBackTo) { | ||
| // Prefer the backTo param when present; it points to the exact search state we left. | ||
| backToRoute = normalizeRoute(decodeURIComponent(encodedBackTo)); | ||
| } | ||
| } | ||
|
|
||
| if (!backToRoute && activeRoute.startsWith(ROUTES.SEARCH_ROOT.route)) { | ||
| // Otherwise keep the current search route (preserves tab + filters) as the return target. | ||
| backToRoute = activeRoute; | ||
| } | ||
| } | ||
|
|
||
| if (!backToRoute?.startsWith(ROUTES.SEARCH_ROOT.route)) { | ||
| // Fall back to the generic search home when we can't recover a valid route. | ||
| backToRoute = ROUTES.SEARCH_ROOT.route; | ||
| } | ||
|
|
||
| const relativePath = ROUTES.SEARCH_MONEY_REQUEST_REPORT.getRoute({reportID, backTo: backToRoute}); | ||
| return `${environmentURL}/${relativePath}`; | ||
| } | ||
|
|
||
| export default getReportURLForCurrentContext; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.