Skip to content

Commit

Permalink
Misc fixes to CDCP landing page (#1006)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
will0684 authored Apr 30, 2024
1 parent abc96a1 commit f40bba1
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion __tests__/api/robots.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
});
});
6 changes: 3 additions & 3 deletions components/organisms/PhaseBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ export const PhaseBanner = ({

return (
<>
<div className="bg-circle-color">
<div className="bg-multi-blue-blue70d">
<div className="block lg:flex py-4 layout-container">
<div
className={`flex justify-between lg:block lg:w-max ${
feedbackActive ? "mt-2" : ""
}`}
>
<span
className="font-body text-xs text-white border block w-max px-4 py-1 my-auto leading-6 items-center"
className="font-body text-s text-white border-2 block w-max px-4 py-1 my-auto leading-6 items-center"
role="alert"
>
{phase}
Expand All @@ -59,7 +59,7 @@ export const PhaseBanner = ({
""
)}
</div>
<div className="lg:ml-4 xl:ml-8 xxl:ml-12">
<div>
<p className="mt-2 lg:mt-0 h-full font-body text-xs lg:text-sm text-white lg:ml-4 my-auto flex items-center">
{text}
</p>
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions pages/api/robots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
15 changes: 12 additions & 3 deletions pages/cdcp-apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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:
Expand All @@ -32,6 +33,13 @@ export default function CDCPLanding(props) {
},
];

useEffect(() => {
if (props.adobeAnalyticsUrl) {
window.adobeDataLayer = window.adobeDataLayer || [];
window.adobeDataLayer.push({ event: "pageLoad" });
}
}, []);

return (
<Layout
locale={props.locale}
Expand All @@ -49,7 +57,7 @@ export default function CDCPLanding(props) {
<title>{t("cdcp.secondaryHeading")}</title>
</Head>
<section className="layout-container">
<div className="grid grid-cols-12">
<div className="grid grid-cols-12 gap-x-8">
<div className="col-span-12">
<p className="mt-12 text-multi-neutrals-grey85">
{t("cdcp.secondaryHeading")}
Expand All @@ -58,7 +66,7 @@ export default function CDCPLanding(props) {
{t("cdcp.primaryHeading")}
</h1>
</div>
<div className="col-span-12 lg:col-span-8">
<div className="col-span-12 xl:col-span-8">
<p>{t("cdcp.toCompleteApplication")}</p>
<ul className="mt-5">
<li>{t("cdcp.listItems.item1")}</li>
Expand Down Expand Up @@ -92,6 +100,7 @@ export const getStaticProps = async ({ locale }) => {
return {
props: {
locale: locale,
adobeAnalyticsUrl: process.env.ADOBE_ANALYTICS_URL ?? null,
...(await serverSideTranslations(locale, ["common"])),
},
};
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/fr/common.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ html {
}

.icon-chevron-right:before {
content: url(../public/chevron-right.svg);
content: url("/chevron-right.svg");
}

.skip-main {
Expand Down
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ module.exports = {
blue70a: "#38414D",
blue70b: "#284162",
blue70c: "#33465C",
blue70d: "#334155",
blue65: "#16446C",
blue65a: "#083C6C",
blue60a: "#2E5274",
Expand Down

0 comments on commit f40bba1

Please sign in to comment.