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:
Peter Keuter 2024-01-24 10:17:39 +01:00 committed by GitHub
parent a0bcf35236
commit 21bdea3b71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 13 deletions

View file

@ -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>

View file

@ -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>