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

feat: add preference center link to footer #1566

Merged
merged 10 commits into from
Jan 23, 2025
35 changes: 32 additions & 3 deletions es-ds-components/components/es-footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ export default {
return this.content.copyrightText.replace('{currentYear}', new Date().getFullYear());
},
},
mounted() {
// https://energysage.atlassian.net/wiki/spaces/FG/pages/1427865649/One-trust+Consent+Initialization+and+GTM
window.addEventListener('OneTrustLoadedCb', () => {
(window as any).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 as any).OneTrust.ToggleInfoDisplay();
});
});
});
},
};
</script>

Expand Down Expand Up @@ -120,16 +139,26 @@ export default {
<!-- Trademark Info -->
<!-- Legal -->
<hr class="border-top border-blue-500 m-0" />
<div class="row justify-content-center pt-100">
<div class="row pt-100">
<div
v-for="link in content.legalLinks"
:key="link.text"
class="col col-6 col-lg-auto font-size-75 font-weight-semibold font-size-md-50 font-weight-md-normal mt-25 mb-50 px-lg-300">
class="col col-6 col-lg-auto mt-25 mb-50 pr-lg-300">
<es-nav-bar-link
v-if="link.url"
:href="link.url"
class="text-reset font-weight-normal">
class="text-reset font-weight-normal font-size-75 font-size-md-50 font-weight-md-normal">
{{ link.text }}
</es-nav-bar-link>
<div v-else>
<icon-ccpa-opt-out />
<es-button
inline
class="toggle-info-display text-reset font-weight-normal font-size-75 font-size-md-50 font-weight-md-normal ml-1"
variant="link">
{{ link.text }}
</es-button>
</div>
</div>
</div>
<!-- Legal -->
Expand Down
61 changes: 61 additions & 0 deletions es-ds-components/components/icon/ccpa-opt-out.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<script lang="ts">
export default {
name: 'IconCcpaOptOut',
props: {
/**
* Width
*/
width: {
type: String,
default: '30px',
required: false,
},
/**
* Height
*/
height: {
type: String,
default: '14px',
required: false,
},
},
};
</script>

<template>
<svg
xmlns="http://www.w3.org/2000/svg"
xml:space="preserve"
id="Layer_1"

Check warning on line 29 in es-ds-components/components/icon/ccpa-opt-out.vue

View workflow job for this annotation

GitHub Actions / ci

Attribute "id" should go before "xml:space"
:style="{
height: height,
width: width,
}"
aria-label="California Consumer Privacy Act (CCPA) Opt-Out Icon"
role="img"
x="0"
y="0"
version="1.1"
viewBox="0 0 30 14">
<g
id="Final-Copy-2"
style="display: inline">
<path
class="st0"
d="M7.4,12.8h6.8l3.1-11.6H7.4C4.2,1.2,1.6,3.8,1.6,7S4.2,12.8,7.4,12.8z"
style="fill: #fff" />
<path
id="path2"
d="M22.6 0H7.4c-3.9 0-7 3.1-7 7s3.1 7 7 7h15.2c3.9 0 7-3.1 7-7s-3.2-7-7-7zm-21 7c0-3.2 2.6-5.8 5.8-5.8h9.9l-3.1 11.6H7.4c-3.2 0-5.8-2.6-5.8-5.8Z"
style="clip-rule: evenodd; fill: #06f; fill-rule: evenodd" />
<path
id="x"
d="M24.6 4c.2.2.2.6 0 .8L22.5 7l2.2 2.2c.2.2.2.6 0 .8-.2.2-.6.2-.8 0l-2.2-2.2-2.2 2.2c-.2.2-.6.2-.8 0-.2-.2-.2-.6 0-.8L20.8 7l-2.2-2.2c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0l2.2 2.2L23.8 4c.2-.2.6-.2.8 0Z"
style="fill: #fff" />
<path
id="y"
d="M12.7 4.1c.2.2.3.6.1.8L8.6 9.8c-.1.1-.2.2-.3.2-.2.1-.5.1-.7-.1L5.4 7.7c-.2-.2-.2-.6 0-.8.2-.2.6-.2.8 0L8 8.6l3.8-4.5c.2-.2.6-.2.9 0z"
style="fill: #06f" />
</g>
</svg>
</template>
1 change: 1 addition & 0 deletions es-ds-components/utils/get-es-footer-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,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.
Expand Down
Loading