diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c905c8bce..d205a4d4a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The types of changes are: - Added new column for Action Type in privacy request event logs [#5546](https://github.com/ethyca/fides/pull/5546) - Added `fides_consent_override` option in FidesJS SDK [#5541](https://github.com/ethyca/fides/pull/5541) - Added new `script` ConsentMethod in FidesJS SDK for tracking automated consent [#5541](https://github.com/ethyca/fides/pull/5541) +- Added a new page under system integrations to run standalone dataset tests (Fidesplus) [#5549](https://github.com/ethyca/fides/pull/5549) ### Changed - Adding hashes to system tab URLs [#5535](https://github.com/ethyca/fides/pull/5535) diff --git a/clients/admin-ui/src/app/store.ts b/clients/admin-ui/src/app/store.ts index 4945966089..af87c45e3d 100644 --- a/clients/admin-ui/src/app/store.ts +++ b/clients/admin-ui/src/app/store.ts @@ -41,6 +41,7 @@ import { propertySlice } from "~/features/properties"; import { systemSlice } from "~/features/system"; import { dictSuggestionsSlice } from "~/features/system/dictionary-form/dict-suggestion.slice"; import { taxonomySlice } from "~/features/taxonomy"; +import { datasetTestSlice } from "~/features/test-datasets"; import { userManagementSlice } from "~/features/user-management"; /** @@ -79,6 +80,7 @@ const reducer = { [dataSubjectsSlice.name]: dataSubjectsSlice.reducer, [dataUseSlice.name]: dataUseSlice.reducer, [datasetSlice.name]: datasetSlice.reducer, + [datasetTestSlice.name]: datasetTestSlice.reducer, [datastoreConnectionSlice.name]: datastoreConnectionSlice.reducer, [discoveryDetectionSlice.name]: discoveryDetectionSlice.reducer, [featuresSlice.name]: featuresSlice.reducer, diff --git a/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx index b17fc8b9e6..e1050d9cd3 100644 --- a/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/add-connection/forms/ConnectorParametersForm.tsx @@ -63,7 +63,7 @@ const ConnectorParametersForm = ({ isSubmitting = false, onSaveClick, onTestConnectionClick, - testButtonLabel = "Test connection", + testButtonLabel = "Test integration", }: ConnectorParametersFormProps) => { const mounted = useRef(false); const { handleError } = useAPIHelper(); diff --git a/clients/admin-ui/src/features/datastore-connections/datastore-connection.slice.ts b/clients/admin-ui/src/features/datastore-connections/datastore-connection.slice.ts index dc8e67f509..58ae66a793 100644 --- a/clients/admin-ui/src/features/datastore-connections/datastore-connection.slice.ts +++ b/clients/admin-ui/src/features/datastore-connections/datastore-connection.slice.ts @@ -380,6 +380,40 @@ export const datastoreConnectionApi = baseApi.injectEndpoints({ }), invalidatesTags: () => ["Datastore Connection"], }), + testDatastoreConnectionDatasets: build.mutation< + { privacy_request_id: string }, + { + connection_key: string; + dataset_key: string; + input_data: Record; + } + >({ + query: (params) => ({ + url: `${CONNECTION_ROUTE}/${params.connection_key}/dataset/${params.dataset_key}/test`, + method: "POST", + body: params.input_data, + }), + }), + getDatasetInputs: build.query< + any, + { connectionKey: string; datasetKey: string } + >({ + query: ({ connectionKey, datasetKey }) => ({ + url: `${CONNECTION_ROUTE}/${connectionKey}/dataset/${datasetKey}/inputs`, + method: "GET", + }), + providesTags: () => ["Datastore Connection"], + }), + getDatasetReachability: build.query< + { reachable: boolean; details: string }, + { connectionKey: string; datasetKey: string } + >({ + query: ({ connectionKey, datasetKey }) => ({ + url: `${CONNECTION_ROUTE}/${connectionKey}/dataset/${datasetKey}/reachability`, + method: "GET", + }), + providesTags: () => ["Datastore Connection"], + }), }), }); @@ -402,6 +436,9 @@ export const { usePatchDatastoreConnectionsMutation, useUpdateDatastoreConnectionSecretsMutation, usePatchDatastoreConnectionSecretsMutation, + useTestDatastoreConnectionDatasetsMutation, + useGetDatasetInputsQuery, + useGetDatasetReachabilityQuery, } = datastoreConnectionApi; /** diff --git a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParameters.tsx b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParameters.tsx index 86565794d1..7697b755e2 100644 --- a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParameters.tsx +++ b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParameters.tsx @@ -12,6 +12,7 @@ import { DatastoreConnectionSecretsResponse, } from "datastore-connections/types"; import { Box, Flex, Spacer, useToast, UseToastOptions } from "fidesui"; +import router from "next/router"; import { useMemo, useState } from "react"; import { useAppDispatch, useAppSelector } from "~/app/hooks"; @@ -391,6 +392,10 @@ export const ConnectorParameters = ({ }, ); + const handleTestDatasetsClick = () => { + router.push(`/systems/configure/${systemFidesKey}/test-datasets`); + }; + const { isSubmitting, isAuthorizing, @@ -450,6 +455,7 @@ export const ConnectorParameters = ({ isAuthorizing={isAuthorizing} onSaveClick={handleSubmit} onTestConnectionClick={handleTestConnectionClick} + onTestDatasetsClick={handleTestDatasetsClick} onAuthorizeConnectionClick={handleAuthorization} connectionOption={connectionOption} connectionConfig={connectionConfig} diff --git a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx index a25d5fc6b7..dae5bce4b1 100644 --- a/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx +++ b/clients/admin-ui/src/features/datastore-connections/system_portal_config/forms/ConnectorParametersForm.tsx @@ -62,6 +62,10 @@ type ConnectorParametersFormProps = { * Parent callback when Test Connection is clicked */ onTestConnectionClick: (value: TestConnectionResponse) => void; + /** + * Parent callback when Test Dataset is clicked + */ + onTestDatasetsClick: () => void; /** * Text for the test button. Defaults to "Test connection" */ @@ -86,6 +90,7 @@ export const ConnectorParametersForm = ({ isAuthorizing = false, onSaveClick, onTestConnectionClick, + onTestDatasetsClick, onAuthorizeConnectionClick, testButtonLabel = "Test integration", connectionOption, @@ -517,6 +522,11 @@ export const ConnectorParametersForm = ({ {testButtonLabel} ) : null} + {isPlusEnabled && !_.isEmpty(initialDatasets) && ( + + )} {connectionOption.authorization_required && !authorized ? (