From 44aa3bd0c5de4de9e129a6afa2c2c9035f0b0da4 Mon Sep 17 00:00:00 2001 From: Neville Samuell Date: Tue, 16 Apr 2024 17:09:03 -0400 Subject: [PATCH] Correctly hide privacy policy link unless both label & URL are set (#4801) --- CHANGELOG.md | 1 + clients/fides-js/src/components/PrivacyPolicyLink.tsx | 2 +- clients/privacy-center/cypress/e2e/consent-i18n.cy.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc5122082f..96c5a78189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The types of changes are: ### Fixed - Fixed bug prevented adding new privacy center translations [#4786](https://github.com/ethyca/fides/pull/4786) +- Fixed bug where Privacy Policy links would be shown without a configured URL [#4801](https://github.com/ethyca/fides/pull/4801) ## [2.34.0](https://github.com/ethyca/fides/compare/2.33.1...2.34.0) diff --git a/clients/fides-js/src/components/PrivacyPolicyLink.tsx b/clients/fides-js/src/components/PrivacyPolicyLink.tsx index d5184742b9..082cce83f7 100644 --- a/clients/fides-js/src/components/PrivacyPolicyLink.tsx +++ b/clients/fides-js/src/components/PrivacyPolicyLink.tsx @@ -6,7 +6,7 @@ const PrivacyPolicyLink = ({ i18n }: { i18n: I18n }) => { // both the label & URL before attempting to render if ( !messageExists(i18n, "exp.privacy_policy_link_label") || - !messageExists(i18n, "exp.privacy_policy_link_label") + !messageExists(i18n, "exp.privacy_policy_url") ) { return null; } diff --git a/clients/privacy-center/cypress/e2e/consent-i18n.cy.ts b/clients/privacy-center/cypress/e2e/consent-i18n.cy.ts index 90d1ca9aac..496508c356 100644 --- a/clients/privacy-center/cypress/e2e/consent-i18n.cy.ts +++ b/clients/privacy-center/cypress/e2e/consent-i18n.cy.ts @@ -434,7 +434,7 @@ describe("Consent i18n", () => { ); // Privacy policy link is optional; if provided, check that it is localized - if (t.privacy_policy_link_label) { + if (t.privacy_policy_link_label && t.privacy_policy_url) { cy.get("#fides-privacy-policy-link").contains( t.privacy_policy_link_label ); @@ -468,7 +468,7 @@ describe("Consent i18n", () => { cy.get(".fides-gpc-banner").contains(t.gpc_title); // Privacy policy link is optional; if provided, check that it is localized - if (t.privacy_policy_link_label) { + if (t.privacy_policy_link_label && t.privacy_policy_url) { cy.get("#fides-privacy-policy-link").contains( t.privacy_policy_link_label );