Skip to content

Commit

Permalink
Merge branch 'main' into fix_hubspot_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Linker44 authored Jan 29, 2025
2 parents b1cab17 + af9cacf commit 543a0f4
Show file tree
Hide file tree
Showing 80 changed files with 2,948 additions and 341 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o

### Added
- Added Action Center MVP behind new feature flag [#5622](https://github.com/ethyca/fides/pull/5622)
- Added Data Catalog MVP behind new feature flag [#5628](https://github.com/ethyca/fides/pull/5628)
- Added cache-clearing methods to the `DBCache` model to allow deleting cache entries [#5629](https://github.com/ethyca/fides/pull/5629)
- Adds partitioning, custom identities, multiple identities to test coverage for BigQuery Enterprise [#5618](https://github.com/ethyca/fides/pull/5618)
- Added Datahub groundwork required by Fidesplus [#5666](https://github.com/ethyca/fides/pull/5666)
Expand Down Expand Up @@ -210,6 +211,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o

### Fixed
- API router sanitizer being too aggressive with NextJS Catch-all Segments [#5438](https://github.com/ethyca/fides/pull/5438)
- Fix rendering of subfield names in D&D tables [#5439](https://github.com/ethyca/fides/pull/5439)
- Fix BigQuery `partitioning` queries to properly support multiple identity clauses [#5432](https://github.com/ethyca/fides/pull/5432)

## [2.48.0](https://github.com/ethyca/fides/compare/2.47.1...2.48.0)
Expand Down
133 changes: 133 additions & 0 deletions clients/admin-ui/cypress/e2e/data-catalog.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
import {
stubDataCatalog,
stubPlus,
stubStagedResourceActions,
stubSystemCrud,
stubTaxonomyEntities,
} from "cypress/support/stubs";

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

describe("data catalog", () => {
beforeEach(() => {
cy.login();
stubPlus(true);
stubDataCatalog();
stubTaxonomyEntities();
stubSystemCrud();
});

describe("systems table", () => {
beforeEach(() => {
cy.visit(DATA_CATALOG_ROUTE);
cy.wait("@getCatalogSystems");
});

it("should display systems table", () => {
cy.getByTestId("row-bigquery_system-col-name").should(
"contain",
"BigQuery System",
);
});

it("should be able to navigate to system details via the overflow menu", () => {
cy.getByTestId("row-bigquery_system").within(() => {
cy.getByTestId("system-actions-menu").click();
cy.getByTestId("view-system-details").click({ force: true });
cy.url().should("include", "/systems/configure/bigquery_system");
});
});

it("should be able to add a data use", () => {
cy.getByTestId("row-bigquery_system-col-data-uses").within(() => {
cy.getByTestId("taxonomy-add-btn").click();
cy.get(".select-wrapper").should("be.visible");
});
});

it("should navigate to database view when clicking a system with projects", () => {
cy.getByTestId("row-bigquery_system-col-name").click();
cy.wait("@getAvailableDatabases");
cy.url().should("include", "/bigquery_system/projects");
});

it("should navigate to dataset view when clicking a system without projects", () => {
cy.intercept("POST", "/api/v1/plus/discovery-monitor/databases*", {
fixture: "empty-pagination",
}).as("getEmptyAvailableDatabases");
cy.getByTestId("row-dynamo_system-col-name").click();
cy.wait("@getEmptyAvailableDatabases");
cy.url().should("not.include", "/projects");
});
});

describe("projects table", () => {
beforeEach(() => {
cy.visit(`${DATA_CATALOG_ROUTE}/bigquery_system/projects`);
cy.wait("@getCatalogProjects");
});

it("should show projects with appropriate statuses", () => {
cy.getByTestId(
"row-bigquery_monitor.prj-bigquery-111111-col-status",
).should("contain", "Attention required");
cy.getByTestId(
"row-bigquery_monitor.prj-bigquery-222222-col-status",
).should("contain", "Classifying");
cy.getByTestId(
"row-bigquery_monitor.prj-bigquery-333333-col-status",
).should("contain", "In review");
cy.getByTestId(
"row-bigquery_monitor.prj-bigquery-444444-col-status",
).should("contain", "Approved");
});

it("should navigate to dataset view on click", () => {
cy.getByTestId(
"row-bigquery_monitor.prj-bigquery-111111-col-name",
).click();
cy.url().should(
"include",
"/projects/bigquery_monitor.prj-bigquery-111111",
);
});
});

describe("resource tables", () => {
beforeEach(() => {
stubStagedResourceActions();
cy.visit(
`${DATA_CATALOG_ROUTE}/bigquery_system/monitor.project.test_dataset_1`,
);
});

it("should display the table", () => {
cy.getByTestId("row-monitor.project.dataset.table_1-col-name").should(
"contain",
"table_1",
);
});

it("should be able to take actions on resources", () => {
cy.getByTestId("row-monitor.project.dataset.table_1-col-actions").within(
() => {
cy.getByTestId("classify-btn").click();
cy.wait("@confirmResource");
},
);
cy.getByTestId("row-monitor.project.dataset.table_2-col-actions").within(
() => {
cy.getByTestId("resource-actions-menu").click();
cy.getByTestId("hide-action").click({ force: true });
cy.wait("@ignoreResource");
},
);
cy.getByTestId("row-monitor.project.dataset.table_3-col-actions").within(
() => {
cy.getByTestId("approve-btn").click();
cy.wait("@promoteResource");
},
);
});
});
});
10 changes: 4 additions & 6 deletions clients/admin-ui/cypress/e2e/discovery-detection.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ describe("discovery and detection", () => {
cy.intercept("PATCH", "/api/v1/plus/discovery-monitor/*/results").as(
"patchClassification",
);
cy.getByTestId("classification-user.device.device_id").click({
force: true,
});
cy.getByTestId("classification-user.contact.phone_number").click();
cy.getByTestId("taxonomy-select").antSelect("system");
cy.wait("@patchClassification");
});
Expand All @@ -424,7 +422,7 @@ describe("discovery and detection", () => {
cy.getByTestId(
"user-classification-user.contact.phone_number",
).should("exist");
cy.getByTestId("add-category-btn").click();
cy.getByTestId("taxonomy-add-btn").click();
cy.get(".select-wrapper").should("exist");
});
});
Expand All @@ -434,7 +432,7 @@ describe("discovery and detection", () => {
"row-my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.No_categories-col-classifications",
).within(() => {
cy.getByTestId("no-classifications").should("exist");
cy.getByTestId("add-category-btn").should("exist");
cy.getByTestId("taxonomy-add-btn").should("exist");
});
});

Expand All @@ -443,7 +441,7 @@ describe("discovery and detection", () => {
"row-my_bigquery_monitor.prj-bigquery-418515.test_dataset_1.consent-reports-20.address-col-classifications",
).within(() => {
cy.getByTestId("no-classifications").should("exist");
cy.getByTestId("add-category-btn").should("not.exist");
cy.getByTestId("taxonomy-add-btn").should("not.exist");
});
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"items": [
{
"urn": "bigquery_monitor.prj-bigquery-111111",
"name": "prj-bigquery-111111",
"diff_status": "addition",
"child_diff_status": { "addition": true }
},
{
"urn": "bigquery_monitor.prj-bigquery-222222",
"name": "prj-bigquery-222222",
"diff_status": "classifying",
"child_diff_status": { "classifying": true }
},
{
"urn": "bigquery_monitor.prj-bigquery-333333",
"name": "prj-bigquery-333333",
"diff_status": "classification_addition",
"child_diff_status": { "classification_addition": true }
},
{
"urn": "bigquery_monitor.prj-bigquery-444444",
"name": "prj-bigquery-444444",
"diff_status": "monitored",
"child_diff_status": {}
}
],
"total": 2,
"page": 1,
"size": 25,
"pages": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"items": [
{
"fides_key": "bigquery_system",
"name": "BigQuery System",
"description": "A system used for storing and analyzing large datasets.",
"monitor_config_keys": ["bigquery_monitor"],
"connection_configs": {
"key": "bq_integration"
}
},
{
"fides_key": "dynamo_system",
"name": "Dynamo System",
"description": "A system used for storing and analyzing large datasets.",
"monitor_config_keys": ["dynamo_monitor"],
"connection_configs": {
"key": "dynamo_integration"
}
},
{
"fides_key": "system_with_dataset",
"name": "System with Dataset",
"description": "A system with a dataset.",
"monitor_config_keys": [],
"dataset_references": ["demo_dataset"]
}
],
"total": 3,
"page": 1,
"size": 25,
"pages": 1
}
28 changes: 28 additions & 0 deletions clients/admin-ui/cypress/fixtures/data-catalog/catalog-tables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"items": [
{
"urn": "monitor.project.dataset.table_1",
"name": "table_1",
"diff_status": "addition"
},
{
"urn": "monitor.project.dataset.table_2",
"name": "table_2",
"diff_status": "classifying"
},
{
"urn": "monitor.project.dataset.table_3",
"name": "table_3",
"diff_status": "classification_addition"
},
{
"urn": "monitor.project.dataset.table_4",
"name": "table_4",
"diff_status": "monitored"
}
],
"total": 4,
"page": 1,
"size": 25,
"pages": 1
}
19 changes: 19 additions & 0 deletions clients/admin-ui/cypress/support/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,22 @@ export const stubActionCenter = () => {
response: 200,
}).as("setAssetSystem");
};

export const stubDataCatalog = () => {
cy.intercept("GET", "/api/v1/plus/data-catalog/system*", {
fixture: "data-catalog/catalog-systems",
}).as("getCatalogSystems");
cy.intercept("GET", "/api/v1/plus/data-catalog/project*", {
fixture: "data-catalog/catalog-projects",
}).as("getCatalogProjects");
cy.intercept("GET", "/api/v1/plus/discovery-monitor/results?*", {
fixture: "data-catalog/catalog-tables",
}).as("getCatalogTables");
cy.intercept("POST", "/api/v1/plus/discovery-monitor/databases*", {
items: ["test_project"],
page: 1,
size: 1,
total: 1,
pages: 1,
}).as("getAvailableDatabases");
};
2 changes: 2 additions & 0 deletions clients/admin-ui/src/features/common/api.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export const baseApi = createApi({
tagTypes: [
"Allow List",
"Auth",
"Catalog Systems",
"Catalog Projects",
"Classify Instances Datasets",
"Classify Instances Systems",
"Connection Type",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import {
TaxonomySelect,
TaxonomySelectOption,
TaxonomySelectProps,
} from "~/features/common/dropdown/TaxonomySelect";
import useTaxonomies from "~/features/common/hooks/useTaxonomies";

const DataCategorySelect = ({
selectedTaxonomies,
showDisabled = false,
...props
}: TaxonomySelectProps) => {
const { getDataCategoryDisplayNameProps, getDataCategories } =
useTaxonomies();

const getActiveDataCategories = () =>
getDataCategories().filter((c) => c.active);

const dataCategories = showDisabled
? getDataCategories()
: getActiveDataCategories();

const options: TaxonomySelectOption[] = dataCategories
.filter((category) => !selectedTaxonomies.includes(category.fides_key))
.map((category) => {
const { name, primaryName } = getDataCategoryDisplayNameProps(
category.fides_key,
);
return {
value: category.fides_key,
name,
primaryName,
description: category.description || "",
};
});

return <TaxonomySelect options={options} {...props} />;
};

export default DataCategorySelect;
36 changes: 36 additions & 0 deletions clients/admin-ui/src/features/common/dropdown/DataUseSelect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
TaxonomySelect,
TaxonomySelectOption,
TaxonomySelectProps,
} from "~/features/common/dropdown/TaxonomySelect";
import useTaxonomies from "~/features/common/hooks/useTaxonomies";

const DataUseSelect = ({
selectedTaxonomies,
showDisabled = false,
...props
}: TaxonomySelectProps) => {
const { getDataUseDisplayNameProps, getDataUses } = useTaxonomies();

const getActiveDataUses = () => getDataUses().filter((du) => du.active);

const dataUses = showDisabled ? getDataUses() : getActiveDataUses();

const options: TaxonomySelectOption[] = dataUses
.filter((dataUse) => !selectedTaxonomies.includes(dataUse.fides_key))
.map((dataUse) => {
const { name, primaryName } = getDataUseDisplayNameProps(
dataUse.fides_key,
);
return {
value: dataUse.fides_key,
name,
primaryName,
description: dataUse.description || "",
};
});

return <TaxonomySelect options={options} {...props} />;
};

export default DataUseSelect;
Loading

0 comments on commit 543a0f4

Please sign in to comment.