Skip to content

Commit b22b0fe

Browse files
authored
Merge branch 'main' into gill/pr-split-cypress-workflows
2 parents 6d25ef9 + 3673f9d commit b22b0fe

13 files changed

+402
-7
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
2727
- Added support for GPP String integration in Fides String [#5845](https://github.com/ethyca/fides/pull/5845)
2828
- Attachments storage capabilities (S3 or local) [#5812](https://github.com/ethyca/fides/pull/5812) https://github.com/ethyca/fides/labels/db-migration
2929
- DB model support for Comments [#5833](https://github.com/ethyca/fides/pull/5833/files) https://github.com/ethyca/fides/labels/db-migration
30+
- Added UI for configuring website integrations and monitors [#5867](https://github.com/ethyca/fides/pull/5867)
3031

3132
### Changed
3233
- Bumped supported Python versions to `3.10.16` and `3.9.21` [#5840](https://github.com/ethyca/fides/pull/5840)

clients/admin-ui/cypress/e2e/integration-management.cy.ts

+66-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { stubPlus, stubSystemCrud } from "cypress/support/stubs";
1+
import { stubLocations, stubPlus, stubSystemCrud } from "cypress/support/stubs";
22

33
import { INTEGRATION_MANAGEMENT_ROUTE } from "~/features/common/nav/routes";
44

@@ -435,5 +435,70 @@ describe("Integration management for data detection & discovery", () => {
435435
cy.wait("@putMonitor");
436436
});
437437
});
438+
439+
describe("data discovery tab for website integration", () => {
440+
beforeEach(() => {
441+
stubLocations();
442+
cy.intercept("GET", "/api/v1/connection/*", {
443+
fixture: "connectors/website_integration.json",
444+
}).as("getWebsiteIntegration");
445+
cy.intercept("GET", "/api/v1/plus/discovery-monitor*", {
446+
fixture: "detection-discovery/monitors/website_monitor_list.json",
447+
}).as("getMonitors");
448+
cy.intercept("GET", "/api/v1/connection_type", {
449+
fixture: "connectors/connection_types.json",
450+
}).as("getConnectionTypes");
451+
cy.getByTestId("tab-Data discovery").click();
452+
cy.wait("@getMonitors");
453+
});
454+
455+
it("should render the website monitor list", () => {
456+
cy.getByTestId("monitor-description").contains(
457+
"Configure your website monitor",
458+
);
459+
cy.getByTestId("row-test website monitor-col-name").should(
460+
"contain",
461+
"test website monitor",
462+
);
463+
});
464+
465+
it("should allow creating a website monitor", () => {
466+
cy.intercept("PUT", "/api/v1/plus/discovery-monitor*", {
467+
response: 200,
468+
}).as("putMonitor");
469+
cy.getByTestId("add-monitor-btn").click();
470+
cy.getByTestId("input-name").type("A new website monitor");
471+
cy.getByTestId("input-url")
472+
.should("be.disabled")
473+
.and("have.value", "http://example.com");
474+
cy.getByTestId(
475+
"controlled-select-datasource_params.locations",
476+
).antSelect("France");
477+
cy.getByTestId("controlled-select-execution_frequency").click({
478+
force: true,
479+
});
480+
cy.getByTestId("controlled-select-execution_frequency").antSelect(
481+
"Daily",
482+
);
483+
cy.getByTestId("input-execution_start_date").type("2034-06-03T10:00");
484+
cy.getByTestId("save-btn").click();
485+
cy.wait("@putMonitor");
486+
});
487+
488+
it("should allow editing a website monitor", () => {
489+
cy.intercept("PUT", "/api/v1/plus/discovery-monitor*", {
490+
response: 200,
491+
}).as("putMonitor");
492+
cy.getByTestId("row-test website monitor").click();
493+
cy.getByTestId("input-name")
494+
.should("have.value", "test website monitor")
495+
.clear()
496+
.type("A different name");
497+
cy.getByTestId("save-btn").click();
498+
cy.wait("@putMonitor").then((interception) => {
499+
expect(interception.request.body.name).to.equal("A different name");
500+
});
501+
});
502+
});
438503
});
439504
});

clients/admin-ui/cypress/fixtures/connectors/connection_types.json

+6
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@
105105
"authorization_required": false,
106106
"user_guide": "https://docs.ethyca.com/user-guides/integrations/saas-integrations/iterable",
107107
"supported_actions": ["erasure", "consent"]
108+
},
109+
{
110+
"identifier": "website",
111+
"type": "website",
112+
"human_readable": "Website",
113+
"encoded_icon": null
108114
}
109115
],
110116
"total": 10,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "test website integration",
3+
"key": "test_website_integration",
4+
"connection_type": "website",
5+
"access": "write",
6+
"disabled": false,
7+
"saas_config": null,
8+
"secrets": {
9+
"url": "http://example.com"
10+
},
11+
"authorized": false,
12+
"enabled_actions": null
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"items": [
3+
{
4+
"name": "test website monitor",
5+
"key": "test_website_monitor",
6+
"connection_config_key": "test_website_integration",
7+
"classify_params": {},
8+
"datasource_params": {
9+
"locations": ["us", "ca"],
10+
"exclude_domains": ["example.com"]
11+
},
12+
"databases": [],
13+
"excluded_databases": [],
14+
"enabled": true
15+
},
16+
{
17+
"name": "test website monitor 2",
18+
"key": "test_website_monitor_2",
19+
"connection_config_key": "test_website_integration",
20+
"classify_params": {},
21+
"datasource_params": {
22+
"locations": ["us", "ca"],
23+
"exclude_domains": ["example.com"]
24+
},
25+
"databases": [],
26+
"excluded_databases": [],
27+
"enabled": true
28+
}
29+
],
30+
"total": 2,
31+
"page": 1,
32+
"size": 10,
33+
"pages": 1
34+
}

clients/admin-ui/src/features/integrations/ConnectionCategory.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum ConnectionCategory {
22
DATA_CATALOG = "Data Catalog",
33
DATA_WAREHOUSE = "Data Warehouse",
44
DATABASE = "Database",
5+
WEBSITE = "Website",
56
}

clients/admin-ui/src/features/integrations/add-integration/AddIntegrationModal.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ const AddIntegrationModal = ({
4949
: "Add integration";
5050

5151
return (
52-
<FormModal isOpen={isOpen} onClose={handleCancel} title={modalTitle}>
52+
<FormModal
53+
size="2xl"
54+
isOpen={isOpen}
55+
onClose={handleCancel}
56+
title={modalTitle}
57+
>
5358
{step === IntegrationModalStep.LIST_VIEW && (
5459
<SelectIntegrationType
5560
onCancel={handleCancel}

clients/admin-ui/src/features/integrations/add-integration/allIntegrationTypes.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import RDS_POSTGRES_TYPE_INFO from "~/features/integrations/integration-type-inf
1313
import S3_TYPE_INFO from "~/features/integrations/integration-type-info/s3Info";
1414
import SCYLLA_TYPE_INFO from "~/features/integrations/integration-type-info/scyllaInfo";
1515
import SNOWFLAKE_TYPE_INFO from "~/features/integrations/integration-type-info/snowflakeInfo";
16+
import WEBSITE_INTEGRATION_TYPE_INFO from "~/features/integrations/integration-type-info/websiteInfo";
1617
import {
1718
AccessLevel,
1819
ConnectionConfigurationResponse,
@@ -41,6 +42,7 @@ const INTEGRATION_TYPE_MAP: { [K in ConnectionType]?: IntegrationTypeInfo } = {
4142
[ConnectionType.SCYLLA]: SCYLLA_TYPE_INFO,
4243
[ConnectionType.SNOWFLAKE]: SNOWFLAKE_TYPE_INFO,
4344
[ConnectionType.MYSQL]: MYSQL_TYPE_INFO,
45+
[ConnectionType.WEBSITE]: WEBSITE_INTEGRATION_TYPE_INFO,
4446
};
4547

4648
export const INTEGRATION_TYPE_LIST: IntegrationTypeInfo[] =

clients/admin-ui/src/features/integrations/configure-monitor/ConfigureMonitorModal.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ import {
1010
} from "~/features/data-discovery-and-detection/discovery-detection.slice";
1111
import ConfigureMonitorDatabasesForm from "~/features/integrations/configure-monitor/ConfigureMonitorDatabasesForm";
1212
import ConfigureMonitorForm from "~/features/integrations/configure-monitor/ConfigureMonitorForm";
13+
import ConfigureWebsiteMonitorForm from "~/features/integrations/configure-monitor/ConfigureWebsiteMonitorForm";
1314
import {
1415
ConnectionConfigurationResponse,
1516
ConnectionSystemTypeMap,
17+
ConnectionType,
1618
MonitorConfig,
1719
} from "~/types/api";
1820
import { isErrorResult, RTKResult } from "~/types/errors";
@@ -82,6 +84,28 @@ const ConfigureMonitorModal = ({
8284
}
8385
};
8486

87+
if (integrationOption.identifier === ConnectionType.WEBSITE) {
88+
return (
89+
<FormModal
90+
title={
91+
monitor?.name
92+
? `Configure ${monitor.name}`
93+
: "Configure website monitor"
94+
}
95+
isOpen={isOpen}
96+
onClose={onClose}
97+
>
98+
<ConfigureWebsiteMonitorForm
99+
monitor={monitor}
100+
// @ts-ignore - "secrets" is typed as "null"
101+
url={integration.secrets!.url as string}
102+
onClose={onClose}
103+
onSubmit={handleSubmit}
104+
/>
105+
</FormModal>
106+
);
107+
}
108+
85109
return (
86110
<FormModal
87111
title={

0 commit comments

Comments
 (0)