Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New manual add design #2530

Merged
merged 22 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e17a786
Remove old manual system flow
allisonking Feb 3, 2023
42c0e06
Add new system page
allisonking Feb 6, 2023
5d44db1
Fix step count bug
allisonking Feb 6, 2023
ea69f02
Add SystemOptions
allisonking Feb 6, 2023
95d647a
Search feature
allisonking Feb 6, 2023
a548a28
Implement search
allisonking Feb 6, 2023
9b35720
Accept image props on logo
allisonking Feb 6, 2023
96b4658
Handle navigating to describe page
allisonking Feb 6, 2023
dac10f1
Update cypress tests and add search empty state
allisonking Feb 7, 2023
e09fd50
Decouple system management from config wizard
allisonking Feb 7, 2023
44b7592
Update changelog
allisonking Feb 7, 2023
16390bf
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 14, 2023
dd7766d
Fix styling on clear button
allisonking Feb 14, 2023
36ac563
Describe system update (#2590)
allisonking Feb 16, 2023
8662d4a
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 16, 2023
be2f8a8
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 17, 2023
7d4d152
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 21, 2023
79ac1dd
Fix form extension
allisonking Feb 21, 2023
f1d5aa2
Updated privacy declarations (#2648)
allisonking Feb 22, 2023
3fcc5e2
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 22, 2023
b7709ba
Delete privacy declarations (#2664)
allisonking Feb 24, 2023
9c66f38
Merge branch 'main' into aking/2434/new-manual-add-design
allisonking Feb 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The types of changes are:
* Update Admin UI to show all action types (access, erasure, consent, update) [#2523](https://github.com/ethyca/fides/pull/2523)
* Removes legacy `verify_oauth_client` function [#2527](https://github.com/ethyca/fides/pull/2527)
* Updated the UI for adding systems to a new design [#2490](https://github.com/ethyca/fides/pull/2490)
* Add flow for selecting system types when manually creating a system [#2530](https://github.com/ethyca/fides/pull/2530)
* Various form components now take a `stacked` or `inline` variant [#2542](https://github.com/ethyca/fides/pull/2542)
* UX fixes for user management [#2537](https://github.com/ethyca/fides/pull/2537)

Expand Down
41 changes: 40 additions & 1 deletion clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,48 @@ describe("System management page", () => {
beforeEach(() => {
stubTaxonomyEntities();
stubSystemCrud();
cy.intercept("GET", "/api/v1/connection_type*", {
fixture: "connectors/connection_types.json",
}).as("getConnectionTypes");
});

it("Can step through the flow", () => {
it("shows available system types and lets the user choose one", () => {
cy.visit("/add-systems");
cy.getByTestId("manual-btn").click();
cy.url().should("contain", "/add-systems/new");
cy.wait("@getConnectionTypes");
cy.getByTestId("header").contains("Choose a type of system");
cy.getByTestId("bigquery");
cy.getByTestId("mariadb");
// Click into one of the connectors
cy.getByTestId("mongodb").click();
cy.getByTestId("header").contains("Describe your MongoDB system");

// Go back to choosing to add a new type of system
cy.getByTestId("breadcrumbs").contains("Choose your system").click();
cy.getByTestId("create-system-btn").click();
cy.getByTestId("header").contains("Describe your new system");
});

it("should allow searching", () => {
cy.visit("/add-systems/new");
cy.wait("@getConnectionTypes");
cy.getByTestId("bigquery");
cy.getByTestId("system-catalog-search").type("db");
cy.getByTestId("bigquery").should("not.exist");
cy.getByTestId("mariadb");
cy.getByTestId("mongodb");
cy.getByTestId("timescale");

// empty state
cy.getByTestId("system-catalog-search")
.clear()
.type("a very specific system that we do not have");
cy.getByTestId("no-systems-found");
});

// Skip while manual system creation is being redone
it.skip("Can step through the flow", () => {
allisonking marked this conversation as resolved.
Show resolved Hide resolved
cy.fixture("system.json").then((system) => {
// Fill in the describe form based on fixture data
cy.visit("/add-systems");
Expand Down
36 changes: 32 additions & 4 deletions clients/admin-ui/src/features/common/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,36 @@
import {
Button,
Input,
InputGroup,
InputLeftElement,
InputProps,
InputRightElement,
SearchLineIcon,
} from "@fidesui/react";

interface Props extends Omit<InputProps, "onChange"> {
search?: string;
onChange: (value: string) => void;
withIcon?: boolean;
withClear?: boolean;
}
const SearchBar = ({ search, onChange, ...props }: Props) => {
const SearchBar = ({
search,
onChange,
withIcon,
withClear,
...props
}: Props) => {
const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) =>
onChange(event.target.value);

return (
<InputGroup size="sm" minWidth="308px">
<InputLeftElement pointerEvents="none">
<SearchLineIcon color="gray.300" w="17px" h="17px" />
</InputLeftElement>
{withIcon ? (
<InputLeftElement pointerEvents="none">
<SearchLineIcon color="gray.300" w="17px" h="17px" />
</InputLeftElement>
) : null}
<Input
autoComplete="off"
type="search"
Expand All @@ -30,6 +42,22 @@ const SearchBar = ({ search, onChange, ...props }: Props) => {
onChange={handleSearchChange}
{...props}
/>
{withClear ? (
<InputRightElement width="3.5rem" display="flex" alignItems="center">
<Button
fontWeight="light"
size="sm"
onClick={() => {
onChange("");
}}
// Prevent the button from overlapping with the input's focus rect
height="95%"
width="95%"
>
Clear
</Button>
</InputRightElement>
) : null}
</InputGroup>
);
};
Expand Down
4 changes: 3 additions & 1 deletion clients/admin-ui/src/features/config-wizard/AddSystem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Box, Heading, SimpleGrid, Stack, Text } from "@fidesui/react";
import { useRouter } from "next/router";

import { useAppDispatch } from "~/app/hooks";
import {
Expand Down Expand Up @@ -27,6 +28,7 @@ const SectionTitle = ({ children }: { children: string }) => (

const AddSystem = () => {
const dispatch = useAppDispatch();
const router = useRouter();

return (
<Stack spacing={9} data-testid="add-systems">
Expand Down Expand Up @@ -55,8 +57,8 @@ const AddSystem = () => {
icon={<ManualSetupIcon boxSize={8} />}
description="Manually add a system for services not covered by automated scanners"
onClick={() => {
dispatch(changeStep(5));
dispatch(setAddSystemsMethod(SystemMethods.MANUAL));
router.push("/add-systems/new");
}}
data-testid="manual-btn"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,47 +1,23 @@
import { Box, Button, CloseSolidIcon, Divider, Stack } from "@fidesui/react";
import HorizontalStepper from "common/HorizontalStepper";

import { useAppDispatch, useAppSelector } from "~/app/hooks";
import { useFeatures } from "~/features/common/features";
import DescribeSystemStep from "~/features/system/DescribeSystemStep";
import PrivacyDeclarationStep from "~/features/system/PrivacyDeclarationStep";
import ReviewSystemStep from "~/features/system/ReviewSystemStep";
import { System } from "~/types/api";

import AddSystem from "./AddSystem";
import AuthenticateScanner from "./AuthenticateScanner";
import {
changeReviewStep,
reset,
reviewManualSystem,
selectReviewStep,
selectStep,
selectSystemInReview,
selectSystemsForReview,
setSystemInReview,
} from "./config-wizard.slice";
import { HORIZONTAL_STEPS } from "./constants";
import { reset, selectStep } from "./config-wizard.slice";
import OrganizationInfoForm from "./OrganizationInfoForm";
import ScanResults from "./ScanResults";
import SuccessPage from "./SuccessPage";

const ConfigWizardWalkthrough = () => {
const dispatch = useAppDispatch();
const step = useAppSelector(selectStep);
const reviewStep = useAppSelector(selectReviewStep);
const system = useAppSelector(selectSystemInReview);
const systemsForReview = useAppSelector(selectSystemsForReview);
const features = useFeatures();

const handleCancelSetup = () => {
dispatch(reset());
};

const handleSuccess = (values: System) => {
dispatch(setSystemInReview(values));
dispatch(changeReviewStep());
};

return (
<>
{!features.flags.navV2 && (
Expand Down Expand Up @@ -75,47 +51,6 @@ const ConfigWizardWalkthrough = () => {
<ScanResults />
</Box>
) : null}
{/* These steps should only apply if you're creating systems manually */}
allisonking marked this conversation as resolved.
Show resolved Hide resolved
{step === 5 ? (
<Stack direction="column">
{reviewStep <= 3 ? (
<HorizontalStepper
activeStep={reviewStep}
steps={HORIZONTAL_STEPS}
/>
) : null}
{reviewStep === 1 && (
<DescribeSystemStep
system={system}
onSuccess={handleSuccess}
abridged
/>
)}
{reviewStep === 2 && system && (
<PrivacyDeclarationStep
system={system}
onSuccess={handleSuccess}
abridged
/>
)}
{reviewStep === 3 && system && (
<ReviewSystemStep
system={system}
onSuccess={() => dispatch(changeReviewStep())}
abridged
/>
)}
{reviewStep === 4 && system && (
<SuccessPage
systemInReview={system}
systemsForReview={systemsForReview}
onAddNextSystem={() => {
dispatch(reviewManualSystem());
}}
/>
)}
</Stack>
) : null}
</Box>
</Stack>
</>
Expand Down
Loading