Skip to content

Commit

Permalink
Groups should be clickable when user has view-access on the group (ke…
Browse files Browse the repository at this point in the history
…ycloak#26033)

Closes keycloak#26040

Signed-off-by: Peter Keuter <[email protected]>
  • Loading branch information
pkeuter authored Jan 24, 2024
1 parent a0bcf35 commit 21bdea3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions js/apps/admin-ui/src/groups/GroupTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>([]);
Expand Down Expand Up @@ -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>
Expand Down
9 changes: 2 additions & 7 deletions js/apps/admin-ui/src/groups/GroupsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 21bdea3

Please sign in to comment.