From 0baeff171aecf76c0bf38788bf221bc44c5ea838 Mon Sep 17 00:00:00 2001 From: Martin Kanis Date: Mon, 29 Sep 2025 13:51:36 +0200 Subject: [PATCH] Username containing a '#' is truncated in Admin Console when hiding inherited roles (#42950) Closes #42949 Signed-off-by: Martin Kanis --- .../src/components/role-mapping/resource.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/apps/admin-ui/src/components/role-mapping/resource.ts b/js/apps/admin-ui/src/components/role-mapping/resource.ts index a460a4fcbf8..e7249c02f21 100644 --- a/js/apps/admin-ui/src/components/role-mapping/resource.ts +++ b/js/apps/admin-ui/src/components/role-mapping/resource.ts @@ -32,11 +32,15 @@ const fetchEndpoint = async ( adminClient: KeycloakAdminClient, { id, type, first, max, search, endpoint }: Query, ): Promise => - fetchAdminUI(adminClient, `/ui-ext/${endpoint}/${type}/${id}`, { - first: (first || 0).toString(), - max: (max || 10).toString(), - search: search || "", - }); + fetchAdminUI( + adminClient, + `/ui-ext/${endpoint}/${type}/${encodeURIComponent(id!)}`, + { + first: (first || 0).toString(), + max: (max || 10).toString(), + search: search || "", + }, + ); export const getAvailableClientRoles = ( adminClient: KeycloakAdminClient,