Skip to content

Commit

Permalink
Make taxonomy items able to be enabled or disabled (#3844)
Browse files Browse the repository at this point in the history
Co-authored-by: Kelsey Thomas <[email protected]>
Co-authored-by: Allison King <[email protected]>
Co-authored-by: Allison King <[email protected]>
  • Loading branch information
4 people committed Jul 24, 2023
1 parent 93cb214 commit 8e54d90
Show file tree
Hide file tree
Showing 41 changed files with 735 additions and 185 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The types of changes are:

- Tab component for `fides-js` [#3782](https://github.com/ethyca/fides/pull/3782)
- Prefetches API calls as part of Fides.js [#3698](https://github.com/ethyca/fides/pull/3698)
- Allow items in taxonomy to be enabled or disabled [#3844](https://github.com/ethyca/fides/pull/3844)

### Developer Experience

Expand Down
15 changes: 15 additions & 0 deletions clients/admin-ui/__tests__/features/taxonomy-transform.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ describe("data category transform", () => {
label: "Account City",
value: "account.contact.city",
is_default: true,
active: true,
},
],
description: "Contact data related to a system account.",
label: "Account Contact Data",
value: "account.contact",
is_default: true,
active: true,
},
],
description: "Data related to a system account.",
label: "Account Data",
value: "account",
is_default: true,
active: true,
},
{
children: [
Expand All @@ -36,12 +39,14 @@ describe("data category transform", () => {
label: "Authentication Data",
value: "system.authentication",
is_default: true,
active: true,
},
],
description: "Data unique to, and under control of the system.",
label: "System Data",
value: "system",
is_default: true,
active: true,
},
{
children: [
Expand All @@ -52,6 +57,7 @@ describe("data category transform", () => {
label: "Derived Data",
value: "user.derived",
is_default: true,
active: true,
},
{
children: [
Expand All @@ -62,6 +68,7 @@ describe("data category transform", () => {
label: "User Provided Non-Identifiable Data",
value: "user.provided.nonidentifiable",
is_default: true,
active: true,
},
{
children: [
Expand All @@ -71,6 +78,7 @@ describe("data category transform", () => {
label: "User Provided Non-Specific Age",
value: "user.provided.identifiable.non_specific_age",
is_default: true,
active: true,
},
{
children: [],
Expand All @@ -79,27 +87,31 @@ describe("data category transform", () => {
label: "Political Opinion",
value: "user.provided.identifiable.political_opinion",
is_default: true,
active: true,
},
],
description:
"Data provided or created directly by a user that is linked to or identifies a user.",
label: "User Provided Identifiable Data",
value: "user.provided.identifiable",
is_default: true,
active: true,
},
],
description:
"Data provided or created directly by a user of the system.",
label: "User Provided Data",
value: "user.provided",
is_default: true,
active: true,
},
],
description:
"Data related to the user of the system, either provided directly or derived based on their usage.",
label: "User Data",
value: "user",
is_default: true,
active: true,
},
]);
});
Expand All @@ -114,6 +126,7 @@ describe("data category transform", () => {
"An individual that is unidentifiable to the systems. Note - This should only be applied to truly anonymous users where there is no risk of re-identification",
is_default: true,
children: [],
active: true,
},
{
label: "Citizen Voter",
Expand All @@ -122,6 +135,7 @@ describe("data category transform", () => {
"An individual registered to voter with a state or authority.",
is_default: true,
children: [],
active: true,
},
{
label: "Commuter",
Expand All @@ -130,6 +144,7 @@ describe("data category transform", () => {
"An individual that is traveling or transiting in the context of location tracking.",
is_default: true,
children: [],
active: true,
},
]);
});
Expand Down
7 changes: 2 additions & 5 deletions clients/admin-ui/cypress/e2e/taxonomy-plus.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ describe("Taxonomy management with Plus features", () => {

const navigateToEditor = () => {
cy.getByTestId(`accordion-item-${RESOURCE_PARENT.label}`).click();
cy.getByTestId(`item-${RESOURCE_CHILD.label}`)
.click()
.within(() => {
cy.getByTestId("edit-btn").click();
});
cy.getByTestId(`item-${RESOURCE_CHILD.label}`).click({ force: true });
cy.getByTestId("edit-btn").click();
};

// TODO: Inputs are no longer created on this screen.
Expand Down
8 changes: 5 additions & 3 deletions clients/admin-ui/cypress/e2e/taxonomy.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe("Taxonomy management page", () => {
// clicking should open up accordions to render more items visible
cy.getByTestId("accordion-item-User Data").click();
cy.getByTestId("accordion-item-Credentials").should("be.visible");
cy.getByTestId("accordion-item-Credentials").click();
cy.getByTestId("accordion-item-Credentials").click({ force: true });
cy.getByTestId("item-Password").should("be.visible");
});

Expand Down Expand Up @@ -161,7 +161,7 @@ describe("Taxonomy management page", () => {
it("Can render the parent field", () => {
cy.getByTestId("tab-Data Categories").click();
cy.getByTestId(`accordion-item-User Data`).click();
cy.getByTestId("accordion-item-Credentials").click();
cy.getByTestId("accordion-item-Credentials").click({ force: true });
cy.getByTestId("item-Password").trigger("mouseover");
cy.getByTestId("edit-btn").click();
cy.getByTestId("input-parent_key").should(
Expand Down Expand Up @@ -257,7 +257,9 @@ describe("Taxonomy management page", () => {
cy.getByTestId("input-strategy").should("contain", "INCLUDE");
cy.getByTestId("input-automatic_decisions_or_profiling").within(() => {
cy.getByTestId("option-true").should("have.attr", "data-checked");
cy.getByTestId("option-false").click();
// For some reason Cypress can accidentally click the dropdown selector above,
// so we force click the radio
cy.getByTestId("option-false").click({ force: true });
cy.getByTestId("option-false").should("have.attr", "data-checked");
cy.getByTestId("option-true").should("not.have.attr", "data-checked");
});
Expand Down
Loading

0 comments on commit 8e54d90

Please sign in to comment.