From 5689a70a1989c5ae9ead7f8e3d7663328450b746 Mon Sep 17 00:00:00 2001 From: Hannah Roth Date: Tue, 14 Jan 2025 13:28:05 -0500 Subject: [PATCH] feat: add privacy choices link and icon to footer --- es-vue-base/src/lib-components/EsFooter.vue | 37 ++++++- .../src/lib-icons/icon-ccpa-opt-out.vue | 102 ++++++++++++++++++ es-vue-base/src/lib-icons/index.js | 1 + es-vue-base/src/lib-utils/footer-content.js | 1 + 4 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 es-vue-base/src/lib-icons/icon-ccpa-opt-out.vue diff --git a/es-vue-base/src/lib-components/EsFooter.vue b/es-vue-base/src/lib-components/EsFooter.vue index 2b26e3272..877f11383 100644 --- a/es-vue-base/src/lib-components/EsFooter.vue +++ b/es-vue-base/src/lib-components/EsFooter.vue @@ -85,16 +85,26 @@
-
+
+ class="col col-6 col-lg-auto"> + class="text-reset font-weight-normal font-size-75 font-size-md-50 font-weight-md-normal mt-25 mb-50 pr-lg-300"> {{ link.text }} +
+ + + {{ link.text }} + +
@@ -155,5 +165,26 @@ export default { return this.content.copyrightText.replace('{currentYear}', new Date().getFullYear()); }, }, + mounted() { + // TODO: update with GTM tag in prod once we've gone live + // See https://tagmanager.google.com/#/container/accounts/2920232696/containers/8806152/workspaces/126/tags + // for GTM script that triggers this event. + window.addEventListener('OneTrustLoadedCb', () => { + window.OneTrust.OnConsentChanged(() => { + // OneTrust modal should modify cookie values, a hard-refresh will + // trigger re-loading GTM with updated cookie values, which in turn + // will only fire tags aligned with new preferences + window.location.reload(); + return false; + }); + document.querySelectorAll('.toggle-info-display').forEach((elem) => { + // Function closure to ensure event only fires on one elem + elem.addEventListener('click', (e) => { + e.stopImmediatePropagation(); + window.OneTrust.ToggleInfoDisplay(); + }); + }); + }); + }, }; diff --git a/es-vue-base/src/lib-icons/icon-ccpa-opt-out.vue b/es-vue-base/src/lib-icons/icon-ccpa-opt-out.vue new file mode 100644 index 000000000..15f720fca --- /dev/null +++ b/es-vue-base/src/lib-icons/icon-ccpa-opt-out.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/es-vue-base/src/lib-icons/index.js b/es-vue-base/src/lib-icons/index.js index f82953120..fd66bd93b 100644 --- a/es-vue-base/src/lib-icons/index.js +++ b/es-vue-base/src/lib-icons/index.js @@ -85,6 +85,7 @@ export { default as IconUpload } from './icon-upload.vue'; export { default as IconVideoPlay } from './icon-video-play.vue'; export { default as IconBank } from './icon-bank.vue'; export { default as IconCreditCard } from './icon-credit-card.vue'; +export { default as IconCcpaOptOut } from './icon-ccpa-opt-out.vue'; // marketing icons export { default as IconBattery } from './icon-battery.vue'; diff --git a/es-vue-base/src/lib-utils/footer-content.js b/es-vue-base/src/lib-utils/footer-content.js index 9c35e42eb..65b68e5d8 100644 --- a/es-vue-base/src/lib-utils/footer-content.js +++ b/es-vue-base/src/lib-utils/footer-content.js @@ -74,6 +74,7 @@ export default ( { text: 'Privacy policy', url: `${ES_DOMAIN}/privacy-policy/` }, { text: 'Mobile terms of use', url: `${ES_DOMAIN}/mobile-terms-of-use/` }, { text: 'Non-discrimination policy', url: `${ES_DOMAIN}/nondiscrimination/` }, + { text: 'Your privacy choices' }, ], copyrightText: '© Copyright 2009-{currentYear} EnergySage, Inc. All rights reserved.', trademarkText: `ENERGYSAGE is a registered trademark and the EnergySage logo is a trademark of EnergySage, Inc.