From f40bba1a79fdeac6a684a2fb415e0be9f409449a Mon Sep 17 00:00:00 2001 From: Jordan Willis <31868510+will0684@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:17:38 -0400 Subject: [PATCH] Misc fixes to CDCP landing page (#1006) * fix chevron icon reference * more small fixes to align with CDCP prototype * add column gaps to match text wrapping in figma * add adobe analytics * add cdcp landing page to robots.js * add missing newlines to robots.js * add missing useEffect import * fix robots.js unit test --- __tests__/api/robots.test.js | 2 +- components/organisms/PhaseBanner.js | 6 +++--- next.config.js | 2 +- pages/api/robots.js | 2 ++ pages/cdcp-apply.js | 15 ++++++++++++--- public/locales/en/common.json | 2 +- public/locales/fr/common.json | 2 +- styles/globals.css | 2 +- tailwind.config.js | 1 + 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/__tests__/api/robots.test.js b/__tests__/api/robots.test.js index 6f0fff3581..5d06f70105 100644 --- a/__tests__/api/robots.test.js +++ b/__tests__/api/robots.test.js @@ -22,7 +22,7 @@ describe("robots api", () => { }); await handler(req, res); expect(res._getData()).toBe( - "User-agent: *\nDisallow: /api\nDisallow: /projects/*\nDisallow: /notsupported.js\n" + "User-agent: *\nDisallow: /api\nDisallow: /projects/*\nDisallow: /notsupported.js\nDisallow: /cdcp-apply\nDisallow: /rsdc-demander\n" ); }); }); diff --git a/components/organisms/PhaseBanner.js b/components/organisms/PhaseBanner.js index 4bd1ea2a2d..457bda3ed0 100644 --- a/components/organisms/PhaseBanner.js +++ b/components/organisms/PhaseBanner.js @@ -33,7 +33,7 @@ export const PhaseBanner = ({ return ( <> -
{text}
diff --git a/next.config.js b/next.config.js index 3d0509f418..a85f81dd41 100644 --- a/next.config.js +++ b/next.config.js @@ -93,7 +93,7 @@ securityHeaders = [ }, { key: "Content-Security-Policy", - value: `default-src 'self' dts-stn.com *.dts-stn.com *.adobe.com https://assets.adobedtm.com *.omniture.com *.2o7.net; frame-ancestors 'self'; base-uri 'self'; form-action 'self'; connect-src 'self' *.adobe.com https://assets.adobedtm.com *.demdex.net *.omtrdc.net cm.everesttech.net; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com data:; img-src 'self' data: *.omtrdc.net *.demdex.net cm.everesttech.net https://assets.adobedtm.com https://www.canada.ca; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com data:; frame-src 'self' *.adobe.com https://assets.adobedtm.com *.demdex.net; script-src 'self' 'unsafe-inline' *.adobe.com *.adobedtm.com *.omniture.com *.2o7.net https://*.demdex.net https://cm.everesttech.net ${ + value: `default-src 'self' dts-stn.com *.dts-stn.com *.adobe.com https://assets.adobedtm.com *.omniture.com *.2o7.net; frame-ancestors 'self'; base-uri 'self'; form-action 'self'; connect-src 'self' *.adobe.com https://assets.adobedtm.com *.demdex.net *.omtrdc.net cm.everesttech.net; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com data:; img-src 'self' data: webpack: *.omtrdc.net *.demdex.net cm.everesttech.net https://assets.adobedtm.com https://www.canada.ca; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com data:; frame-src 'self' *.adobe.com https://assets.adobedtm.com *.demdex.net; script-src 'self' 'unsafe-inline' *.adobe.com *.adobedtm.com *.omniture.com *.2o7.net https://*.demdex.net https://cm.everesttech.net ${ process.env.CI === "true" ? "'unsafe-eval'" : process.env.NODE_ENV === "development" diff --git a/pages/api/robots.js b/pages/api/robots.js index 8166fae90e..f26f61c2ee 100644 --- a/pages/api/robots.js +++ b/pages/api/robots.js @@ -10,6 +10,8 @@ export default async function handler(req, res) { res.write("Disallow: /api\n"); res.write("Disallow: /projects/*\n"); res.write("Disallow: /notsupported.js\n"); + res.write("Disallow: /cdcp-apply\n"); + res.write("Disallow: /rsdc-demander\n"); } else { res.write("User-agent: *\n"); res.write("Disallow: /\n"); diff --git a/pages/cdcp-apply.js b/pages/cdcp-apply.js index 1f663c99d7..e8689c67c6 100644 --- a/pages/cdcp-apply.js +++ b/pages/cdcp-apply.js @@ -4,6 +4,7 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { Layout } from "../components/organisms/Layout"; import { ActionButton } from "../components/atoms/ActionButton"; import { createBreadcrumbs } from "../lib/utils/createBreadcrumbs"; +import { useEffect } from "react"; export default function CDCPLanding(props) { const { t } = useTranslation("common"); @@ -16,7 +17,7 @@ export default function CDCPLanding(props) { scPageNameFr: "https://www.canada.ca/fr/services/prestations.html", }, { - scTitleEn: "Dental Coverage", + scTitleEn: "Dental coverage", scTitleFr: "Couverture dentaire", scPageNameEn: "https://www.canada.ca/en/services/benefits/dental.html", scPageNameFr: @@ -32,6 +33,13 @@ export default function CDCPLanding(props) { }, ]; + useEffect(() => { + if (props.adobeAnalyticsUrl) { + window.adobeDataLayer = window.adobeDataLayer || []; + window.adobeDataLayer.push({ event: "pageLoad" }); + } + }, []); + return ({t("cdcp.secondaryHeading")} @@ -58,7 +66,7 @@ export default function CDCPLanding(props) { {t("cdcp.primaryHeading")}
{t("cdcp.toCompleteApplication")}