Use browser routing in admin UI and restore native JumpLinks behavior#51160
Open
edewit wants to merge 1 commit into
Open
Use browser routing in admin UI and restore native JumpLinks behavior#51160edewit wants to merge 1 commit into
edewit wants to merge 1 commit into
Conversation
Switch the Admin Console from hash routing to browser routing with server-side deep-link fallback, and handle routable tab clicks through React Router so tab changes stay client-side. With path-based routing in place, remove the ScrollForm hash-safe click override and rely on PatternFly JumpLinks href/node behavior, including stable anchors for bordered panels. Closes keycloak#39693 Closes keycloak#45494 Related: patternfly/patternfly-react#12223 Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the Admin Console to browser-based routing and restores native PatternFly JumpLinks behavior.
Changes:
- Adds server-side deep-link fallback and browser-router configuration.
- Routes tab clicks through React Router.
- Reworks ScrollForm anchors and updates affected Playwright URLs.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
services/.../AdminConsole.java |
Adds SPA deep-link fallback. |
js/libs/ui-shared/.../ScrollForm.tsx |
Uses native JumpLinks scrolling. |
js/libs/ui-shared/.../FormPanel.tsx |
Adds stable panel anchors. |
js/apps/admin-ui/test/.../saml-signature-defaults.spec.ts |
Updates browser-route URL. |
js/apps/admin-ui/test/.../main.ts |
Updates navigation helper URL. |
js/apps/admin-ui/test/.../default-trust.spec.ts |
Updates browser-route URL. |
js/apps/admin-ui/src/main.tsx |
Configures browser routing and legacy URL migration. |
js/apps/admin-ui/src/context/.../useHash.tsx |
Removes obsolete hash tracking. |
js/apps/admin-ui/src/context/.../RealmContext.tsx |
Derives realms from pathnames. |
js/apps/admin-ui/src/components/.../RoutableTabs.tsx |
Adds client-side tab navigation handlers. |
js/apps/admin-ui/src/App.tsx |
Removes hash cleanup logic. |
Comment on lines
+73
to
+75
| scrollableSelector={`#${mainPageContentId}`} | ||
| label={label} | ||
| offset={100} |
|
|
||
| if (window.location.hash.startsWith("#/")) { | ||
| const hashPath = decodeURIComponent(window.location.hash.substring(1)); | ||
| window.history.replaceState(null, "", `${basename}${hashPath}`); |
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.
Switch the Admin Console from hash routing to browser routing with
server-side deep-link fallback, and handle routable tab clicks through
React Router so tab changes stay client-side. With path-based routing in
place, remove the ScrollForm hash-safe click override and rely on
PatternFly JumpLinks href/node behavior, including stable anchors for
bordered panels.
Closes #32979
Closes #45494
Related: patternfly/patternfly-react#12223
Signed-off-by: Erik Jan de Wit erikjan.dewit@gmail.com