Migrate money request subrate step to dynamic routes (#83850 part 3)#96964
Draft
suneox wants to merge 1 commit into
Draft
Migrate money request subrate step to dynamic routes (#83850 part 3)#96964suneox wants to merge 1 commit into
suneox wants to merge 1 commit into
Conversation
…part 3) Migrate MONEY_REQUEST_STEP_SUBRATE (path `subrate/:pageIndex`, entry STEP_TIME) and MONEY_REQUEST_STEP_SUBRATE_EDIT (path `subrate-edit/:pageIndex`, entry STEP_CONFIRMATION) to dynamic routes, removing their static routes and the `backTo` param. The `pageIndex` path param is carried via getRoute. - Rename IOURequestStepSubrate -> DynamicIOURequestStepSubrate; edit mode from route.name, back path from useDynamicBackPath (parametric suffix). - Time forward and confirmation goBack build the subrate route on the time base via createDynamicRoute; confirmation edit uses getRoute(index). - Add OldRoutes redirects (pageIndex preserved) + getMatchingNewRoute 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 Subrate step (
MONEY_REQUEST_STEP_SUBRATE, pathper-diem-subrate/:pageIndex, entry fromSTEP_TIME) and its edit variant (MONEY_REQUEST_STEP_SUBRATE_EDIT, pathper-diem-subrate-edit/:pageIndex, entry fromSTEP_CONFIRMATION) from static routes to dynamic URL navigation, removing thebackTo/backToReportparams. ThepageIndexis a real path param carried viagetRoute(index). The step page is renamedIOURequestStepSubrate→DynamicIOURequestStepSubrate; edit mode is derived fromroute.nameand the back path fromuseDynamicBackPath(cutting the parametric suffix). The Time forward and confirmation goBack build the subrate route on the Time base viacreateDynamicRoute; confirmation edit usesgetRoute(index). OldRoutes redirects preservepageIndex. Part 3 of #83850 (Destination is Part 1, Time is Part 2).Fixed Issues
$ #83850
PROPOSAL:
Tests
DYNAMIC_ROUTES.MONEY_REQUEST_STEP_SUBRATE— wizard subrate step (non-edit)Case 1.1 — Time → Subrate forward
Target:
IOURequestStepTime.tsx:133Precondition: per-diem flow reached the Time step (destination + workspace already chosen).
Steps:
Expected: The Subrate step opens; URL
.../time/<txn>/<rpt>/per-diem-subrate/0; subrate picker + quantity shown (pageIndex 0).Case 1.2 — Subrate back → Time (cut parametric suffix)
Steps:
Expected: Returns to Time (suffix
/per-diem-subrate/0stripped). No/not-found.Case 1.3 — Subrate submit → Confirmation
Steps:
Expected: Navigates to Confirmation (static route, Part 3 has not migrated Confirmation).
Case 1.4 — Confirmation back → Subrate (cross-file goBack)
Target:
IOURequestStepConfirmation.tsx:721Steps:
Expected: Returns to the dynamic Subrate step. No
/not-found.Case 1.5 — Deep-link + OldRoutes redirect (keeps pageIndex)
Steps:
/create/submit/subrate/123/456/0.Expected: Redirects to⚠️ Legacy query / backToReport not preserved (accepted).
/create/submit/time/123/456/per-diem-subrate/0; Subrate opens.DYNAMIC_ROUTES.MONEY_REQUEST_STEP_SUBRATE_EDIT— edit subrate from Confirmation (pageIndex)Case 2.1 — Confirmation → edit Subrate (forward, index)
Target:
PerDiemFields.tsx:55Precondition: Confirmation of a per-diem expense with ≥1 subrate.
Steps:
Expected: Subrate opens in edit mode, title = "Subrate"; URL
.../confirmation/<txn>/<rpt>/per-diem-subrate-edit/1; the correct subrate (index 1) is shown.Case 2.2 — Edit save → back to Confirmation
Steps:
Expected: Returns to Confirmation (suffix
/per-diem-subrate-edit/1stripped); subrate updated.Case 2.3 — Edit delete subrate (3-dots menu)
Steps:
Expected: Subrate deleted → returns to Confirmation (goBack backPath).
Case 2.4 — Deep-link edit + OldRoutes redirect
Steps:
/create/submit/subrate/123/456/edit/2.Expected: Redirects to
/create/submit/confirmation/123/456/per-diem-subrate-edit/2; edit mode at index 2.Offline tests
pageIndexcarried as a path param). No network/API behavior changed; offline forward/back/deep-link behavior is unchanged.QA Steps
Test case 1: Open the per-diem Subrate step from the Time step
/per-diem-subrate/0(no?backTo=)./per-diem-subrate/0.Test case 2: Edit a subrate from the per-diem confirmation screen
/per-diem-subrate-edit/0./per-diem-subrate-edit/0.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 — Time → Subrate forward
Case 1.2 — Subrate back → Time (cut parametric suffix)
Case 1.3 — Subrate submit → Confirmation
Case 1.4 — Confirmation back → Subrate (cross-file goBack)
Case 1.5 — Deep-link + OldRoutes redirect (keeps pageIndex)
Case 2.1 — Confirmation → edit Subrate (forward, index)
Case 2.2 — Edit save → back to Confirmation
Case 2.3 — Edit delete subrate (3-dots menu)
Case 2.4 — Deep-link edit + OldRoutes redirect