From db315b59f6b347617960e18699b3f53a78546658 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 12 Jun 2023 12:50:26 +0200 Subject: [PATCH] use ui ext groups endpoint (#20772) so that we have filtering for fine grained groups fixes: https://github.com/keycloak/keycloak/issues/19655#issuecomment-1573350358 --- .../src/components/group/GroupPickerDialog.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx b/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx index 447262bd1b..edfe42210b 100644 --- a/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx +++ b/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx @@ -24,6 +24,7 @@ import { PaginatingTableToolbar } from "../table-toolbar/PaginatingTableToolbar" import { GroupPath } from "./GroupPath"; import "./group-picker-dialog.css"; +import { fetchAdminUI } from "../../context/auth/admin-ui-endpoint"; export type GroupPickerDialogProps = { id?: string; @@ -72,11 +73,16 @@ export const GroupPickerDialog = ({ let existingUserGroups; let count = 0; if (!groupId) { - groups = await adminClient.groups.find({ - first, - max: max + (isSearching ? 0 : 1), - search: isSearching ? filter : "", - }); + groups = await fetchAdminUI( + "ui-ext/groups", + Object.assign( + { + first: `${first}`, + max: `${max + 1}`, + }, + isSearching ? null : { search: filter } + ) + ); } else if (!navigation.map(({ id }) => id).includes(groupId)) { group = await adminClient.groups.findOne({ id: groupId }); if (!group) {