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

Release 2.49.1 #5485

Closed
wants to merge 13 commits into from
Closed
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
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ The types of changes are:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fidesplus/compare/2.49.0...main)

## [2.49.1](https://github.com/ethyca/fidesplus/compare/2.49.0...2.49.1)

### Added
- Added support for GPP national string to be used alongside state-by-state using a new approach option [#5480](https://github.com/ethyca/fides/pull/5480)
- Added "Powered by" branding link to privacy center and Layer 2 CMP [#5483](https://github.com/ethyca/fides/pull/5483)
- Added loading state to the toggle switches on the Manage privacy notices page [#5489](https://github.com/ethyca/fides/pull/5489)
- Support BlueConic objectives [#5479](https://github.com/ethyca/fides/pull/5479)

### Fixed
- Use BlueConic Profile API correctly. [#5487](https://github.com/ethyca/fides/pull/5487)
- Fixed a bug where branding link was sometimes misaligned [#5496](https://github.com/ethyca/fides/pull/5496)

## [2.49.0](https://github.com/ethyca/fidesplus/compare/2.48.2...2.49.0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ const GppConfiguration = () => {
tooltip:
"When state-by-state is selected, Fides will only present consent to consumers and save their preferences if they are located in a state that is supported by the GPP. The consent options presented to consumers will vary depending on the regulations in each state.",
},
{
label: "Enable US National and State-by-State notices",
value: GPPUSApproach.ALL,
tooltip:
"When enabled, Fides can be configured to serve the National and U.S. state notices. This mode is intended to provide consent coverage to U.S. states with new privacy laws where GPP support lags behind the effective date of state laws.",
},
]}
/>
</Section>
Expand Down
12 changes: 9 additions & 3 deletions clients/admin-ui/src/features/privacy-notices/cells.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CellContext } from "@tanstack/react-table";
import { Badge, TagProps, Tooltip } from "fidesui";
import React from "react";
import React, { useState } from "react";

import { PRIVACY_NOTICE_REGION_MAP } from "~/features/common/privacy-notice-regions";
import { EnableCell } from "~/features/common/table/v2/cells";
Expand Down Expand Up @@ -129,13 +129,18 @@ export const EnablePrivacyNoticeCell = ({
getValue,
}: CellContext<LimitedPrivacyNoticeResponseSchema, boolean>) => {
const [patchNoticeMutationTrigger] = useLimitedPatchPrivacyNoticesMutation();
const [isLoading, setIsLoading] = useState(false);

const disabled = getValue();
const onToggle = async (toggle: boolean) =>
patchNoticeMutationTrigger({
const onToggle = async (toggle: boolean) => {
setIsLoading(true);
const response = await patchNoticeMutationTrigger({
id: row.original.id,
disabled: !toggle,
});
setIsLoading(false);
return response;
};

const {
systems_applicable: systemsApplicable,
Expand All @@ -155,6 +160,7 @@ export const EnablePrivacyNoticeCell = ({
message="Are you sure you want to disable this privacy notice? Disabling this
notice means your users will no longer see this explanation about
your data uses which is necessary to ensure compliance."
loading={isLoading}
/>
);
};
1 change: 1 addition & 0 deletions clients/admin-ui/src/pages/settings/consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ const ConsentConfigPage: NextPage = () => {
disabled={!dirty || !isValid}
loading={isSubmitting}
data-testid="save-btn"
className="self-start"
>
Save
</Button>
Expand Down
1 change: 1 addition & 0 deletions clients/admin-ui/src/types/api/models/GPPUSApproach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
export enum GPPUSApproach {
NATIONAL = "national",
STATE = "state",
ALL = "all",
}
105 changes: 105 additions & 0 deletions clients/fides-js/__tests__/integrations/blueconic.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
import { FidesGlobal } from "../../src/fides";
import { blueconic } from "../../src/integrations/blueconic";
import { MARKETING_CONSENT_KEYS } from "../../src/lib/consent-constants";

const getBlueConicEvent = () =>
({
subscribe: () => {},
}) as const;

const setupBlueConicClient = (
initialized: "initialized" | "uinitialized" = "initialized",
) => {
const mockProfile = {
setConsentedObjectives: jest.fn(),
setRefusedObjectives: jest.fn(),
};
const client = {
profile: {
getProfile: jest.fn(() => mockProfile),
updateProfile: jest.fn(),
},
event: initialized === "initialized" ? getBlueConicEvent() : undefined,
} as const satisfies typeof window.blueConicClient;

window.blueConicClient = client;

return { client, mockProfile };
};

const setupFidesWithConsent = (key: string, optInStatus: boolean) => {
window.Fides = {
consent: {
[key]: optInStatus,
},
} as any as FidesGlobal;
};

describe("blueconic", () => {
afterEach(() => {
window.blueConicClient = undefined;
window.Fides = undefined as any;
jest.resetAllMocks();
});

test("that other modes are not supported", () => {
expect(() => blueconic({ approach: "other mode" as "onetrust" })).toThrow();
});

test("that nothing happens when blueconic and fides are not initialized", () => {
const { mockProfile } = setupBlueConicClient("uinitialized");

blueconic();

expect(mockProfile.setConsentedObjectives).not.toHaveBeenCalled();
expect(mockProfile.setRefusedObjectives).not.toHaveBeenCalled();
expect(
window.blueConicClient?.profile?.updateProfile,
).not.toHaveBeenCalled();
});

describe.each(MARKETING_CONSENT_KEYS)(
"when consent is set via the %s key",
(key) => {
test.each([
[
"opted in",
true,
["iab_purpose_1", "iab_purpose_2", "iab_purpose_3", "iab_purpose_4"],
[],
],
[
"opted out",
false,
["iab_purpose_1"],
["iab_purpose_2", "iab_purpose_3", "iab_purpose_4"],
],
])(
"that a user who has %s gets the correct consented and refused objectives",
(_, optInStatus, consented, refused) => {
const { client, mockProfile } = setupBlueConicClient();
setupFidesWithConsent(key, optInStatus);

blueconic();

expect(mockProfile.setConsentedObjectives).toHaveBeenCalledWith(
consented,
);
expect(mockProfile.setRefusedObjectives).toHaveBeenCalledWith(
refused,
);
expect(client.profile.updateProfile).toHaveBeenCalled();
},
);
},
);

test.each(["FidesInitialized", "FidesUpdated", "onBlueConicLoaded"])(
"that %s event can cause objectives to be set",
(eventName) => {
const spy = jest.spyOn(window, "addEventListener");
blueconic();
expect(spy).toHaveBeenCalledWith(eventName, expect.any(Function));
},
);
});
Loading
Loading