Skip to content

Commit

Permalink
Merge branch 'main' into 3871-fix-dataset-references
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana authored Jul 31, 2023
2 parents 7f72085 + f6eedab commit 3be38b3
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 203 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The types of changes are:

- Simplified the file structure for HTML DSR packages [#3848](https://github.com/ethyca/fides/pull/3848)
- Changed max width of form components in "system information" form tab [#3864](https://github.com/ethyca/fides/pull/3864)
- Remove manual system selection screen [#3865](https://github.com/ethyca/fides/pull/3865)

## [2.17.0](https://github.com/ethyca/fides/compare/2.16.0...2.17.0)

Expand Down
39 changes: 0 additions & 39 deletions clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,6 @@ describe("System management page", () => {
}).as("getConnectionTypes");
});

it("shows available system types and lets the user choose one", () => {
cy.visit(ADD_SYSTEMS_ROUTE);
cy.getByTestId("manual-btn").click();
cy.url().should("contain", ADD_SYSTEMS_MANUAL_ROUTE);
cy.wait("@getConnectionTypes");
cy.getByTestId("header").contains("Choose a type of system");
cy.getByTestId("bigquery-item");
cy.getByTestId("mariadb-item");
// Click into one of the connectors
cy.getByTestId("mongodb-item").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_MANUAL_ROUTE);
cy.wait("@getConnectionTypes");
cy.getByTestId("bigquery-item");
cy.getByTestId("system-catalog-search").type("db");
cy.getByTestId("bigquery-item").should("not.exist");
cy.getByTestId("mariadb-item");
cy.getByTestId("mongodb-item");
cy.getByTestId("timescale-item");

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

it("Can step through the flow", () => {
cy.fixture("systems/system.json").then((system) => {
cy.intercept("GET", "/api/v1/system/*", {
Expand All @@ -119,8 +84,6 @@ describe("System management page", () => {
cy.getByTestId("manual-btn").click();
cy.url().should("contain", ADD_SYSTEMS_MANUAL_ROUTE);
cy.wait("@getSystems");
cy.wait("@getConnectionTypes");
cy.getByTestId("create-system-btn").click();
cy.getByTestId("input-name").type(system.name);
cy.getByTestId("input-fides_key").type(system.fides_key);
cy.getByTestId("input-description").type(system.description);
Expand Down Expand Up @@ -190,8 +153,6 @@ describe("System management page", () => {
}).as("getDemoSystem");
cy.visit(ADD_SYSTEMS_MANUAL_ROUTE);
cy.wait("@getSystems");
cy.wait("@getConnectionTypes");
cy.getByTestId("create-system-btn").click();
cy.getByTestId("input-name").type(system.name);
cy.getByTestId("input-fides_key").type(system.fides_key);
cy.getByTestId("input-description").type(system.description);
Expand Down
98 changes: 0 additions & 98 deletions clients/admin-ui/src/features/system/SystemCatalog.tsx

This file was deleted.

76 changes: 16 additions & 60 deletions clients/admin-ui/src/pages/add-systems/manual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,28 @@ import React, { useMemo } from "react";

import { useSystemOrDatamapRoute } from "~/features/common/hooks/useSystemOrDatamapRoute";
import Layout from "~/features/common/Layout";
import {
ADD_SYSTEMS_MANUAL_ROUTE,
ADD_SYSTEMS_ROUTE,
} from "~/features/common/nav/v2/routes";
import { ADD_SYSTEMS_ROUTE } from "~/features/common/nav/v2/routes";
import ConnectionTypeLogo from "~/features/datastore-connections/ConnectionTypeLogo";
import SystemCatalog from "~/features/system/SystemCatalog";
import SystemFormTabs from "~/features/system/SystemFormTabs";
import { ConnectionSystemTypeMap } from "~/types/api";

const CHOOSE_SYSTEM_COPY =
"Systems are anything that might store or process data in your organization, from a web application, to a database or data warehouse. Pick from common system types below or create a new type of system to get started.";
const DESCRIBE_SYSTEM_COPY =
"Systems are anything that might store or process data in your organization, from a web application, to a database or data warehouse. Describe your system below to register it to the map. You may optionally complete data entry for the system using the additional tabs to navigate the sections.";

type Step = "choose-system" | "describe-system";

const Header = ({
step,
connector,
}: {
step: Step;
connector?: ConnectionSystemTypeMap;
}) => {
if (step === "choose-system") {
return (
<Heading fontSize="2xl" fontWeight="semibold" mb={2} data-testid="header">
Choose a type of system
</Heading>
);
}

return (
<Box display="flex" mb={2} alignItems="center" data-testid="header">
<ConnectionTypeLogo data={connector ?? "ethyca"} mr={2} />
<Heading fontSize="2xl" fontWeight="semibold">
Describe your {connector ? connector.human_readable : "new"} system
</Heading>
</Box>
);
};
const Header = ({ connector }: { connector?: ConnectionSystemTypeMap }) => (
<Box display="flex" mb={2} alignItems="center" data-testid="header">
<ConnectionTypeLogo data={connector ?? "ethyca"} mr={2} />
<Heading fontSize="2xl" fontWeight="semibold">
Describe your {connector ? connector.human_readable : "new"} system
</Heading>
</Box>
);

const NewManualSystem: NextPage = () => {
const { systemOrDatamapRoute } = useSystemOrDatamapRoute();
const router = useRouter();
const { step, connectorType } = router.query;
const { connectorType } = router.query;

const currentStep: Step = step === "2" ? "describe-system" : "choose-system";
const connector: ConnectionSystemTypeMap | undefined = useMemo(() => {
if (!connectorType) {
return undefined;
Expand All @@ -65,9 +40,9 @@ const NewManualSystem: NextPage = () => {
}, [connectorType]);

return (
<Layout title="Choose a system type">
<Layout title="Describe your system">
<Box mb={4}>
<Header step={currentStep} connector={connector} />
<Header connector={connector} />
<Box>
<Breadcrumb
fontWeight="medium"
Expand All @@ -81,36 +56,17 @@ const NewManualSystem: NextPage = () => {
<BreadcrumbItem>
<NextLink href={ADD_SYSTEMS_ROUTE}>Add systems</NextLink>
</BreadcrumbItem>
<BreadcrumbItem
color={
currentStep === "choose-system"
? "complimentary.500"
: undefined
}
>
<NextLink href={ADD_SYSTEMS_MANUAL_ROUTE}>
Choose your system
</NextLink>
<BreadcrumbItem color="complimentary.500">
<NextLink href="#">Describe your system</NextLink>
</BreadcrumbItem>
{currentStep === "describe-system" ? (
<BreadcrumbItem color="complimentary.500">
<NextLink href="#">Describe your system</NextLink>
</BreadcrumbItem>
) : null}
</Breadcrumb>
</Box>
</Box>
<Box w={{ base: "100%", md: "75%" }}>
<Text fontSize="sm" mb={8}>
{currentStep === "choose-system"
? CHOOSE_SYSTEM_COPY
: DESCRIBE_SYSTEM_COPY}
{DESCRIBE_SYSTEM_COPY}
</Text>
{currentStep === "choose-system" ? (
<SystemCatalog />
) : (
<SystemFormTabs isCreate />
)}
<SystemFormTabs isCreate />
</Box>
</Layout>
);
Expand Down
3 changes: 3 additions & 0 deletions dangerous-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These requirements are dangerous on certain platforms
Cython==0.29.35
pymssql==2.2.7
4 changes: 2 additions & 2 deletions noxfiles/ci_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from functools import partial
from typing import Callable, Dict

import nox
from nox.command import CommandFailed

import nox
from constants_nox import (
CONTAINER_NAME,
IMAGE_NAME,
Expand Down Expand Up @@ -266,7 +266,7 @@ def collect_tests(session: nox.Session) -> None:
errors within the test code.
"""
session.install(".")
install_requirements(session)
install_requirements(session, include_dangerous=True)
command = ("pytest", "tests/", "--collect-only")
session.run(*command)

Expand Down
5 changes: 3 additions & 2 deletions noxfiles/utils_nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from pathlib import Path

import nox

from constants_nox import COMPOSE_FILE_LIST
from run_infrastructure import run_infrastructure

Expand Down Expand Up @@ -51,9 +50,11 @@ def teardown(session: nox.Session, volumes: bool = False, images: bool = False)
session.log("Teardown complete")


def install_requirements(session: nox.Session) -> None:
def install_requirements(session: nox.Session, include_dangerous=False) -> None:
session.install("-r", "requirements.txt")
session.install("-r", "dev-requirements.txt")
if include_dangerous:
session.install("-r", "dangerous-requirements.txt")


@nox.session()
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ boto3==1.26.1
celery[pytest]==5.2.7
colorama>=0.4.3
cryptography==38.0.3
Cython==0.29.35 # workaround eeded for https://github.com/ethyca/fides/issues/3824
dask==2022.9.2
deepdiff==6.3.0
defusedxml==0.7.1
Expand Down Expand Up @@ -37,7 +36,6 @@ pydantic==1.10.9
pydash==6.0.2
PyJWT==2.4.0
pymongo==3.13.0
pymssql>=2.1.5, <2.2.8 # workaround needed for https://github.com/ethyca/fides/issues/3824
PyMySQL==1.0.2
python-jose[cryptography]==3.3.0
pyyaml>=5,<7
Expand Down
Loading

0 comments on commit 3be38b3

Please sign in to comment.