Events css fixes (#1074)

* admin events: decreased form width and spaces between fields

* events: css fixes

Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2021-08-26 10:15:59 +01:00 committed by GitHub
parent 9850505001
commit 2657eaf1d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 387 additions and 389 deletions

View file

@ -3,8 +3,6 @@ import {
Button, Button,
Dropdown, Dropdown,
DropdownToggle, DropdownToggle,
Flex,
FlexItem,
Form, Form,
FormGroup, FormGroup,
Modal, Modal,
@ -13,6 +11,7 @@ import {
SelectVariant, SelectVariant,
TextInput, TextInput,
Tooltip, Tooltip,
ToolbarItem,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import { import {
cellWidth, cellWidth,
@ -160,12 +159,11 @@ export const AdminEvents = () => {
const adminEventSearchFormDisplay = () => { const adminEventSearchFormDisplay = () => {
return ( return (
<> <>
<Flex direction={{ default: "column" }}> <ToolbarItem>
<FlexItem>
<Dropdown <Dropdown
id="admin-events-search-select" id="admin-events-search-select"
data-testid="AdminEventsSearchSelector" data-testid="AdminEventsSearchSelector"
className="pf-u-mt-md pf-u-ml-md pf-u-mb-md" className="pf-u-ml-md"
toggle={ toggle={
<DropdownToggle <DropdownToggle
data-testid="adminEventsSearchSelectorToggle" data-testid="adminEventsSearchSelectorToggle"
@ -179,13 +177,13 @@ export const AdminEvents = () => {
> >
<Form <Form
isHorizontal isHorizontal
className="keycloak__events_search__form" className="keycloak__admin_events_search__form"
data-testid="searchForm" data-testid="searchForm"
> >
<FormGroup <FormGroup
label={t("resourceType")} label={t("resourceType")}
fieldId="kc-resourceType" fieldId="kc-resourceType"
className="keycloak__events_search__form_label" className="keycloak__events_search__form_multiline_label"
> >
<Select <Select
variant={SelectVariant.single} variant={SelectVariant.single}
@ -196,7 +194,7 @@ export const AdminEvents = () => {
<FormGroup <FormGroup
label={t("operationType")} label={t("operationType")}
fieldId="kc-operationType" fieldId="kc-operationType"
className="keycloak__events_search__form_label" className="keycloak__events_search__form_multiline_label"
> >
<Select <Select
variant={SelectVariant.single} variant={SelectVariant.single}
@ -290,8 +288,7 @@ export const AdminEvents = () => {
> >
{t("refresh")} {t("refresh")}
</Button> </Button>
</FlexItem> </ToolbarItem>
</Flex>
</> </>
); );
}; };

View file

@ -9,8 +9,6 @@ import {
DescriptionListTerm, DescriptionListTerm,
Dropdown, Dropdown,
DropdownToggle, DropdownToggle,
Flex,
FlexItem,
Form, Form,
FormGroup, FormGroup,
PageSection, PageSection,
@ -21,6 +19,7 @@ import {
TabTitleText, TabTitleText,
TextInput, TextInput,
Tooltip, Tooltip,
ToolbarItem,
} from "@patternfly/react-core"; } from "@patternfly/react-core";
import { CheckCircleIcon, WarningTriangleIcon } from "@patternfly/react-icons"; import { CheckCircleIcon, WarningTriangleIcon } from "@patternfly/react-icons";
import { cellWidth, expandable } from "@patternfly/react-table"; import { cellWidth, expandable } from "@patternfly/react-table";
@ -185,12 +184,11 @@ export const EventsSection = () => {
const userEventSearchFormDisplay = () => { const userEventSearchFormDisplay = () => {
return ( return (
<> <>
<Flex direction={{ default: "column" }}> <ToolbarItem>
<FlexItem>
<Dropdown <Dropdown
id="user-events-search-select" id="user-events-search-select"
data-testid="UserEventsSearchSelector" data-testid="UserEventsSearchSelector"
className="pf-u-mt-md pf-u-ml-md" className="pf-u-ml-md"
toggle={ toggle={
<DropdownToggle <DropdownToggle
data-testid="userEventsSearchSelectorToggle" data-testid="userEventsSearchSelectorToggle"
@ -204,7 +202,7 @@ export const EventsSection = () => {
> >
<Form <Form
isHorizontal isHorizontal
className="keycloak__events_search__form" className="keycloak__user_events_search__form"
data-testid="searchForm" data-testid="searchForm"
> >
<FormGroup <FormGroup
@ -348,8 +346,8 @@ export const EventsSection = () => {
> >
{t("refresh")} {t("refresh")}
</Button> </Button>
</FlexItem> </ToolbarItem>
<FlexItem> <ToolbarItem>
{Object.entries(activeFilters).length > 0 && ( {Object.entries(activeFilters).length > 0 && (
<div className="keycloak__searchChips pf-u-ml-md"> <div className="keycloak__searchChips pf-u-ml-md">
{Object.entries(activeFilters).map((filter) => { {Object.entries(activeFilters).map((filter) => {
@ -383,8 +381,7 @@ export const EventsSection = () => {
})} })}
</div> </div>
)} )}
</FlexItem> </ToolbarItem>
</Flex>
</> </>
); );
}; };
@ -411,7 +408,6 @@ export const EventsSection = () => {
eventKey="userEvents" eventKey="userEvents"
title={<TabTitleText>{t("userEvents")}</TabTitleText>} title={<TabTitleText>{t("userEvents")}</TabTitleText>}
> >
<div className="keycloak__events_table">
<KeycloakDataTable <KeycloakDataTable
key={key} key={key}
loader={loader} loader={loader}
@ -461,7 +457,6 @@ export const EventsSection = () => {
</div> </div>
} }
/> />
</div>
</Tab> </Tab>
<Tab <Tab
eventKey="adminEvents" eventKey="adminEvents"

View file

@ -8,10 +8,18 @@
z-index: 1; z-index: 1;
} }
.keycloak__events_search__form { .keycloak__user_events_search__form {
--pf-c-form--m-horizontal__group-control--md--GridColumnWidth: 24rem;
}
.keycloak__admin_events_search__form {
--pf-c-form--m-horizontal__group-control--md--GridColumnWidth: 12rem;
}
.keycloak__user_events_search__form,
.keycloak__admin_events_search__form {
margin: 0 var(--pf-global--spacer--lg) var(--pf-global--spacer--lg) var(--pf-global--spacer--lg); margin: 0 var(--pf-global--spacer--lg) var(--pf-global--spacer--lg) var(--pf-global--spacer--lg);
--pf-c-form__group--m-action--MarginTop: 0rem; --pf-c-form__group--m-action--MarginTop: 0rem;
--pf-c-form--m-horizontal__group-control--md--GridColumnWidth: 24rem;
--pf-c-form--m-horizontal__group-label--md--GridColumnWidth: 5rem; --pf-c-form--m-horizontal__group-label--md--GridColumnWidth: 5rem;
} }
@ -19,13 +27,11 @@
--pf-c-form--m-horizontal__group-label--md--GridColumnWidth: 5rem; --pf-c-form--m-horizontal__group-label--md--GridColumnWidth: 5rem;
} }
.keycloak__events_search__form_multiline_label {
height: 2.2rem;
}
.keycloak__events_search__event_type_select .pf-c-select__menu { .keycloak__events_search__event_type_select .pf-c-select__menu {
max-height: 200px; max-height: 200px;
overflow: auto; overflow: auto;
} }
.pf-c-toolbar {
background-color: transparent;
--pf-c-toolbar--PaddingTop: 0;
--pf-c-toolbar--PaddingBottom: 0;
}