events: reverted to Flex (#1076)

Co-authored-by: Agnieszka Gancarczyk <agancarc@redhat.com>
This commit is contained in:
agagancarczyk 2021-08-26 11:37:56 +01:00 committed by GitHub
parent 2657eaf1d8
commit 764421033f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 392 additions and 378 deletions

View file

@ -3,6 +3,8 @@ import {
Button,
Dropdown,
DropdownToggle,
Flex,
FlexItem,
Form,
FormGroup,
Modal,
@ -11,7 +13,6 @@ import {
SelectVariant,
TextInput,
Tooltip,
ToolbarItem,
} from "@patternfly/react-core";
import {
cellWidth,
@ -159,7 +160,11 @@ export const AdminEvents = () => {
const adminEventSearchFormDisplay = () => {
return (
<>
<ToolbarItem>
<Flex
direction={{ default: "column" }}
spaceItems={{ default: "spaceItemsNone" }}
>
<FlexItem>
<Dropdown
id="admin-events-search-select"
data-testid="AdminEventsSearchSelector"
@ -288,7 +293,8 @@ export const AdminEvents = () => {
>
{t("refresh")}
</Button>
</ToolbarItem>
</FlexItem>
</Flex>
</>
);
};

View file

@ -9,6 +9,8 @@ import {
DescriptionListTerm,
Dropdown,
DropdownToggle,
Flex,
FlexItem,
Form,
FormGroup,
PageSection,
@ -19,13 +21,12 @@ import {
TabTitleText,
TextInput,
Tooltip,
ToolbarItem,
} from "@patternfly/react-core";
import { CheckCircleIcon, WarningTriangleIcon } from "@patternfly/react-icons";
import { cellWidth, expandable } from "@patternfly/react-table";
import type EventRepresentation from "@keycloak/keycloak-admin-client/lib/defs/eventRepresentation";
import type EventType from "@keycloak/keycloak-admin-client/lib/defs/eventTypes";
import type { RealmEventsConfigRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/realmEventsConfigRepresentation";
import type EventRepresentation from "keycloak-admin/lib/defs/eventRepresentation";
import type EventType from "keycloak-admin/lib/defs/eventTypes";
import type { RealmEventsConfigRepresentation } from "keycloak-admin/lib/defs/realmEventsConfigRepresentation";
import { pickBy } from "lodash";
import moment from "moment";
import React, { useState } from "react";
@ -184,7 +185,11 @@ export const EventsSection = () => {
const userEventSearchFormDisplay = () => {
return (
<>
<ToolbarItem>
<Flex
direction={{ default: "column" }}
spaceItems={{ default: "spaceItemsNone" }}
>
<FlexItem>
<Dropdown
id="user-events-search-select"
data-testid="UserEventsSearchSelector"
@ -346,8 +351,8 @@ export const EventsSection = () => {
>
{t("refresh")}
</Button>
</ToolbarItem>
<ToolbarItem>
</FlexItem>
<FlexItem>
{Object.entries(activeFilters).length > 0 && (
<div className="keycloak__searchChips pf-u-ml-md">
{Object.entries(activeFilters).map((filter) => {
@ -358,7 +363,7 @@ export const EventsSection = () => {
return (
<ChipGroup
className="pf-u-mr-md pf-u-mb-md"
className="pf-u-mt-md pf-u-mr-md"
key={key}
categoryName={filterLabels[key]}
isClosable
@ -381,7 +386,8 @@ export const EventsSection = () => {
})}
</div>
)}
</ToolbarItem>
</FlexItem>
</Flex>
</>
);
};
@ -408,6 +414,7 @@ export const EventsSection = () => {
eventKey="userEvents"
title={<TabTitleText>{t("userEvents")}</TabTitleText>}
>
<div className="keycloak__events_table">
<KeycloakDataTable
key={key}
loader={loader}
@ -457,6 +464,7 @@ export const EventsSection = () => {
</div>
}
/>
</div>
</Tab>
<Tab
eventKey="adminEvents"