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 = {
|
||||
refresh: () => void;
|
||||
canViewDetails: boolean;
|
||||
};
|
||||
|
||||
export const GroupTable = ({
|
||||
refresh: viewRefresh,
|
||||
canViewDetails,
|
||||
}: GroupTableProps) => {
|
||||
export const GroupTable = ({ refresh: viewRefresh }: GroupTableProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [selectedRows, setSelectedRows] = useState<GroupRepresentation[]>([]);
|
||||
|
@ -192,7 +188,7 @@ export const GroupTable = ({
|
|||
name: "name",
|
||||
displayKey: "groupName",
|
||||
cellRenderer: (group) =>
|
||||
canViewDetails ? (
|
||||
group.access?.view ? (
|
||||
<Link key={group.id} to={`${location.pathname}/${group.id}`}>
|
||||
{group.name}
|
||||
</Link>
|
||||
|
|
|
@ -197,10 +197,7 @@ export default function GroupsSection() {
|
|||
eventKey={0}
|
||||
title={<TabTitleText>{t("childGroups")}</TabTitleText>}
|
||||
>
|
||||
<GroupTable
|
||||
refresh={refresh}
|
||||
canViewDetails={canViewDetails}
|
||||
/>
|
||||
<GroupTable refresh={refresh} />
|
||||
</Tab>
|
||||
{canViewMembers && (
|
||||
<Tab
|
||||
|
@ -238,9 +235,7 @@ export default function GroupsSection() {
|
|||
)}
|
||||
</Tabs>
|
||||
)}
|
||||
{subGroups.length === 0 && (
|
||||
<GroupTable refresh={refresh} canViewDetails={canViewDetails} />
|
||||
)}
|
||||
{subGroups.length === 0 && <GroupTable refresh={refresh} />}
|
||||
</DrawerContentBody>
|
||||
</DrawerContent>
|
||||
</Drawer>
|
||||
|
|
Loading…
Reference in a new issue