Migrate money request time step to dynamic routes (#83850 part 2)#96963
Draft
suneox wants to merge 1 commit into
Draft
Migrate money request time step to dynamic routes (#83850 part 2)#96963suneox wants to merge 1 commit into
suneox wants to merge 1 commit into
Conversation
…rt 2) Migrate MONEY_REQUEST_STEP_TIME (path `time`, entry STEP_DESTINATION + MONEY_REQUEST.CREATE) and MONEY_REQUEST_STEP_TIME_EDIT (path `time-edit`, entry STEP_CONFIRMATION) to dynamic routes, removing their static routes and the `backTo` param. - Rename IOURequestStepTime -> DynamicIOURequestStepTime; edit mode from route.name, back path from useDynamicBackPath (replaces the reconstructed conditional back logic). - Destination forward builds Time on the start base when opened inline on the start page (single per-diem policy) and on the destination base otherwise; subrate goBack and confirmation edit use createDynamicRoute. - Add OldRoutes redirects + getMatchingNewRoute unit tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation of Change
Migrate the per-diem money-request Time step (
MONEY_REQUEST_STEP_TIME, entry fromSTEP_DESTINATION/MONEY_REQUEST.CREATE) and its edit variant (MONEY_REQUEST_STEP_TIME_EDIT, entry fromSTEP_CONFIRMATION) from static routes to dynamic URL navigation, removing thebackTo/backToReportparams. The step page is renamedIOURequestStepTime→DynamicIOURequestStepTime; edit mode is derived fromroute.nameand the back path fromuseDynamicBackPath(replacing the old reconstructed conditional back logic — backTo / hasMoreThanOnePolicy / CREATE_TAB_PER_DIEM). The destination forward builds Time on the start base when the destination is inline on the start page (single per-diem policy,openedFromStartPage) and on the destination base otherwise; subrate goBack and confirmation edit usecreateDynamicRoute. OldRoutes redirects cover the legacy URLs, and the dynamic suffixes are namespacedper-diem-time/per-diem-time-edit(globally unique acrossDYNAMIC_ROUTES). Part 2 of #83850 (Destination is Part 1, Subrate is Part 3).Fixed Issues
$ #83850
PROPOSAL:
Tests
DYNAMIC_ROUTES.MONEY_REQUEST_STEP_TIME— wizard time step (non-edit)Case 1.1 — Destination → Time forward (multi-policy)
Target:
IOURequestStepDestination.tsxupdateDestinationPrecondition: ≥2 per-diem workspaces (destination shown as an RHP after selecting a workspace).
Steps:
Expected: The Time step opens; URL
.../destination/<txn>/<rpt>/per-diem-time; title is the tab title.Case 1.2 — Time back → Destination (multi-policy, cut suffix)
Steps:
Expected: Returns to the Destination RHP (suffix
/per-diem-timestripped). No/not-found.Case 1.3 — Single-policy Time back → Start
Precondition: exactly one per-diem workspace (destination shown inline on the start tab,
openedFromStartPage).Steps:
.../start/<txn>/<rpt>/per-diem-time).Expected: Returns to the Start page per-diem tab (suffix⚠️ Verify it does not land on a destination RHP.
/per-diem-timestripped → start base).Case 1.4 — Time → Subrate forward (Subrate still static in Part 2)
Steps:
Expected: Navigates to Subrate (Part 2 has not migrated Subrate — static route, must work normally).
Case 1.5 — Subrate back → Time (cross-file goBack)
Target:
IOURequestStepSubrate.tsx:130Steps:
Expected: Returns to the dynamic Time step; pickers shown. No
/not-found.Case 1.6 — Deep-link + OldRoutes redirect
Steps:
/create/submit/time/123/456.Expected: Redirects to⚠️ Legacy query (
/create/submit/destination/123/456/per-diem-time; Time opens, back → destination.?backTo=) not preserved (append-suffix, accepted).DYNAMIC_ROUTES.MONEY_REQUEST_STEP_TIME_EDIT— edit time from ConfirmationCase 2.1 — Confirmation → edit Time (forward)
Target:
PerDiemFields.tsx:128Precondition: on the Confirmation step of a per-diem expense.
Steps:
Expected: Time opens in edit mode, title = "Time"; URL
.../confirmation/<txn>/<rpt>/per-diem-time-edit.Case 2.2 — Edit save → back to Confirmation
Steps:
Expected: Returns to Confirmation (suffix
/per-diem-time-editstripped); time updated.Case 2.3 — Edit back button
Steps:
Expected: Returns to Confirmation, no change.
Case 2.4 — Deep-link edit + OldRoutes redirect
Steps:
/create/submit/time/123/456/edit.Expected: Redirects to
/create/submit/confirmation/123/456/per-diem-time-edit; edit mode opens on top of Confirmation.Offline tests
QA Steps
Test case 1: Open the per-diem Time step from the Destination step
/per-diem-time(no?backTo=)./per-diem-time.Test case 2: Edit the Time from the per-diem confirmation screen
/per-diem-time-edit./per-diem-time-edit.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Case 1.1 — Destination → Time forward (multi-policy)
Case 1.2 — Time back → Destination (multi-policy, cut suffix)
Case 1.3 — Single-policy Time back → Start
Case 1.4 — Time → Subrate forward
Case 1.5 — Subrate back → Time (cross-file goBack)
Case 1.6 — Deep-link + OldRoutes redirect (non-edit)
Case 2.1 — Confirmation → edit Time (forward)
Case 2.2 — Edit save → back to Confirmation
Case 2.3 — Edit back button
Case 2.4 — Deep-link edit + OldRoutes redirect