-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove DatasetConfig.dataset field + New Get DatasetConfig Endpoints [#…
…1763] (#2096) - Remove the DatasetConfig.dataset column - Throw a 404 if the ctl_dataset_id does not existing when creating a DatasetConfig through the new patch_dataset_configs endpoint - Add new GET datasetconfig list and detail endpoints that include both the fides_key and nested ctl_dataset in the response. The DatasetConfig and CTLDataset are different resources and their fides_keys can differ, so both keys need to be in the response. - Add a fix to prevent existing upsert from attempting to update the id of an existing resource. Datasets are referenced by DatasetConfigs now, we need them to stay the same. - Add more validation before linking an existing CTL Dataset to a DatasetConfig - Update the Ops DatasetConfig Admin UI for parity with existing UI Co-authored-by: Allison King <[email protected]>
- Loading branch information
1 parent
21c46f4
commit e6ad6b3
Showing
80 changed files
with
1,934 additions
and
229 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
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,74 @@ | ||
describe("Connectors", () => { | ||
beforeEach(() => { | ||
cy.login(); | ||
}); | ||
describe("Configuring connectors", () => { | ||
beforeEach(() => { | ||
cy.intercept("GET", "/api/v1/connection*", { | ||
fixture: "connectors/list.json", | ||
}).as("getConnectors"); | ||
cy.intercept("GET", "/api/v1/connection_type*", { | ||
fixture: "connectors/connection_types.json", | ||
}).as("getConnectionTypes"); | ||
cy.intercept("GET", "/api/v1/connection/postgres_connector", { | ||
fixture: "connectors/postgres_connector.json", | ||
}).as("getPostgresConnector"); | ||
cy.intercept("GET", "/api/v1/connection_type/postgres/secret", { | ||
fixture: "connectors/postgres_secret.json", | ||
}).as("getPostgresConnectorSecret"); | ||
cy.intercept( | ||
"GET", | ||
"/api/v1/connection/postgres_connector/datasetconfig", | ||
{ | ||
fixture: "connectors/datasetconfig.json", | ||
} | ||
).as("getPostgresConnectorDatasetconfig"); | ||
|
||
cy.intercept("POST", "/api/v1/dataset/upsert", { body: {} }).as( | ||
"upsertDataset" | ||
); | ||
cy.intercept( | ||
"PATCH", | ||
"/api/v1/connection/postgres_connector/datasetconfig", | ||
{ body: {} } | ||
).as("patchDatasetconfig"); | ||
}); | ||
|
||
it("Should show data store connections and view configuration", () => { | ||
cy.visit("/datastore-connection"); | ||
cy.getByTestId("connection-grid-item-mongodb_connector"); | ||
cy.getByTestId("connection-grid-item-postgres_connector").within(() => { | ||
cy.getByTestId("connection-menu-btn").click(); | ||
}); | ||
cy.getByTestId("connection-menu-postgres_connector").within(() => { | ||
cy.getByTestId("configure-btn").click(); | ||
}); | ||
cy.getByTestId("input-name").should("have.value", "postgres_connector"); | ||
}); | ||
|
||
it("Should allow saving a dataset configuration", () => { | ||
cy.visit("/datastore-connection/postgres_connector"); | ||
cy.getByTestId("tab-Dataset configuration").click(); | ||
cy.wait("@getPostgresConnectorDatasetconfig"); | ||
// The monaco yaml editor takes a bit to load. Since this is likely going away, | ||
// just wait for now and remove this once the yaml editor is no longer available | ||
// eslint-disable-next-line cypress/no-unnecessary-waiting | ||
cy.wait(1000); | ||
cy.getByTestId("save-btn").click(); | ||
cy.wait("@upsertDataset").then((interception) => { | ||
expect(interception.request.body.length).to.eql(1); | ||
expect(interception.request.body[0].fides_key).to.eql( | ||
"postgres_example_test_dataset" | ||
); | ||
}); | ||
cy.wait("@patchDatasetconfig").then((interception) => { | ||
expect(interception.request.body).to.eql([ | ||
{ | ||
fides_key: "postgres_example_test_dataset", | ||
ctl_dataset_fides_key: "postgres_example_test_dataset", | ||
}, | ||
]); | ||
}); | ||
}); | ||
}); | ||
}); |
67 changes: 67 additions & 0 deletions
67
clients/admin-ui/cypress/fixtures/connectors/connection_types.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,67 @@ | ||
{ | ||
"items": [ | ||
{ | ||
"identifier": "bigquery", | ||
"type": "database", | ||
"human_readable": "BigQuery", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "mariadb", | ||
"type": "database", | ||
"human_readable": "MariaDB", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "mongodb", | ||
"type": "database", | ||
"human_readable": "MongoDB", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "mssql", | ||
"type": "database", | ||
"human_readable": "Microsoft SQL Server", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "mysql", | ||
"type": "database", | ||
"human_readable": "MySQL", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "postgres", | ||
"type": "database", | ||
"human_readable": "PostgreSQL", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "redshift", | ||
"type": "database", | ||
"human_readable": "Amazon Redshift", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "snowflake", | ||
"type": "database", | ||
"human_readable": "Snowflake", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "timescale", | ||
"type": "database", | ||
"human_readable": "TimescaleDB", | ||
"encoded_icon": null | ||
}, | ||
{ | ||
"identifier": "manual_webhook", | ||
"type": "manual", | ||
"human_readable": "Manual Webhook", | ||
"encoded_icon": null | ||
} | ||
], | ||
"total": 10, | ||
"page": 1, | ||
"size": 50 | ||
} |
Oops, something went wrong.