Skip to content

Commit

Permalink
Correctly hide privacy policy link unless both label & URL are set (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
NevilleS authored Apr 16, 2024
1 parent a9d3ea9 commit 44aa3bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion clients/fides-js/src/components/PrivacyPolicyLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions clients/privacy-center/cypress/e2e/consent-i18n.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit 44aa3bd

Please sign in to comment.