Groups should be clickable when user has view-access on the group (#26033)
Closes #26040 Signed-off-by: Peter Keuter <github@peterkeuter.nl>
This commit is contained in:
parent
a0bcf35236
commit
21bdea3b71
2 changed files with 4 additions and 13 deletions
|
@ -22,13 +22,9 @@ import { adminClient } from "../admin-client";
|
||||||
|
|
||||||
type GroupTableProps = {
|
type GroupTableProps = {
|
||||||
refresh: () => void;
|
refresh: () => void;
|
||||||
canViewDetails: boolean;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const GroupTable = ({
|
export const GroupTable = ({ refresh: viewRefresh }: GroupTableProps) => {
|
||||||
refresh: viewRefresh,
|
|
||||||
canViewDetails,
|
|
||||||
}: GroupTableProps) => {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [selectedRows, setSelectedRows] = useState<GroupRepresentation[]>([]);
|
const [selectedRows, setSelectedRows] = useState<GroupRepresentation[]>([]);
|
||||||
|
@ -192,7 +188,7 @@ export const GroupTable = ({
|
||||||
name: "name",
|
name: "name",
|
||||||
displayKey: "groupName",
|
displayKey: "groupName",
|
||||||
cellRenderer: (group) =>
|
cellRenderer: (group) =>
|
||||||
canViewDetails ? (
|
group.access?.view ? (
|
||||||
<Link key={group.id} to={`${location.pathname}/${group.id}`}>
|
<Link key={group.id} to={`${location.pathname}/${group.id}`}>
|
||||||
{group.name}
|
{group.name}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -197,10 +197,7 @@ export default function GroupsSection() {
|
||||||
eventKey={0}
|
eventKey={0}
|
||||||
title={<TabTitleText>{t("childGroups")}</TabTitleText>}
|
title={<TabTitleText>{t("childGroups")}</TabTitleText>}
|
||||||
>
|
>
|
||||||
<GroupTable
|
<GroupTable refresh={refresh} />
|
||||||
refresh={refresh}
|
|
||||||
canViewDetails={canViewDetails}
|
|
||||||
/>
|
|
||||||
</Tab>
|
</Tab>
|
||||||
{canViewMembers && (
|
{canViewMembers && (
|
||||||
<Tab
|
<Tab
|
||||||
|
@ -238,9 +235,7 @@ export default function GroupsSection() {
|
||||||
)}
|
)}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
)}
|
)}
|
||||||
{subGroups.length === 0 && (
|
{subGroups.length === 0 && <GroupTable refresh={refresh} />}
|
||||||
<GroupTable refresh={refresh} canViewDetails={canViewDetails} />
|
|
||||||
)}
|
|
||||||
</DrawerContentBody>
|
</DrawerContentBody>
|
||||||
</DrawerContent>
|
</DrawerContent>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
Loading…
Reference in a new issue