Convert AllSchedules route tree to react-router v6 Routes - #419
Merged
Conversation
Migrate the global schedules screen from the react-router v5 <Switch> API to v6 <Routes> via react-router-dom-v5-compat. AllSchedules renders the shared ScheduleList directly (not the nested Schedules router), so this is a single list route with no entanglement. - AllSchedules.js: <Switch> -> <Routes> with the /schedules list route using the element prop. - Rewrite the test with renderWithContexts (RTL) to mount at /schedules and assert the list resolves and the breadcrumb config is set.
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the global Schedules screen (AllSchedules) from react-router v5’s <Switch>/<Route> pattern to react-router v6’s <Routes>/<Route> using react-router-dom-v5-compat, and updates the associated test to use RTL’s renderWithContexts.
Changes:
- Converted
AllSchedulesroute tree from v5<Switch>to v6<Routes>with anelementroute. - Rewrote
AllSchedulestest to mount at/scheduleswith RTL and assert routed list rendering + breadcrumb config. - Added lightweight component mocks to make the test focus on which route branch resolves.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
awx/ui/src/screens/Schedule/AllSchedules.js |
Switches the screen to a v6 <Routes> route definition using element. |
awx/ui/src/screens/Schedule/AllSchedules.test.js |
Updates the test to RTL + memory history mounting at /schedules and asserts route resolution and breadcrumb props. |
- The v6 <Routes> only matched /schedules exactly, so a stray sub-path (e.g. /schedules/foo) rendered a blank panel; add a catch-all that redirects back to /schedules. - Guard the ScreenHeader-props assertion with a toBeDefined() so a missing render fails clearly instead of throwing a TypeError.
Contributor
Author
|
Thanks for the review. Addressed in |
cigamit
approved these changes
Jun 15, 2026
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.
SUMMARY
Continues the react-router v5 → v6 route-tree migration. Converts the global Schedules screen (
AllSchedules) from the v5<Switch>API to v6<Routes>viareact-router-dom-v5-compat.UI (no behavior change - same URL, same list):
AllSchedules.js:<Switch>-><Routes>with the/scheduleslist route using theelementprop.AllSchedulesrenders the sharedScheduleListdirectly (not the nestedSchedulesrouter), so this is a single list route with no entanglement.renderWithContexts(RTL) to mount at/schedulesand assert the list resolves and the breadcrumb config is set.ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
main.npm --prefix awx/ui run lintclean;screens/Schedule/AllSchedulestest passes.