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 ( <> -
+
{phase} @@ -59,7 +59,7 @@ export const PhaseBanner = ({ "" )}
-
+

{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")}
-
+

{t("cdcp.secondaryHeading")} @@ -58,7 +66,7 @@ export default function CDCPLanding(props) { {t("cdcp.primaryHeading")}

-
+

{t("cdcp.toCompleteApplication")}

  • {t("cdcp.listItems.item1")}
  • @@ -92,6 +100,7 @@ export const getStaticProps = async ({ locale }) => { return { props: { locale: locale, + adobeAnalyticsUrl: process.env.ADOBE_ANALYTICS_URL ?? null, ...(await serverSideTranslations(locale, ["common"])), }, }; diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 63b1f755b2..d0b0086ed3 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -1,5 +1,5 @@ { - "phaseBannerTag": "PROTOTYPE", + "phaseBannerTag": "Alpha", "phaseBannerText": "This is a prototype for testing purposes only. Information entered will not be saved.", "siteTitle": "Service Canada Labs", "bannerText": "Give feedback to make new government services simple and easy to use", diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 6137206628..164a89ef55 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -1,5 +1,5 @@ { - "phaseBannerTag": "PROTOTYPE", + "phaseBannerTag": "Alpha", "phaseBannerText": "Il s'agit d'un prototype destiné uniquement à des fins de test. Les informations saisies ne seront pas enregistrées.", "siteTitle": "Laboratoires de Service Canada", "bannerText": "Donnez vos commentaires pour de nouveaux services gouvernementaux simples et faciles à utiliser", diff --git a/styles/globals.css b/styles/globals.css index 087c79c568..c7ee96f6e5 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -142,7 +142,7 @@ html { } .icon-chevron-right:before { - content: url(../public/chevron-right.svg); + content: url("/chevron-right.svg"); } .skip-main { diff --git a/tailwind.config.js b/tailwind.config.js index c379839014..4d4c7d1998 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -132,6 +132,7 @@ module.exports = { blue70a: "#38414D", blue70b: "#284162", blue70c: "#33465C", + blue70d: "#334155", blue65: "#16446C", blue65a: "#083C6C", blue60a: "#2E5274",