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

Support the “minimal” TCF experience API and dynamically fetch “full” API response after banner is shown #5230

Merged
merged 24 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
cd92b30
add `PrivacyExperienceMinimal` type to prep for new response
gilluminate Aug 19, 2024
d069533
Modify the layout of the purposes
gilluminate Aug 20, 2024
b93e849
include meta.version_hash for cookie support
gilluminate Aug 21, 2024
93f7882
Notices served working with minimal exp. Type fixes
gilluminate Aug 21, 2024
2d4d9c0
fix vendor count when value is zero
gilluminate Aug 21, 2024
6ab78d1
include purposes
gilluminate Aug 21, 2024
c256171
hydrate with the full experience when available
gilluminate Aug 21, 2024
6960c67
stricter Typing to help avoid errors
gilluminate Aug 22, 2024
2b83732
i18n language support for minimal TCF experience
gilluminate Aug 22, 2024
b11aed3
disable buttons while full experience loads
gilluminate Aug 22, 2024
4dbb2e5
consolidate all of i18n references under the context
gilluminate Aug 22, 2024
7c514e0
Load GVL translations as needed and enable spinner
gilluminate Aug 22, 2024
f5c7a2a
ensure gzip is being requested
gilluminate Aug 23, 2024
6345c36
move utilities out of the component
gilluminate Aug 23, 2024
193ea69
extract and re-render GVL Purpose list
gilluminate Aug 23, 2024
bed1d36
fix link in docs
gilluminate Aug 23, 2024
04871a7
1 note. 1 fix.
gilluminate Aug 26, 2024
c8448b3
fix bug where default translation wasn't loading as expected
gilluminate Aug 27, 2024
fa26e74
fix lots of TCF specific tests with new stub
gilluminate Aug 27, 2024
b44d65c
fix remaining tests
gilluminate Aug 28, 2024
c360a34
rename for clarity
gilluminate Aug 28, 2024
150d522
fix build
gilluminate Aug 28, 2024
0ad0769
add docs to new stub
gilluminate Aug 28, 2024
4cb5277
Update CHANGELOG.md
gilluminate Aug 28, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The types of changes are:
- Removed unused `username` parameter from the Delighted integration configuration [#5220](https://github.com/ethyca/fides/pull/5220)
- Removed unused `ad_account_id` parameter from the Snap integration configuration [#5229](https://github.com/ethyca/fides/pull/5220)
- Updates to support consent signal processing (Fidesplus) [#5200](https://github.com/ethyca/fides/pull/5200)
- TCF Optimized for performance on initial load by offsetting most experience data until after banner is shown [#5230](https://github.com/ethyca/fides/pull/5230)

### Developer Experience
- Sourcemaps are now working for fides-js in debug mode [#5222](https://github.com/ethyca/fides/pull/5222)
Expand Down
226 changes: 0 additions & 226 deletions clients/fides-js/__tests__/lib/tcf/stacks.ts

This file was deleted.

30 changes: 29 additions & 1 deletion clients/fides-js/__tests__/lib/tcf/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ import * as uuid from "uuid";
import { PrivacyExperience, UserConsentPreference } from "~/lib/consent-types";
import { makeFidesCookie } from "~/lib/cookie";
import {
GVLTranslations,
TcfExperienceRecords,
TCFPurposeConsentRecord,
TCFVendorConsentRecord,
} from "~/lib/tcf/types";
import { updateExperienceFromCookieConsentTcf } from "~/lib/tcf/utils";
import {
getGVLPurposeList,
updateExperienceFromCookieConsentTcf,
} from "~/lib/tcf/utils";

import mockGVLTranslationsJSON from "../../__fixtures__/mock_gvl_translations.json";

// Setup mock date
const MOCK_DATE = "2023-01-01T12:00:00.000Z";
Expand Down Expand Up @@ -170,3 +176,25 @@ describe("updateExperienceFromCookieConsentTcf", () => {
});
});
});

describe("getGVLPurposeList", () => {
it("can pull out the purpose list from the GVL", () => {
const gvl = mockGVLTranslationsJSON as GVLTranslations;
const purposeList = getGVLPurposeList(gvl.en);
expect(purposeList).toEqual([
"Store and/or access information on a device",
"Use limited data to select advertising",
"Create profiles for personalised advertising",
"Use profiles to select personalised advertising",
"Create profiles to personalise content",
"Use profiles to select personalised content",
"Measure advertising performance",
"Measure content performance",
"Understand audiences through statistics or combinations of data from different sources",
"Develop and improve services",
"Use limited data to select content",
"Use precise geolocation data",
"Actively scan device characteristics for identification",
]);
});
});
2 changes: 1 addition & 1 deletion clients/fides-js/docs/interfaces/Fides.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ However, initialization can be called manually if needed - for example to delay
initialization until after your own custom JavaScript has run to set up some
config options. In this case, you can disable the automatic initialization
by including the query param `initialize=false` in the Fides script URL
(see /docs/dev-docs/js/privacy-center-fidesjs-hosting for details).
(see (Privacy Center FidesJS Hosting)[/docs/dev-docs/js/privacy-center-fidesjs-hosting] for details).
You will then need to call `Fides.init()` manually at the appropriate time.

This function can also be used to reinitialize FidesJS. This is useful when
Expand Down
3 changes: 2 additions & 1 deletion clients/fides-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "jest --watchAll",
"test:ci": "jest"
"test:ci": "jest",
"typecheck": "tsc --noEmit"
},
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions clients/fides-js/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface ButtonProps {
id?: string;
onClick?: () => void;
className?: string;
disabled?: boolean;
}

const Button: FunctionComponent<ButtonProps> = ({
Expand All @@ -16,13 +17,15 @@ const Button: FunctionComponent<ButtonProps> = ({
id,
onClick,
className = "",
disabled,
}) => (
<button
type="button"
id={id}
className={`fides-banner-button fides-banner-button-${buttonType.valueOf()} ${className}`}
onClick={onClick}
data-testid={`${label}-btn`}
disabled={disabled}
>
{label || ""}
</button>
Expand Down
Loading
Loading