Skip to content

Commit

Permalink
Add Cookies and Surface with Privacy Notices (#3572)
Browse files Browse the repository at this point in the history
 - Backend: Add a Cookies table with FK's to PrivacyDeclaration and System.  Surface cookies on privacy notices, calculated at runtime
- Frontend: Add cookie input field on system data use tab
- Frontend: Have `fides-js` and privacy center delete cookies associated with notices that were opted out of 


Co-authored-by: Thomas <[email protected]>
Co-authored-by: Thomas <[email protected]>
Co-authored-by: Allison King <[email protected]>
  • Loading branch information
4 people committed Jun 22, 2023
1 parent 55c3607 commit a3e1fbd
Show file tree
Hide file tree
Showing 73 changed files with 1,391 additions and 255 deletions.
37 changes: 37 additions & 0 deletions .fides/db_dataset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2240,4 +2240,41 @@ dataset:
description: 'The name of the organization this Fides deployment belongs to'
data_categories:
- user.workplace
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: cookies
description: 'Fides Generated Description for Table: cookies'
data_categories: []
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
fields:
- name: created_at
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: domain
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: name
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: path
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: privacy_declaration_id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: system_id
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
- name: updated_at
data_categories:
- system.operations
data_qualifier: aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ The types of changes are:
- HTML format for privacy request storage destinations [#3427](https://github.com/ethyca/fides/pull/3427)
- Persistent message showing result and timestamp of last integration test to "Integrations" tab in system view [#3628](https://github.com/ethyca/fides/pull/3628)
- Access and erasure support for SurveyMonkey [#3590](https://github.com/ethyca/fides/pull/3590)
- New Cookies Table for storing cookies associated with systems and privacy declarations [#3572](https://github.com/ethyca/fides/pull/3572)
- `fides-js` and privacy center now delete cookies associated with notices that were opted out of [#3569](https://github.com/ethyca/fides/pull/3569)
- Cookie input field on system data use tab [#3571](https://github.com/ethyca/fides/pull/3571)

### Fixed

Expand Down Expand Up @@ -198,7 +201,7 @@ The types of changes are:

### Developer Experience

- Use prettier to format *all* source files in client packages [#3240](https://github.com/ethyca/fides/pull/3240)
- Use prettier to format _all_ source files in client packages [#3240](https://github.com/ethyca/fides/pull/3240)

### Deprecated

Expand Down
2 changes: 2 additions & 0 deletions clients/admin-ui/cypress/e2e/systems.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ describe("System management page", () => {
data_categories: declaration.data_categories,
data_subjects: declaration.data_subjects,
dataset_references: ["demo_users_dataset_2"],
cookies: [],
id: "",
});
});
});
Expand Down
4 changes: 3 additions & 1 deletion clients/admin-ui/cypress/fixtures/systems/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["customer"],
"dataset_references": ["demo_users_dataset"]
"dataset_references": ["demo_users_dataset"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": { "name": "Sally Controller" },
Expand Down
12 changes: 9 additions & 3 deletions clients/admin-ui/cypress/fixtures/systems/systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["anonymous_user"],
"dataset_references": ["public"]
"dataset_references": ["public"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": null,
Expand Down Expand Up @@ -59,7 +61,9 @@
"data_subjects": ["customer"],
"dataset_references": ["demo_users_dataset"],
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
}
],
"joint_controller": null,
Expand Down Expand Up @@ -99,7 +103,9 @@
"data_subjects": ["customer"],
"dataset_references": null,
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_06430a1c-1365-422e-90a7-d444ddb32181"
}
],
"joint_controller": null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"data_use": "improve.system",
"data_qualifier": "aggregated.anonymized.unlinked_pseudonymized.pseudonymized.identified",
"data_subjects": ["anonymous_user"],
"dataset_references": ["public"]
"dataset_references": ["public"],
"cookies": [],
"id": "pri_ac9d4dfb-d033-4b06-bc7f-968df8d125ff"
},
{
"name": "Collect data for marketing",
Expand All @@ -27,7 +29,9 @@
"data_subjects": ["customer"],
"dataset_references": null,
"egress": null,
"ingress": null
"ingress": null,
"cookies": [],
"id": "pri_bc6e6efe-f122-3e33-ac9a-732ae8b437bb"
}
],
"joint_controller": null,
Expand Down
19 changes: 12 additions & 7 deletions clients/admin-ui/src/features/common/form/inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,21 +316,26 @@ const CreatableSelectInput = ({
size={size}
classNamePrefix="custom-creatable-select"
chakraStyles={{
container: (provided) => ({ ...provided, flexGrow: 1 }),
container: (provided) => ({
...provided,
flexGrow: 1,
backgroundColor: "white",
}),
dropdownIndicator: (provided) => ({
...provided,
background: "white",
bg: "transparent",
px: 2,
cursor: "inherit",
}),
indicatorSeparator: (provided) => ({
...provided,
display: "none",
}),
multiValue: (provided) => ({
...provided,
background: "primary.400",
color: "white",
}),
multiValueRemove: (provided) => ({
...provided,
display: "none",
visibility: "hidden",
}),
}}
components={components}
isSearchable={isSearchable}
Expand Down
2 changes: 1 addition & 1 deletion clients/admin-ui/src/features/system/SystemFormTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const SystemFormTabs = ({
label: "Data uses",
content: activeSystem ? (
<Box px={6} width={{ base: "100%", lg: "70%" }}>
<PrivacyDeclarationStep system={activeSystem as System} />
<PrivacyDeclarationStep system={activeSystem} />
</Box>
) : null,
isDisabled: !activeSystem,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,40 @@ import {
import { Form, Formik } from "formik";

import { FormGuard } from "~/features/common/hooks/useIsAnyFormDirty";
import { PrivacyDeclarationResponse } from "~/types/api";

import {
DataProps,
PrivacyDeclarationFormComponents,
usePrivacyDeclarationForm,
ValidationSchema,
} from "./PrivacyDeclarationForm";
import { PrivacyDeclarationWithId } from "./types";

interface AccordionProps extends DataProps {
privacyDeclarations: PrivacyDeclarationWithId[];
privacyDeclarations: PrivacyDeclarationResponse[];
onEdit: (
oldDeclaration: PrivacyDeclarationWithId,
newDeclaration: PrivacyDeclarationWithId
) => Promise<PrivacyDeclarationWithId[] | undefined>;
oldDeclaration: PrivacyDeclarationResponse,
newDeclaration: PrivacyDeclarationResponse
) => Promise<PrivacyDeclarationResponse[] | undefined>;
onDelete: (
declaration: PrivacyDeclarationWithId
) => Promise<PrivacyDeclarationWithId[] | undefined>;
declaration: PrivacyDeclarationResponse
) => Promise<PrivacyDeclarationResponse[] | undefined>;
includeCustomFields?: boolean;
includeCookies?: boolean;
}

const PrivacyDeclarationAccordionItem = ({
privacyDeclaration,
onEdit,
onDelete,
includeCustomFields,
includeCookies,
...dataProps
}: { privacyDeclaration: PrivacyDeclarationWithId } & Omit<
}: { privacyDeclaration: PrivacyDeclarationResponse } & Omit<
AccordionProps,
"privacyDeclarations"
>) => {
const handleEdit = (values: PrivacyDeclarationWithId) =>
const handleEdit = (values: PrivacyDeclarationResponse) =>
onEdit(privacyDeclaration, values);

const { initialValues, renderHeader, handleSubmit } =
Expand Down Expand Up @@ -85,6 +87,7 @@ const PrivacyDeclarationAccordionItem = ({
privacyDeclarationId={privacyDeclaration.id}
onDelete={onDelete}
includeCustomFields={includeCustomFields}
includeCookies={includeCookies}
{...dataProps}
/>
</Stack>
Expand Down
Loading

0 comments on commit a3e1fbd

Please sign in to comment.