Convert ExecutionEnvironment route tree to react-router v6 Routes - #410
Merged
cigamit merged 3 commits intoJun 15, 2026
Merged
Conversation
Migrate the ExecutionEnvironment list and detail route trees from the react-router v5 <Switch>/<Route>/<Redirect> API to v6 <Routes>/<Route> via react-router-dom-v5-compat, following the pattern used for the Application, CredentialType, NotificationTemplate and Team route trees. - ExecutionEnvironments.js: <Switch> -> <Routes>; child routes use the element prop; the detail route uses /execution_environments/:id/* so the nested <ExecutionEnvironment> tree matches the rest of the path. - ExecutionEnvironment.js: <Switch> -> <Routes> with relative child paths (edit, details, templates); the exact <Redirect> becomes an index route that <Navigate>s to details. - Convert the list test and add a detail test, both with renderWithContexts (RTL) to assert real v6 route resolution.
Under the v6 route tree the list's v5 useRouteMatch() returns match.url='/', so the add/detail links resolved to //add and //:id/details. Build them from the literal /execution_environments base instead.
Contributor
There was a problem hiding this comment.
Pull request overview
Continues the incremental react-router v5 → v6 migration by converting the ExecutionEnvironment screen’s list and detail route trees to v6-style <Routes>/<Route> via react-router-dom-v5-compat, while updating/adding RTL tests to validate route resolution and redirects.
Changes:
- Migrated
ExecutionEnvironments(list) route tree from<Switch>to<Routes>, including updating the detail route to/execution_environments/:id/*for nested matching. - Migrated
ExecutionEnvironment(detail) route tree from<Switch>/<Redirect>to<Routes>with relative child paths and an index redirect via<Navigate replace>. - Converted/added React Testing Library tests to assert real v6 route resolution, including index redirect and 404 behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironments.js | Converts the list-level routing to v6-style <Routes> and adjusts the detail path to include /* for nested routing. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironment.js | Converts the detail-level routing to v6-style nested <Routes>, using an index route redirect to details. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironmentList/ExecutionEnvironmentList.js | Removes reliance on useRouteMatch and updates links to explicit execution environment routes. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironments.test.js | Converts the list routing test to RTL and validates which route branch resolves for key URLs. |
| awx/ui/src/screens/ExecutionEnvironment/ExecutionEnvironment.test.js | Adds RTL coverage for detail routing, index redirect behavior, and 404 handling. |
Contributor
Author
|
Thanks for the review. Fixed the doubled |
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 ExecutionEnvironment screen's route trees from the v5
<Switch>/<Route>/<Redirect>API to v6<Routes>/<Route>viareact-router-dom-v5-compat, following the pattern used for the Application, CredentialType, NotificationTemplate and Team route trees.UI (no behavior change — same URLs, same panels):
ExecutionEnvironments.js(list router):<Switch>→<Routes>; child routes use theelementprop; the detail route is/execution_environments/:id/*so the nested<ExecutionEnvironment>tree can match the rest of the path.ExecutionEnvironment.js(detail router):<Switch>→<Routes>with relative child paths (edit,details,templates); theexact<Redirect>becomes an index route that<Navigate replace>s todetails.renderWithContextsto assert real v6 route resolution (which panel renders per URL, index redirect, 404 error).ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
main.screens/ExecutionEnvironmentdirectory passes (10 suites / 51 tests).npm --prefix awx/ui run lintclean on the changed source.