-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix_hubspot_test
- Loading branch information
Showing
80 changed files
with
2,948 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
}, | ||
); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
clients/admin-ui/cypress/fixtures/data-catalog/catalog-projects.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
33 changes: 33 additions & 0 deletions
33
clients/admin-ui/cypress/fixtures/data-catalog/catalog-systems.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
28
clients/admin-ui/cypress/fixtures/data-catalog/catalog-tables.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
clients/admin-ui/src/features/common/dropdown/DataCategorySelect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
36
clients/admin-ui/src/features/common/dropdown/DataUseSelect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.