Moved button to top toolbar (#2665)

This commit is contained in:
Erik Jan de Wit 2022-05-24 11:16:43 +02:00 committed by GitHub
parent 713ab4ff6f
commit f590deac7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 41 deletions

View file

@ -122,7 +122,7 @@ describe("Authentication test", () => {
it("should create flow from scratch", () => {
const flowName = "Flow";
listingPage.goToCreateItem();
listingPage.itemExist("Copy of browser").goToCreateItem();
detailPage.fillCreateForm(
flowName,
"Some nice description about what this flow does so that we can use it later",

View file

@ -6,16 +6,16 @@ import {
Label,
PageSection,
Toolbar,
ToolbarItem,
ToolbarContent,
ToggleGroup,
ToggleGroupItem,
AlertVariant,
ActionGroup,
Button,
ButtonVariant,
DropdownItem,
} from "@patternfly/react-core";
import { CheckCircleIcon, PlusIcon, TableIcon } from "@patternfly/react-icons";
import { CheckCircleIcon, TableIcon } from "@patternfly/react-icons";
import type AuthenticationExecutionInfoRepresentation from "@keycloak/keycloak-admin-client/lib/defs/authenticationExecutionInfoRepresentation";
import type { AuthenticationProviderRepresentation } from "@keycloak/keycloak-admin-client/lib/defs/authenticatorConfigRepresentation";
@ -317,30 +317,48 @@ export default function FlowDetails() {
dropdownItems={dropdownItems}
/>
<PageSection variant="light">
{hasExecutions && (
<Toolbar id="toolbar">
<ToolbarContent>
<ToggleGroup>
<ToggleGroupItem
icon={<TableIcon />}
aria-label={t("tableView")}
buttonId="tableView"
isSelected={tableView}
onChange={() => setTableView(true)}
/>
<ToggleGroupItem
icon={<i className="fas fa-project-diagram"></i>}
aria-label={t("diagramView")}
buttonId="diagramView"
isSelected={!tableView}
onChange={() => setTableView(false)}
/>
</ToggleGroup>
</ToolbarContent>
</Toolbar>
)}
{tableView && executionList && hasExecutions && (
<>
<Toolbar id="toolbar">
<ToolbarContent>
<ToolbarItem>
<ToggleGroup>
<ToggleGroupItem
icon={<TableIcon />}
aria-label={t("tableView")}
buttonId="tableView"
isSelected={tableView}
onChange={() => setTableView(true)}
/>
<ToggleGroupItem
icon={<i className="fas fa-project-diagram"></i>}
aria-label={t("diagramView")}
buttonId="diagramView"
isSelected={!tableView}
onChange={() => setTableView(false)}
/>
</ToggleGroup>
</ToolbarItem>
<ToolbarItem>
<Button
data-testid="addStep"
variant="secondary"
onClick={() => setShowAddExecutionDialog(true)}
>
{t("addStep")}
</Button>
</ToolbarItem>
<ToolbarItem>
<Button
data-testid="addSubFlow"
variant="secondary"
onClick={() => setShowSubFlowDialog(true)}
>
{t("addSubFlow")}
</Button>
</ToolbarItem>
</ToolbarContent>
</Toolbar>
<DeleteConfirm />
<DataList
aria-label="flows"
@ -427,22 +445,6 @@ export default function FlowDetails() {
}}
/>
)}
<ActionGroup>
<Button
data-testid="addStep"
variant="link"
onClick={() => setShowAddExecutionDialog(true)}
>
<PlusIcon /> {t("addStep")}
</Button>
<Button
data-testid="addSubFlow"
variant="link"
onClick={() => setShowSubFlowDialog(true)}
>
<PlusIcon /> {t("addSubFlow")}
</Button>
</ActionGroup>
</>
)}
<div className="pf-screen-reader" aria-live="assertive">