Skip to content

Commit

Permalink
Merge branch 'main' into ThomasLaPiana-add-rich-click
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasLaPiana committed Mar 6, 2023
2 parents 84af3c4 + 26e9091 commit ad2f7dc
Show file tree
Hide file tree
Showing 89 changed files with 2,404 additions and 660 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The types of changes are:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fides/compare/2.7.0...main)
## [Unreleased](https://github.com/ethyca/fides/compare/2.7.1...main)

### Added

Expand All @@ -30,18 +30,23 @@ The types of changes are:
* Access and erasure support for Delighted [#2244](https://github.com/ethyca/fides/pull/2244)
* Improve "Upload a new dataset YAML" [#1531](https://github.com/ethyca/fides/pull/2258)
* Access and erasure support for Yotpo [#2708](https://github.com/ethyca/fides/pull/2708)
* Allow SendGrid template usage [#2728](https://github.com/ethyca/fides/pull/2728)

### Changed

* Admin UI
* Add flow for selecting system types when manually creating a system [#2530](https://github.com/ethyca/fides/pull/2530)
* Updated forms for privacy declarations [#2648](https://github.com/ethyca/fides/pull/2648)
* Delete flow for privacy declarations [#2664](https://github.com/ethyca/fides/pull/2664)
* Add framework to have UI elements respect the user's scopes [#2682](https://github.com/ethyca/fides/pull/2682)
* "Manual Webhook" has been renamed to "Manual Process". [#2717](https://github.com/ethyca/fides/pull/2717)
* Convert all config values to Pydantic `Field` objects [#2613](https://github.com/ethyca/fides/pull/2613)
* Add warning to 'fides deploy' when installed outside of a virtual environment [#2641](https://github.com/ethyca/fides/pull/2641)
* Redesigned the default/init config file to be auto-documented. Also updates the `fides init` logic and analytics consent logic [#2694](https://github.com/ethyca/fides/pull/2694)
* Change how config creation/import is handled across the application [#2622](https://github.com/ethyca/fides/pull/2622)
* Update the CLI aesthetics & docstrings [#2703](https://github.com/ethyca/fides/pull/2703)
* Updates Roles->Scopes Mapping [#2744](https://github.com/ethyca/fides/pull/2744)
* Return user scopes as an enum, as well as total scopes [#2741](https://github.com/ethyca/fides/pull/2741)

### Developer Experience

Expand All @@ -58,6 +63,13 @@ The types of changes are:
* Allow string dates to stay strings in cache decoding [#2695](https://github.com/ethyca/fides/pull/2695)
* Admin UI
* Remove Identifiability (Data Qualifier) from taxonomy editor [2684](https://github.com/ethyca/fides/pull/2684)
* Fix Privacy Request Status when submitting a consent request when identity verification is required [#2736](https://github.com/ethyca/fides/pull/2736)

## [2.7.1](https://github.com/ethyca/fides/compare/2.7.0...2.7.1)

### Fixed

* Fix error with the classify dataset feature flag not writing the dataset to the server [#2675](https://github.com/ethyca/fides/pull/2675)

## [2.7.0](https://github.com/ethyca/fides/compare/2.6.6...2.7.0)

Expand Down
68 changes: 68 additions & 0 deletions clients/admin-ui/cypress/e2e/home.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { stubPlus } from "cypress/support/stubs";

import { RoleRegistry } from "~/types/api";

const ALL_TILES = [
"View data map",
"Add systems",
"View systems",
"Configure privacy requests",
"Review privacy requests",
];

const verifyExpectedTiles = (expectedTiles: string[]) => {
expectedTiles.forEach((tile) => {
cy.getByTestId(`tile-${tile}`);
});
const remainingTiles = ALL_TILES.filter((t) => !expectedTiles.includes(t));
remainingTiles.forEach((item) => {
cy.getByTestId(`tile-${item}`).should("not.exist");
});
};

describe("Home page", () => {
beforeEach(() => {
cy.login();
});

describe("permissions", () => {
beforeEach(() => {
// For these tests, let's say we always have systems and connectors
cy.intercept("GET", "/api/v1/system", {
fixture: "systems/systems.json",
}).as("getSystems");
cy.intercept("GET", "/api/v1/connection*", {
fixture: "connectors/list.json",
}).as("getConnectors");
stubPlus(true);
});

it("renders all tiles when all scopes are available", () => {
cy.assumeRole(RoleRegistry.ADMIN);
cy.visit("/");
verifyExpectedTiles(ALL_TILES);
});

it("renders viewer only tiles", () => {
cy.assumeRole(RoleRegistry.VIEWER);
cy.visit("/");
verifyExpectedTiles(["View data map", "View systems"]);
});

it("renders privacy request manager tiles", () => {
cy.assumeRole(RoleRegistry.PRIVACY_REQUEST_MANAGER);
cy.visit("/");
verifyExpectedTiles(["Review privacy requests"]);
});

it("renders privacy request manager + viewer tiles", () => {
cy.assumeRole(RoleRegistry.VIEWER_AND_PRIVACY_REQUEST_MANAGER);
cy.visit("/");
verifyExpectedTiles([
"View data map",
"View systems",
"Review privacy requests",
]);
});
});
});
45 changes: 36 additions & 9 deletions clients/admin-ui/cypress/e2e/privacy-requests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,33 +138,60 @@ describe("Privacy Requests", () => {
cy.getByTestId("option-local").click();
cy.wait("@createConfigurationSettings").then((interception) => {
const { body } = interception.request;
expect(body.fides.storage.active_default_storage_type).to.eql("local");
expect(body.storage.active_default_storage_type).to.eql("local");
});

cy.wait("@createStorage").then((interception) => {
const { body } = interception.request;
expect(body.type).to.eql("local");
expect(body.format).to.eql("json");
});

cy.contains("Configure active storage type saved successfully");
cy.contains("Configure storage type details saved successfully");
});

it("Can configure S3 storage", () => {
cy.getByTestId("option-s3").click();
cy.wait("@createConfigurationSettings").then((interception) => {
const { body } = interception.request;
expect(body.fides.storage.active_default_storage_type).to.eql("s3");
expect(body.storage.active_default_storage_type).to.eql("s3");
});
cy.wait("@getStorageDetails");
});
});

describe("Message Configuration", () => {
beforeEach(() => {
cy.visit("/privacy-requests/configure/messaging");
});

it("Can configure Mailgun email", () => {
cy.getByTestId("option-mailgun").click();
cy.getByTestId("input-domain").type("test-domain");
cy.getByTestId("save-btn").click();
cy.wait("@createStorage").then((interception) => {
cy.wait("@createMessagingConfiguration").then((interception) => {
const { body } = interception.request;
expect(body.type).to.eql("s3");
expect(body.service_type).to.eql("MAILGUN");
cy.contains(
"Mailgun email successfully updated. You can now enter your security key."
);
});
});

it("Can configure Twilio email", () => {
cy.getByTestId("option-twilio-email").click();
cy.getByTestId("input-email").type("test-email");
cy.getByTestId("save-btn").click();
cy.wait("@createMessagingConfiguration").then(() => {
cy.contains(
"Twilio email successfully updated. You can now enter your security key."
);
});
});

it("Can configure Twilio SMS", () => {
cy.getByTestId("option-twilio-sms").click();
cy.wait("@createMessagingConfiguration").then(() => {
cy.contains("Messaging provider saved successfully.");
});
cy.contains("S3 storage credentials successfully updated.");
cy.contains("Configure active storage type saved successfully.");
});
});
});
56 changes: 56 additions & 0 deletions clients/admin-ui/cypress/e2e/routes.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { stubPlus } from "cypress/support/stubs";

import { RoleRegistry } from "~/types/api";

describe("Routes", () => {
beforeEach(() => {
cy.login();
});

describe("permissions", () => {
beforeEach(() => {
// For these tests, let's say we always have systems and connectors
cy.intercept("GET", "/api/v1/system", {
fixture: "systems/systems.json",
}).as("getSystems");
cy.intercept("GET", "/api/v1/connection*", {
fixture: "connectors/list.json",
}).as("getConnectors");
stubPlus(true);
});

it("admins can access many routes", () => {
cy.assumeRole(RoleRegistry.ADMIN);
cy.visit("/");
cy.visit("/add-systems");
cy.wait("@getSystems");
cy.getByTestId("add-systems");
cy.visit("/privacy-requests");
cy.getByTestId("privacy-requests");
cy.visit("/datastore-connection");
cy.wait("@getConnectors");
cy.getByTestId("connection-grid");
});

it("viewers and/or approvers can only access limited routes", () => {
[
RoleRegistry.VIEWER,
RoleRegistry.PRIVACY_REQUEST_MANAGER,
RoleRegistry.VIEWER_AND_PRIVACY_REQUEST_MANAGER,
].forEach((role) => {
cy.assumeRole(role);
// cannot access /add-systems
cy.visit("/add-systems");
cy.getByTestId("add-systems").should("not.exist");
cy.getByTestId("home-content");
// cannot access /datastore-connection
cy.visit("/datastore-connection");
cy.getByTestId("connection-grid").should("not.exist");
cy.getByTestId("home-content");
// can access /privacy-requests
cy.visit("/privacy-requests");
cy.getByTestId("privacy-requests");
});
});
});
});
15 changes: 14 additions & 1 deletion clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ describe("System management page", () => {
beforeEach(() => {
stubTaxonomyEntities();
stubSystemCrud();
cy.intercept("GET", "/api/v1/dataset", { fixture: "datasets.json" }).as(
"getDatasets"
);
cy.intercept("GET", "/api/v1/connection_type*", {
fixture: "connectors/connection_types.json",
}).as("getConnectionTypes");
Expand Down Expand Up @@ -128,7 +131,12 @@ describe("System management page", () => {
// Fill in the privacy declaration form
cy.getByTestId("tab-Data uses").click();
cy.getByTestId("add-btn").click();
cy.wait(["@getDataCategories", "@getDataSubjects", "@getDataUses"]);
cy.wait([
"@getDataCategories",
"@getDataSubjects",
"@getDataUses",
"@getDatasets",
]);
cy.getByTestId("new-declaration-form");
const declaration = system.privacy_declarations[0];
cy.getByTestId("input-data_use").click();
Expand All @@ -141,6 +149,10 @@ describe("System management page", () => {
declaration.data_subjects.forEach((ds) => {
cy.getByTestId("input-data_subjects").type(`${ds}{enter}`);
});
cy.getByTestId("input-dataset_references").click();
cy.getByTestId("input-dataset_references").within(() => {
cy.contains("Demo Users Dataset 2").click();
});

cy.getByTestId("save-btn").click();
cy.wait("@putSystem").then((interception) => {
Expand All @@ -150,6 +162,7 @@ describe("System management page", () => {
data_use: declaration.data_use,
data_categories: declaration.data_categories,
data_subjects: declaration.data_subjects,
dataset_references: ["demo_users_dataset_2"],
});
});
cy.getByTestId("new-declaration-form").within(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{
"identifier": "manual_webhook",
"type": "manual",
"human_readable": "Manual Webhook",
"human_readable": "Manual Process",
"encoded_icon": null
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"details": {
"domain": "test-domain",
"is_eu_domain": "false"
},
"service_type": "MAILGUN"
}
Loading

0 comments on commit ad2f7dc

Please sign in to comment.