Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCF purpose override page #4484

Merged
merged 20 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ The types of changes are:
- New purposes endpoint and indices to improve system lookups [#4452](https://github.com/ethyca/fides/pull/4452)
- Cypress tests for fides.js GPP extension [#4476](https://github.com/ethyca/fides/pull/4476)
- Add support for global TCF Purpose Overrides [#4464](https://github.com/ethyca/fides/pull/4464)
- TCF override management [#4484](https://github.com/ethyca/fides/pull/4484)
- Readonly consent management table and modal [#4456](https://github.com/ethyca/fides/pull/4456), [#4477](https://github.com/ethyca/fides/pull/4477)
- Access and erasure support for Gong [#4461](https://github.com/ethyca/fides/pull/4461)

### Changed
- Increased max number of preferences allowed in privacy preference API calls [#4469](https://github.com/ethyca/fides/pull/4469)
- Reduce size of tcf_consent payload in fides_consent cookie [#4480](https://github.com/ethyca/fides/pull/4480)

### Changed
- Change log level for FidesUserPermission retrieval to `debug` [#4482](https://github.com/ethyca/fides/pull/4482)

### Fixed
Expand Down
1 change: 1 addition & 0 deletions clients/admin-ui/src/features/common/api.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const baseApi = createApi({
"Roles",
"User",
"Configuration Settings",
"TCF Purpose Override",
],
endpoints: () => ({}),
});
11 changes: 9 additions & 2 deletions clients/admin-ui/src/features/common/form/inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ export const CustomNumberInput = ({
};

interface CustomSwitchProps {
label: string;
label?: string;
tooltip?: string;
variant?: "inline" | "condensed" | "stacked";
isDisabled?: boolean;
Expand All @@ -998,6 +998,7 @@ export const CustomSwitch = ({
label,
tooltip,
variant = "inline",
onChange,
isDisabled,
...props
}: CustomSwitchProps & FieldHookConfig<boolean>) => {
Expand All @@ -1008,7 +1009,13 @@ export const CustomSwitch = ({
<Switch
name={field.name}
isChecked={field.checked}
onChange={field.onChange}
onChange={(e) => {
field.onChange(e);
if (onChange) {
// @ts-ignore - it got confused between select/input element events
onChange(e);
}
}}
onBlur={field.onBlur}
colorScheme="purple"
mr={2}
Expand Down
10 changes: 10 additions & 0 deletions clients/admin-ui/src/features/common/nav/v2/nav-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,16 @@ export const NAV_CONFIG: NavConfigGroup[] = [
ScopeRegistryEnum.CONFIG_UPDATE,
],
},
{
title: "Consent",
path: routes.GLOABL_CONSENT_CONFIG_ROUTE,
requiresPlus: true,
requiresFidesCloud: false,
scopes: [
ScopeRegistryEnum.TCF_PUBLISHER_OVERRIDE_READ,
ScopeRegistryEnum.TCF_PUBLISHER_OVERRIDE_UPDATE,
],
},
{
title: "About Fides",
path: routes.ABOUT_ROUTE,
Expand Down
1 change: 1 addition & 0 deletions clients/admin-ui/src/features/common/nav/v2/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ export const CUSTOM_FIELDS_ROUTE = "/management/custom-fields";
export const EMAIL_TEMPLATES_ROUTE = "/management/email-templates";
export const DOMAIN_RECORDS_ROUTE = "/management/domain-records";
export const CORS_CONFIGURATION_ROUTE = "/management/cors-configuration";
export const GLOABL_CONSENT_CONFIG_ROUTE = "/management/consent";
21 changes: 21 additions & 0 deletions clients/admin-ui/src/features/plus/plus.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
SystemScannerStatus,
SystemScanResponse,
SystemsDiff,
TCFPurposeOverrideSchema,
} from "~/types/api";
import {
DataUseDeclaration,
Expand Down Expand Up @@ -428,6 +429,24 @@ const plusApi = baseApi.injectEndpoints({
// Creating a connection config also creates a dataset behind the scenes
invalidatesTags: () => ["Datastore Connection", "Datasets", "System"],
}),
getTcfPurposeOverrides: build.query<TCFPurposeOverrideSchema[], void>({
query: () => ({
url: `plus/tcf/purpose_overrides`,
method: "GET",
}),
providesTags: ["TCF Purpose Override"],
}),
patchTcfPurposeOverrides: build.mutation<
TCFPurposeOverrideSchema[],
TCFPurposeOverrideSchema[]
>({
query: (overrides) => ({
url: `plus/tcf/purpose_overrides`,
method: "PATCH",
body: overrides,
}),
invalidatesTags: ["TCF Purpose Override"],
}),
}),
});

Expand Down Expand Up @@ -465,6 +484,8 @@ export const {
useUpdateCustomAssetMutation,
usePatchPlusSystemConnectionConfigsMutation,
useCreatePlusSaasConnectionConfigMutation,
useGetTcfPurposeOverridesQuery,
usePatchTcfPurposeOverridesMutation,
} = plusApi;

export const selectHealth: (state: RootState) => HealthCheck | undefined =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,14 @@ export const privacyRequestApi = baseApi.injectEndpoints({
}),
invalidatesTags: ["Configuration Settings"],
}),
getConfigurationSettings: build.query<Record<string, any>, void>({
query: () => ({
getConfigurationSettings: build.query<
Record<string, any>,
{ api_set: boolean }
>({
query: ({ api_set }) => ({
url: `/config`,
method: "GET",
params: { api_set: true },
params: { api_set },
}),
providesTags: ["Configuration Settings"],
}),
Expand Down Expand Up @@ -502,7 +505,9 @@ export const selectCORSOrigins = () =>
createSelector(
[
(state) => state,
privacyRequestApi.endpoints.getConfigurationSettings.select(),
privacyRequestApi.endpoints.getConfigurationSettings.select({
api_set: true,
}),
],
(_, { data }) => {
const hasCorsOrigins = narrow(
Expand All @@ -525,7 +530,9 @@ export const selectApplicationConfig = () =>
createSelector(
[
(state) => state,
privacyRequestApi.endpoints.getConfigurationSettings.select(),
privacyRequestApi.endpoints.getConfigurationSettings.select({
api_set: true,
}),
],
(_, { data }) => data as ApplicationConfig
);
Loading