From 32492152aa899594c9837c6f8000ad4ce6812486 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Wed, 23 Jun 2021 12:42:14 +0200 Subject: [PATCH] fixed issue fixing: #706 --- public/index.css | 10 +- .../table-toolbar/KeycloakDataTable.tsx | 3 +- src/realm-roles/RealmRoleTabs.tsx | 1 + src/user/UserGroups.tsx | 193 +++++++++--------- src/user/UsersSection.tsx | 2 +- src/user/UsersTabs.tsx | 4 +- src/user/user-section.css | 30 +-- 7 files changed, 114 insertions(+), 129 deletions(-) diff --git a/public/index.css b/public/index.css index 6a04ea7a48..4e85418721 100644 --- a/public/index.css +++ b/public/index.css @@ -10,6 +10,12 @@ margin-bottom: 52px; } +input[type='checkbox'] { + height: 20px; + width: 20px; + vertical-align: baseline; +} + label.pf-c-form__label { display: inline-flex; } @@ -46,8 +52,8 @@ label.pf-c-form__label { cursor: pointer; } -td.pf-c-table__check > input { - vertical-align: baseline; +td.pf-c-table__check > input[type='checkbox'] { + vertical-align: text-bottom; } .pf-c-table.tbody.pf-c-table__check > input { diff --git a/src/components/table-toolbar/KeycloakDataTable.tsx b/src/components/table-toolbar/KeycloakDataTable.tsx index 432c69c1a6..d7839aba45 100644 --- a/src/components/table-toolbar/KeycloakDataTable.tsx +++ b/src/components/table-toolbar/KeycloakDataTable.tsx @@ -15,6 +15,7 @@ import { Table, TableBody, TableHeader, + TableProps, TableVariant, } from "@patternfly/react-table"; import { Spinner } from "@patternfly/react-core"; @@ -119,7 +120,7 @@ export type Action = IAction & { onRowClick?: (row: T) => Promise | void; }; -export type DataListProps = { +export type DataListProps = Omit & { loader: (first?: number, max?: number, search?: string) => Promise; onSelect?: (value: T[]) => void; canSelectAll?: boolean; diff --git a/src/realm-roles/RealmRoleTabs.tsx b/src/realm-roles/RealmRoleTabs.tsx index f1af8d7ea6..cec0c09636 100644 --- a/src/realm-roles/RealmRoleTabs.tsx +++ b/src/realm-roles/RealmRoleTabs.tsx @@ -324,6 +324,7 @@ export const RealmRoleTabs = () => { subKey={id ? "" : "roles:roleCreateExplain"} actionsDropdownId="roles-actions-dropdown" dropdownItems={dropdownItems} + divider={!id} /> {id && ( diff --git a/src/user/UserGroups.tsx b/src/user/UserGroups.tsx index f21f57375f..034eb52d88 100644 --- a/src/user/UserGroups.tsx +++ b/src/user/UserGroups.tsx @@ -276,104 +276,103 @@ export const UserGroups = () => { return ( <> - - - {open && ( - setOpen(false)} - onConfirm={(groups) => { - addGroups(groups); - setOpen(false); - }} - /> - )} - {}} - toolbarItem={ - <> - - setDirectMembership(!isDirectMembership)} - isChecked={isDirectMembership} - className="direct-membership-check" - /> - {enabled && ( - {t("whoWillAppearPopoverText")}} - > - - - )} - - } - columns={[ - { - name: "groupMembership", - displayKey: "users:groupMembership", - cellRenderer: AliasRenderer, - cellFormatters: [emptyFormatter()], - transforms: [cellWidth(40)], - }, - { - name: "path", - displayKey: "users:path", - cellRenderer: Path, - transforms: [cellWidth(45)], - }, - - { - name: "", - cellRenderer: LeaveButtonRenderer, - cellFormatters: [emptyFormatter()], - transforms: [cellWidth(20)], - }, - ]} - emptyState={ - !search ? ( - - ) : ( - "" - ) - } + + {open && ( + setOpen(false)} + onConfirm={(groups) => { + addGroups(groups); + setOpen(false); + }} /> - + )} + {}} + toolbarItem={ + <> + + setDirectMembership(!isDirectMembership)} + isChecked={isDirectMembership} + className="direct-membership-check" + /> + {enabled && ( + {t("whoWillAppearPopoverText")}} + > + + + )} + + } + columns={[ + { + name: "groupMembership", + displayKey: "users:groupMembership", + cellRenderer: AliasRenderer, + cellFormatters: [emptyFormatter()], + transforms: [cellWidth(40)], + }, + { + name: "path", + displayKey: "users:path", + cellRenderer: Path, + transforms: [cellWidth(45)], + }, + + { + name: "", + cellRenderer: LeaveButtonRenderer, + cellFormatters: [emptyFormatter()], + transforms: [cellWidth(20)], + }, + ]} + emptyState={ + !search ? ( + + ) : ( + "" + ) + } + /> ); }; diff --git a/src/user/UsersSection.tsx b/src/user/UsersSection.tsx index b926caf42e..a0b3de4582 100644 --- a/src/user/UsersSection.tsx +++ b/src/user/UsersSection.tsx @@ -1,5 +1,6 @@ import React, { useContext, useState } from "react"; import { useTranslation } from "react-i18next"; +import { Link, useHistory, useRouteMatch } from "react-router-dom"; import { AlertVariant, Button, @@ -27,7 +28,6 @@ import { emptyFormatter } from "../util"; import { useConfirmDialog } from "../components/confirm-dialog/ConfirmDialog"; import "./user-section.css"; -import { Link, useHistory, useRouteMatch } from "react-router-dom"; type BruteUser = UserRepresentation & { brute?: Record; diff --git a/src/user/UsersTabs.tsx b/src/user/UsersTabs.tsx index 405ebf1552..164a90325c 100644 --- a/src/user/UsersTabs.tsx +++ b/src/user/UsersTabs.tsx @@ -99,9 +99,7 @@ export const UsersTabs = () => { data-testid="user-groups-tab" title={{t("groups")}} > - - - + div > input { - height: 20px; - width: 20px; -} - -.data-list-check > input { - height: 20px; - width: 20px; -} - -td.pf-c-table__check > input { - height: 20px; - width: 20px; - vertical-align: text-top; -} .pf-c-toolbar__content-section { margin-bottom: calc(var(--pf-global--spacer--lg) * -1); @@ -59,7 +39,7 @@ td.pf-c-table__check > input { padding: 0px; } -.pf-c-chip-group__list-item { +.kc-consents-chip-group .pf-c-chip-group__list-item { margin-right: 0px; }