8000 Fix nested group URLs in the admin console by georgepstaylor · Pull Request #52389 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix nested group URLs in the admin console - #52389

Merged
stianst merged 3 commits into
keycloak:mainfrom
georgepstaylor:fix-group-hierarchy-url
Sep 4, 2026
Merged

stianst merged 3 commits into
keycloak:mainfrom
georgepstaylor:fix-group-hierarchy-url

Conversation

@georgepstaylor
@georgepstaylor georgepstaylor commented Sep 3, 2026 •
Copy link
Copy Markdown
Contributor

Fixes #52241

Clicking a child group in the admin console currently builds a URL with %2F between the parent and child IDs, so the group details page fails to load.

This started with 26.7.3 when PR #52136 upgraded React Router from 6.30.4 to 7.18.2 (commit). React Router 7 now escapes / in :id parameters. Since the group URL builder passes the whole hierarchy as one ID, the separator gets escaped too.

The fix builds the nested path as separate URL segments instead of passing the whole hierarchy through a single :id parameter. Tests cover both realm and organization group paths.

Tested with:
vitest run src/groups/__tests__/Groups.test.ts

Copilot AI balanced review requested due to automatic review settings September 3, 2026 14:52
@georgepstaylor
georgepstaylor requested review from a team as code owners September 3, 2026 14:52
Signed-off-by: George Taylor <3026030+georgepstaylor@users.noreply.github.com>
@georgepstaylor
georgepstaylor force-pushed the fix-group-hierarchy-url branch from c30f4c0 to c741fe6 Compare September 3, 2026 14:55
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Fixes nested group navigation in the admin console by avoiding React Router’s dynamic param encoding of / for hierarchical group IDs and adding regression tests to prevent regressions.

Changes:

  • Update toGroups() to generate URLs via the wildcard route (*) so nested IDs like parent/child remain unencoded.
  • Add Vitest regression coverage for realm and organization nested group URL generation.
  • Add a test for root groups URL generation when no id is provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
js/apps/admin-ui/src/groups/routes/Groups.tsx Switch URL generation to use the wildcard (*) param so nested group paths keep / separators.
js/apps/admin-ui/src/groups/tests/Groups.test.ts Add regression tests covering nested realm/org group URL generation and root groups URL.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 3, 2026 15:08
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Copilot AI review requested due to automatic review settings September 4, 2026 08:31
edewit
edewit previously approved these changes Sep 4, 2026
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused routing fix correctly addresses the regression and includes suitable tests.

Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

LeftNav resolves access by matching registered routes to nav paths.
After removing the legacy groups :id route, the remaining splat route
no longer matched /groups, so the Groups sidebar item was hidden.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Copilot AI review requested due to automatic review settings September 4, 2026 10:29
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation addresses the regression and includes appropriate coverage for both affected routing contexts.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@stianst
stianst disabled auto-merge September 4, 2026 11:40
@stianst
stianst merged commit cbb99d4 into keycloak:main Sep 4, 2026
72 checks passed
@jan-sarao jan-sarao mentioned this pull request Sep 9, 2026
2 tasks done
stianst pushed a commit that referenced this pull request Sep 16, 2026
* Fix nested group URL generation



* removue unused group with id route



* Fix Groups nav item matching for splat routes

LeftNav resolves access by matching registered routes to nav paths.
After removing the legacy groups :id route, the remaining splat route
no longer matched /groups, so the Groups sidebar item was hidden.



---------




(cherry picked from commit cbb99d4)

Signed-off-by: George Taylor <3026030+georgepstaylor@users.noreply.github.com>
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Co-authored-by: George Taylor <3026030+georgepstaylor@users.noreply.github.com>
stianst pushed a commit that referenced this pull request Sep 16, 2026
* Fix nested group URL generation



* removue unused group with id route



* Fix Groups nav item matching for splat routes

LeftNav resolves access by matching registered routes to nav paths.
After removing the legacy groups :id route, the remaining splat route
no longer matched /groups, so the Groups sidebar item was hidden.



---------




(cherry picked from commit cbb99d4)

Signed-off-by: George Taylor <3026030+georgepstaylor@users.noreply.github.com>
Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
Co-authored-by: George Taylor <3026030+georgepstaylor@users.noreply.github.com>
@stianst stianst mentioned this pull request Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking on a sub group in the admin console throws an exception

4 participants

0