Skip to content

Commit

Permalink
Begin merging in datamap UI (#2988)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking authored Apr 5, 2023
1 parent 525ed13 commit 78865fb
Show file tree
Hide file tree
Showing 120 changed files with 6,951 additions and 474 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/frontend_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
install: false
start: npm run cy:start
wait-on: "http://localhost:3000"
wait-on-timeout: 120
wait-on-timeout: 180

- uses: actions/upload-artifact@v3
if: failure()
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ The types of changes are:
### Added
* Access support for Shippo [#2484](https://github.com/ethyca/fides/pull/2484)
* Feature flags can be set such that they cannot be modified by the user [#2966](https://github.com/ethyca/fides/pull/2966)
* Added the datamap UI to make it open source [#2988](https://github.com/ethyca/fides/pull/2988)
* Introduced a `FixedLayout` component (from the datamap UI) for pages that need to be a fixed height and scroll within [#2992](https://github.com/ethyca/fides/pull/2992)

### Changed
* Set `privacyDeclarationDeprecatedFields` flags to false and set `userCannotModify` to true [2987](https://github.com/ethyca/fides/pull/2987)
* Restored `nav-config` back to the admin-ui [#2990](https://github.com/ethyca/fides/pull/2990)

### Removed
* Removed interzone navigation logic now that the datamap UI and admin UI are one app [#2990](https://github.com/ethyca/fides/pull/2990)

### Changed
* Updated the check for if a user can assign owner roles to be scope-based instead of role-based [#2964](https://github.com/ethyca/fides/pull/2964)
Expand Down
105 changes: 0 additions & 105 deletions clients/admin-ui/__tests__/features/common/zones/config.test.ts

This file was deleted.

2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm run start
npm run cy:open
```

However, because we do some [inter-zone navigation](https://github.com/ethyca/fides/blob/main/clients/admin-ui/src/features/common/zones/config.ts/#L12-L24) which Cypress will not handle due to security risks, sometimes it is important to run the webapp with `NODE_ENV=test`. We have a command `cy:start` which captures that, and also makes the server a little faster via a production build. This will potentially cause issues if testing manually with `fidesplus`, however the Cypress tests will run properly.
To run against a production build of the app (faster, but no hot reloading):

```
# Start the webapp in test mode
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/auth.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SYSTEM_ROUTE } from "~/constants";
import { SYSTEM_ROUTE } from "~/features/common/nav/v2/routes";

describe("User Authentication", () => {
describe("when the user not logged in", () => {
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/config-wizard-plus.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stubPlus } from "cypress/support/stubs";

import { ADD_SYSTEMS_ROUTE } from "~/constants";
import { ADD_SYSTEMS_ROUTE } from "~/features/common/nav/v2/routes";
import { ClusterHealth } from "~/types/api";

/**
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/config-wizard.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stubSystemCrud, stubTaxonomyEntities } from "cypress/support/stubs";

import { ADD_SYSTEMS_ROUTE } from "~/constants";
import { ADD_SYSTEMS_ROUTE } from "~/features/common/nav/v2/routes";

describe("Config Wizard", () => {
beforeEach(() => {
Expand Down
50 changes: 50 additions & 0 deletions clients/admin-ui/cypress/e2e/datamap.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { stubDatamap } from "cypress/support/stubs";

describe("Datamap table and spatial view", () => {
beforeEach(() => {
cy.login();
stubDatamap();
});

it("Can render only render one view at a time", () => {
cy.visit("/datamap");
cy.wait("@getDatamap");

// Only the spatial view should be visible first
cy.getByTestId("cytoscape-graph");
cy.getByTestId("datamap-table").should("not.exist");

// Now table view
cy.getByTestId("table-btn").click();
cy.getByTestId("datamap-table");
cy.getByTestId("cytoscape-graph").should("not.exist");

// Now only the spatial view
cy.getByTestId("map-btn").click();
cy.getByTestId("cytoscape-graph");
cy.getByTestId("datamap-table").should("not.exist");

// Now table view
cy.getByTestId("table-btn").click();
cy.getByTestId("datamap-table");
cy.getByTestId("cytoscape-graph").should("not.exist");

// Clicking on the table view again should keep the table view open
cy.getByTestId("table-btn").click();
cy.getByTestId("datamap-table");
cy.getByTestId("cytoscape-graph").should("not.exist");
});

it("Renders a modal to prompt the user to get started when there is no datamap yet", () => {
// Button only shows up when data map is empty (no systems)
cy.intercept("GET", "/api/v1/datamap/*", {
fixture: "datamap/empty_datamap.json",
}).as("getEmptyDatamap");
cy.visit("/datamap");
cy.wait("@getEmptyDatamap");

cy.getByTestId("get-started-modal");
cy.getByTestId("add-systems-btn").click();
cy.url().should("contain", "/add-systems");
});
});
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/routes.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { stubPlus } from "cypress/support/stubs";

import { ADD_SYSTEMS_ROUTE } from "~/constants";
import { ADD_SYSTEMS_ROUTE } from "~/features/common/nav/v2/routes";
import { RoleRegistryEnum } from "~/types/api";

describe("Routes", () => {
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/systems-plus.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
stubTaxonomyEntities,
} from "cypress/support/stubs";

import { SYSTEM_ROUTE } from "~/constants";
import { SYSTEM_ROUTE } from "~/features/common/nav/v2/routes";

describe("System management with Plus features", () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ADD_SYSTEMS_MANUAL_ROUTE,
ADD_SYSTEMS_ROUTE,
SYSTEM_ROUTE,
} from "~/constants";
} from "~/features/common/nav/v2/routes";

describe("System management page", () => {
beforeEach(() => {
Expand Down
Loading

0 comments on commit 78865fb

Please sign in to comment.