From 88d50748eb25faa2052443ecc8f7969e39cd30bf Mon Sep 17 00:00:00 2001
From: Vim <86254807+vim-usds@users.noreply.github.com>
Date: Fri, 4 Mar 2022 16:16:07 -0500
Subject: [PATCH] Public Engagement Page (#1372)
* Add public engagement page
- modifies sitemap config
- creates PublicEvent component
- adds SVGs for dates
- all copy is in intl
* Add Public Engagement button to each page
- create new PublicEng component
- add to each page
- update snapshots
- modify CEJST and Meth page to give button more space
* Make mobile compliant and fix DOM validation error
- transform each
's descendent into a
- fix a mobile rendering issue with library
- format registration links so they render on mobile
- update snapshots
* Add spacing to descriptions and fix links
* Add Gherkin tests for testing links
- all zoom links should be functional
- ensure all legacy tests, test the new page
- add data-cy tag for cypress
- update snapshots
* Refactor to pass accessibility on all pages
- update snapshots
* Correct registration links
* Make registration links into buttons
* Make new tag bold
* Update copy based on feedback from Corey
---
.../LegacyTests/accessibility.test.js | 1 +
.../integration/LegacyTests/allLinks.spec.js | 1 +
.../integration/LegacyTests/constants.js | 1 +
.../integration/PublicEngLinks.feature | 32 +++
.../support/step_definitions/commonSteps.js | 4 +
client/gatsby-config.js | 1 +
.../DownloadPacket/downloadPacket.module.scss | 2 +
.../PublicEngageButton.module.scss | 22 ++
.../PublicEngageButton.module.scss.d.ts | 15 ++
.../PublicEngageButton.test.tsx | 16 ++
.../PublicEngageButton/PublicEngageButton.tsx | 28 +++
.../PublicEngageButton.test.tsx.snap | 27 +++
.../components/PublicEngageButton/index.tsx | 3 +
.../PublicEvent/PublicEvent.module.scss | 5 +
.../PublicEvent/PublicEvent.module.scss.d.ts | 12 +
.../PublicEvent/PublicEvent.test.tsx | 18 ++
.../components/PublicEvent/PublicEvent.tsx | 77 +++++++
.../__snapshots__/PublicEvent.test.tsx.snap | 71 ++++++
client/src/components/PublicEvent/index.tsx | 3 +
client/src/data/copy/publicEngage.tsx | 206 ++++++++++++++++++
client/src/images/eventDates/apr15.svg | 1 +
client/src/images/eventDates/mar10.svg | 1 +
client/src/images/eventDates/mar15.svg | 1 +
client/src/images/eventDates/mar16.svg | 1 +
client/src/images/eventDates/mar22.svg | 1 +
client/src/images/eventDates/mar9.svg | 1 +
.../pages/__snapshots__/contact.test.tsx.snap | 31 ++-
.../pages/__snapshots__/index.test.tsx.snap | 33 ++-
.../__snapshots__/methodology.test.tsx.snap | 33 ++-
client/src/pages/cejst.tsx | 8 +-
client/src/pages/contact.tsx | 6 +-
client/src/pages/index.tsx | 7 +-
client/src/pages/methodology.tsx | 11 +-
client/src/pages/public-engagement.tsx | 59 +++++
client/src/styles/global.scss | 30 ++-
35 files changed, 742 insertions(+), 27 deletions(-)
create mode 100644 client/cypress/integration/PublicEngLinks.feature
create mode 100644 client/src/components/PublicEngageButton/PublicEngageButton.module.scss
create mode 100644 client/src/components/PublicEngageButton/PublicEngageButton.module.scss.d.ts
create mode 100644 client/src/components/PublicEngageButton/PublicEngageButton.test.tsx
create mode 100644 client/src/components/PublicEngageButton/PublicEngageButton.tsx
create mode 100644 client/src/components/PublicEngageButton/__snapshots__/PublicEngageButton.test.tsx.snap
create mode 100644 client/src/components/PublicEngageButton/index.tsx
create mode 100644 client/src/components/PublicEvent/PublicEvent.module.scss
create mode 100644 client/src/components/PublicEvent/PublicEvent.module.scss.d.ts
create mode 100644 client/src/components/PublicEvent/PublicEvent.test.tsx
create mode 100644 client/src/components/PublicEvent/PublicEvent.tsx
create mode 100644 client/src/components/PublicEvent/__snapshots__/PublicEvent.test.tsx.snap
create mode 100644 client/src/components/PublicEvent/index.tsx
create mode 100644 client/src/data/copy/publicEngage.tsx
create mode 100644 client/src/images/eventDates/apr15.svg
create mode 100644 client/src/images/eventDates/mar10.svg
create mode 100644 client/src/images/eventDates/mar15.svg
create mode 100644 client/src/images/eventDates/mar16.svg
create mode 100644 client/src/images/eventDates/mar22.svg
create mode 100644 client/src/images/eventDates/mar9.svg
create mode 100644 client/src/pages/public-engagement.tsx
diff --git a/client/cypress/integration/LegacyTests/accessibility.test.js b/client/cypress/integration/LegacyTests/accessibility.test.js
index 7b7cc628..ad37379d 100644
--- a/client/cypress/integration/LegacyTests/accessibility.test.js
+++ b/client/cypress/integration/LegacyTests/accessibility.test.js
@@ -18,6 +18,7 @@ const endpoints = [
'en/methodology',
'en/contact',
'en/404',
+ 'en/public-engagement',
];
// The violation callback will post the violations into the terminal
diff --git a/client/cypress/integration/LegacyTests/allLinks.spec.js b/client/cypress/integration/LegacyTests/allLinks.spec.js
index 1e398d3c..f0868b2f 100644
--- a/client/cypress/integration/LegacyTests/allLinks.spec.js
+++ b/client/cypress/integration/LegacyTests/allLinks.spec.js
@@ -6,6 +6,7 @@ describe('Do all the English pages have all links with a defined href attribute?
'cejst',
'methodology',
'contact',
+ 'public-engagement',
];
pages.forEach((page) => {
diff --git a/client/cypress/integration/LegacyTests/constants.js b/client/cypress/integration/LegacyTests/constants.js
index 3ae562fb..ee5d77c4 100644
--- a/client/cypress/integration/LegacyTests/constants.js
+++ b/client/cypress/integration/LegacyTests/constants.js
@@ -3,4 +3,5 @@ export const ENDPOINTS = {
EXPLORE_THE_TOOL: '/en/cejst',
METHODOLOGY: '/en/methodology',
CONTACT: 'en/contact',
+ PUBLIC: 'en/public-engagement',
};
diff --git a/client/cypress/integration/PublicEngLinks.feature b/client/cypress/integration/PublicEngLinks.feature
new file mode 100644
index 00000000..0345a5e5
--- /dev/null
+++ b/client/cypress/integration/PublicEngLinks.feature
@@ -0,0 +1,32 @@
+Feature: All links on Public Eng page are functional
+
+ Scenario: Anyone should be able to register on Mar 9th
+ Given I am on the "Public" page
+ When I look for the "Mar 9 Reg Link" CTA
+ And I click on the "Mar 9 Reg Link" event
+ Then the link should respond successfully
+
+ Scenario: Anyone should be able to register on Mar 10th
+ Given I am on the "Public" page
+ When I look for the "Mar 10 Reg Link" CTA
+ And I click on the "Mar 10 Reg Link" event
+ Then the link should respond successfully
+
+ Scenario: Anyone should be able to register on Mar 16th
+ Given I am on the "Public" page
+ When I look for the "Mar 16 Reg Link" CTA
+ And I click on the "Mar 16 Reg Link" event
+ Then the link should respond successfully
+
+ Scenario: Anyone should be able to register on Mar 22th
+ Given I am on the "Public" page
+ When I look for the "Mar 22 Reg Link" CTA
+ And I click on the "Mar 22 Reg Link" event
+ Then the link should respond successfully
+
+ Scenario: Anyone should be able to register on Apr 15th
+ Given I am on the "Public" page
+ When I look for the "Apr 15 Reg Link" CTA
+ And I click on the "Apr 15 Reg Link" event
+ Then the link should respond successfully
+
diff --git a/client/cypress/support/step_definitions/commonSteps.js b/client/cypress/support/step_definitions/commonSteps.js
index 191d9285..8bd0be33 100644
--- a/client/cypress/support/step_definitions/commonSteps.js
+++ b/client/cypress/support/step_definitions/commonSteps.js
@@ -62,3 +62,7 @@ And(`I click on the {string} {string} link`, (ctaString, type) => {
And(`I click on the {string} footer link`, (string) => {
cy.get(`[data-cy="${hyphenizeString(string)}"]`).as('externalLink');
});
+
+And(`I click on the {string} event`, (string) => {
+ cy.get(`[data-cy="${hyphenizeString(string)}-block"]`).as('externalLink');
+});
diff --git a/client/gatsby-config.js b/client/gatsby-config.js
index 0d6499e6..d852e981 100644
--- a/client/gatsby-config.js
+++ b/client/gatsby-config.js
@@ -87,6 +87,7 @@ module.exports = {
'/contact',
'/methodology',
'/404',
+ 'public-engagement',
],
},
},
diff --git a/client/src/components/DownloadPacket/downloadPacket.module.scss b/client/src/components/DownloadPacket/downloadPacket.module.scss
index b8b1fa30..1b9b00d2 100644
--- a/client/src/components/DownloadPacket/downloadPacket.module.scss
+++ b/client/src/components/DownloadPacket/downloadPacket.module.scss
@@ -4,10 +4,12 @@
color: whitesmoke;
margin: auto;
+ @include u-margin-top(2.5);
.downloadBox {
@include u-bg('blue-80v');
border-radius: 6px 6px;
+ // @include u-margin-top(3);
.downloadBoxTextBox {
padding: 25px 25px;
diff --git a/client/src/components/PublicEngageButton/PublicEngageButton.module.scss b/client/src/components/PublicEngageButton/PublicEngageButton.module.scss
new file mode 100644
index 00000000..434e5905
--- /dev/null
+++ b/client/src/components/PublicEngageButton/PublicEngageButton.module.scss
@@ -0,0 +1,22 @@
+@use '../../styles/design-system.scss' as *;
+
+.tagContainer {
+ @include u-margin-bottom(1);
+ @include u-margin-right(1);
+ .tag {
+ @include u-bg("yellow-20v");
+ color: black;
+ border-radius: 5px;
+ @include u-text('bold');
+ }
+}
+
+.container {
+ @include u-padding-top(2.5);
+
+ .link, .link:visited {
+ color:white;
+ text-decoration: none;
+ }
+
+}
\ No newline at end of file
diff --git a/client/src/components/PublicEngageButton/PublicEngageButton.module.scss.d.ts b/client/src/components/PublicEngageButton/PublicEngageButton.module.scss.d.ts
new file mode 100644
index 00000000..7e3a3c81
--- /dev/null
+++ b/client/src/components/PublicEngageButton/PublicEngageButton.module.scss.d.ts
@@ -0,0 +1,15 @@
+declare namespace PublicEngagementButton {
+ export interface IPublicEventScss {
+ tag: string;
+ tagContainer: string;
+ container: string;
+ link: string;
+ }
+ }
+
+declare const PublicEventScssModule: PublicEngagementButton.IPublicEventScss & {
+ /** WARNING: Only available when `css-loader` is used without `style-loader` or `mini-css-extract-plugin` */
+ locals: PublicEngagementButton.IPublicEventScss;
+ };
+
+ export = PublicEventScssModule;
diff --git a/client/src/components/PublicEngageButton/PublicEngageButton.test.tsx b/client/src/components/PublicEngageButton/PublicEngageButton.test.tsx
new file mode 100644
index 00000000..cb5ac86a
--- /dev/null
+++ b/client/src/components/PublicEngageButton/PublicEngageButton.test.tsx
@@ -0,0 +1,16 @@
+import * as React from 'react';
+import {render} from '@testing-library/react';
+import {LocalizedComponent} from '../../test/testHelpers';
+import PublicEngageButton from './PublicEngageButton';
+
+describe('rendering of the PublicEngageButton', () => {
+ const {asFragment} = render(
+
+
+ ,
+ );
+
+ it('checks if component renders', () => {
+ expect(asFragment()).toMatchSnapshot();
+ });
+});
diff --git a/client/src/components/PublicEngageButton/PublicEngageButton.tsx b/client/src/components/PublicEngageButton/PublicEngageButton.tsx
new file mode 100644
index 00000000..74ade4f0
--- /dev/null
+++ b/client/src/components/PublicEngageButton/PublicEngageButton.tsx
@@ -0,0 +1,28 @@
+import React from 'react';
+import {Link} from 'gatsby';
+import {useIntl} from 'gatsby-plugin-intl';
+import {Button, Tag} from '@trussworks/react-uswds';
+
+import * as styles from './PublicEngageButton.module.scss';
+import * as PUBLIC_ENG_COPY from '../../data/copy/publicEngage';
+
+const PublicEngageButton = () => {
+ const intl = useIntl();
+
+ return (
+
+
+ The White House Council on Environmental Quality (CEQ), in partnership with the U.S. Digital
+ Service, is hosting a series of 'Training Webinars' for users of the Climate and Economic
+ Justice Screening Tool. These webinars are an opportunity for members of the public to learn how to
+ use the current version of the tool. The presenters at these webinars will be available to
+ provide technical support and address issues related to accessing and using the tool.
+
+
+
+
+ Event info
+
+ : March 9th (4:00 - 5:00 PM EST)
+