From 1cd20e0e433854ab75035c9c1dd9dfe3bf65b993 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 16 Oct 2023 21:20:12 +0200 Subject: [PATCH] always allow browsing as we don't know the subgroups (#23657) fixes: #23582 --- .../components/group/GroupPickerDialog.tsx | 21 +++++++------------ .../components/group/group-picker-dialog.css | 4 ++++ .../src/groups/components/MoveDialog.tsx | 1 + 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx b/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx index 417660f0fd..a346fd390f 100644 --- a/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx +++ b/js/apps/admin-ui/src/components/group/GroupPickerDialog.tsx @@ -16,15 +16,14 @@ import { import { AngleRightIcon } from "@patternfly/react-icons"; import { useState } from "react"; import { useTranslation } from "react-i18next"; - import { adminClient } from "../../admin-client"; +import { fetchAdminUI } from "../../context/auth/admin-ui-endpoint"; import { useFetch } from "../../utils/useFetch"; import { ListEmptyState } from "../list-empty-state/ListEmptyState"; 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; @@ -32,6 +31,7 @@ export type GroupPickerDialogProps = { filterGroups?: GroupRepresentation[]; text: { title: string; ok: string }; canBrowse?: boolean; + isMove?: boolean; onConfirm: (groups: GroupRepresentation[] | undefined) => void; onClose: () => void; }; @@ -46,6 +46,7 @@ export const GroupPickerDialog = ({ filterGroups, text, canBrowse = true, + isMove = false, onClose, onConfirm, }: GroupPickerDialogProps) => { @@ -257,7 +258,7 @@ export const GroupPickerDialog = ({ )} {groups.length === 0 && isSearching && ( @@ -296,9 +297,6 @@ const GroupRow = ({ }: GroupRowProps) => { const { t } = useTranslation(); - const hasSubgroups = (group: GroupRepresentation) => - group.subGroups?.length !== 0; - return ( { if (type === "selectOne") { onSelect(group.id!); - } else if ( - hasSubgroups(group) && - (e.target as HTMLInputElement).type !== "checkbox" - ) { + } else if ((e.target as HTMLInputElement).type !== "checkbox") { onSelect(group.id!); setIsSearching(false); } }} > @@ -364,7 +359,7 @@ const GroupRow = ({ aria-label={t("groupName")} isPlainButtonAction > - {((hasSubgroups(group) && canBrowse) || type === "selectOne") && ( + {(canBrowse || type === "selectOne") && ( diff --git a/js/apps/admin-ui/src/components/group/group-picker-dialog.css b/js/apps/admin-ui/src/components/group/group-picker-dialog.css index cbac7b87a3..7df2ccf3dc 100644 --- a/js/apps/admin-ui/src/components/group/group-picker-dialog.css +++ b/js/apps/admin-ui/src/components/group/group-picker-dialog.css @@ -2,4 +2,8 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +} + +.join-group-dialog-row { + cursor: pointer; } \ No newline at end of file diff --git a/js/apps/admin-ui/src/groups/components/MoveDialog.tsx b/js/apps/admin-ui/src/groups/components/MoveDialog.tsx index f43e7db123..3672f8278b 100644 --- a/js/apps/admin-ui/src/groups/components/MoveDialog.tsx +++ b/js/apps/admin-ui/src/groups/components/MoveDialog.tsx @@ -45,6 +45,7 @@ export const MoveDialog = ({ source, onClose, refresh }: MoveDialogProps) => { }} onClose={onClose} onConfirm={moveGroup} + isMove /> ); };