chihsuan opened a new pull request, #10168:
URL: https://github.com/apache/ozone/pull/10168
## What changes were proposed in this pull request?
Recon's Old and New UIs share most routes but have asymmetric paths:
`/Capacity` exists only in the New UI, `/MissingContainers` only in the Old UI.
The "Switch to" toggle in the header previously swapped the active routes table
without rewriting the URL hash, so users on a UI-exclusive path were dropped
onto the bottom `<Route component={NotFound}>` fallback after toggling,
producing a "404 Page Not Found :(" screen.
This change validates the current path against the destination UI's route
table on toggle. If the path is absent, the toggle:
1. Redirects the URL hash to `/Overview` so the destination UI lands on its
dashboard
2. Shows an antd `message.info` toast (4s) explaining where the view
actually lives
3. Persists `enableOldUI` to `sessionStorage` as before (no behavior change
there)
Both directions are covered: New → Old on `/Capacity` (the case the Jira
filed) and Old → New on `/MissingContainers` (a symmetric pre-existing bug with
the same root cause). Parameterized routes are filtered when checking
route-table membership so the v1 `/:NotFound` catch-all does not falsely match
every path.
`/Capacity` was also added to the v2 breadcrumb name map so the toast text
and breadcrumb display both refer to it as "Cluster Capacity".
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15148
## How was this patch tested?
Manually, using the Recon UI dev server (`pnpm dev` under
`hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web`):
- Navigate to `#/Capacity` (New UI) → toggle to Old UI → URL flips to
`#/Overview`, Old UI Overview renders, info toast shown.
- Navigate to `#/MissingContainers` (Old UI) → toggle to New UI → URL flips
to `#/Overview`, New UI Overview renders, info toast shown.
- Toggle on a shared path (e.g. `#/Volumes`) → no redirect, no toast, no
regression.
- Toggle on a typo'd / non-existent path → silent redirect to `/Overview`,
no misleading toast.
Screenshots will be attached before marking the PR ready for review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]