From 174a0e1330f8ac63d3d8a62d82759c533cfe50bf Mon Sep 17 00:00:00 2001
From: Vim <86254807+vim-usds@users.noreply.github.com>
Date: Tue, 10 Aug 2021 09:45:45 -0700
Subject: [PATCH] Modifies ExploreTool page to match sprint 4 design (#481)
* initial commit of sprint 4 explore page
* adds styling on HowYouCanHelp module
* troubleshooting li element on deployed URL
removing local bullet styles
* removing unused styles
* recreating HowYouCanHelp
* explicit list el styles
* adds bullets back in
* fixes tooltip style and alert padding
* componentize MapLegend
* fix links
* inital intl and unit tests
* adds trusswork tooltip for comparison
* updates based on various feedback and disucssions:
- removes react-tooltip
- placeholder trussworks tooltip
- removes download packet component
- intl on HowYouCanHelp
- updates MapLegend tests
- add initial cy test on ExploreTool page
* removes bold on alert
* PR feedback:
- removes location from J40Alert
- localizes `COLOR KEY`
* adds intl to constants file
* modifies download zip URL to new S3 location
* removes location depedencies on Alerts
* add localization for HowYouCanHelp
---
client/cypress/e2e/downloadPacket.spec.js | 30 +-
client/cypress/e2e/exploreToolPage.spec.js | 13 +
client/package.json | 2 +-
.../AlertWrapper/alertWrapper.module.scss | 11 +
.../alertWrapper.module.scss.d.ts | 14 +
client/src/components/AlertWrapper/index.tsx | 41 +++
client/src/components/DatasetCard/index.tsx | 8 +-
.../DatasetContainer/dsContainer.module.scss | 4 +-
.../src/components/DatasetContainer/index.tsx | 2 +-
.../src/components/HowYouCanHelp.module.scss | 3 -
client/src/components/HowYouCanHelp.tsx | 19 --
.../HowYouCanHelp/howYouCanHelp.module.scss | 24 ++
.../howYouCanHelp.module.scss.d.ts} | 6 +
client/src/components/HowYouCanHelp/index.tsx | 95 +++++++
.../__snapshots__/howYouCanHelp.test.tsx.snap | 46 ++++
.../tests/howYouCanHelp.test.tsx | 16 ++
client/src/components/J40Alert/index.tsx | 10 +-
.../components/J40Alert/j40Alert.module.scss | 14 +-
.../J40Alert/j40Alert.module.scss.d.ts | 1 +
.../__snapshots__/j40Alert.test.tsx.snap | 2 +-
.../J40Alert/tests/j40Alert.test.tsx | 14 +-
client/src/components/J40Header.tsx | 32 +--
client/src/components/MapLegend/index.tsx | 117 ++++++++
.../MapLegend/mapLegend.module.scss | 96 +++++++
.../mapLegend.module.scss.d.ts | 6 +-
.../MapLegend/tests/mapLegend.test.tsx | 25 ++
client/src/components/MapWrapper/index.tsx | 44 +++
.../MapWrapper/mapWrapper.module.scss | 4 +
.../MapWrapper/mapWrapper.module.scss.d.ts | 13 +
client/src/components/downloadPacket.tsx | 7 +-
client/src/components/layout.tsx | 2 +-
client/src/components/mapLegend.module.scss | 41 ---
client/src/components/mapLegend.tsx | 26 --
client/src/components/mapWrapper.tsx | 20 --
client/src/components/utils.scss | 2 +
client/src/data/constants.tsx | 22 ++
client/src/intl/en.json | 68 ++++-
client/src/pages/cejst.module.scss | 17 +-
client/src/pages/cejst.module.scss.d.ts | 5 +-
client/src/pages/cejst.tsx | 61 ++---
client/src/pages/contact.tsx | 82 +++---
client/src/pages/index.tsx | 256 ++++++++++--------
client/src/pages/methodology.tsx | 67 +++--
client/src/styles/global.scss | 12 +-
44 files changed, 974 insertions(+), 426 deletions(-)
create mode 100644 client/cypress/e2e/exploreToolPage.spec.js
create mode 100644 client/src/components/AlertWrapper/alertWrapper.module.scss
create mode 100644 client/src/components/AlertWrapper/alertWrapper.module.scss.d.ts
create mode 100644 client/src/components/AlertWrapper/index.tsx
delete mode 100644 client/src/components/HowYouCanHelp.module.scss
delete mode 100644 client/src/components/HowYouCanHelp.tsx
create mode 100644 client/src/components/HowYouCanHelp/howYouCanHelp.module.scss
rename client/src/components/{HowYouCanHelp.module.scss.d.ts => HowYouCanHelp/howYouCanHelp.module.scss.d.ts} (71%)
create mode 100644 client/src/components/HowYouCanHelp/index.tsx
create mode 100644 client/src/components/HowYouCanHelp/tests/__snapshots__/howYouCanHelp.test.tsx.snap
create mode 100644 client/src/components/HowYouCanHelp/tests/howYouCanHelp.test.tsx
create mode 100644 client/src/components/MapLegend/index.tsx
create mode 100644 client/src/components/MapLegend/mapLegend.module.scss
rename client/src/components/{ => MapLegend}/mapLegend.module.scss.d.ts (81%)
create mode 100644 client/src/components/MapLegend/tests/mapLegend.test.tsx
create mode 100644 client/src/components/MapWrapper/index.tsx
create mode 100644 client/src/components/MapWrapper/mapWrapper.module.scss
create mode 100644 client/src/components/MapWrapper/mapWrapper.module.scss.d.ts
delete mode 100644 client/src/components/mapLegend.module.scss
delete mode 100644 client/src/components/mapLegend.tsx
delete mode 100644 client/src/components/mapWrapper.tsx
diff --git a/client/cypress/e2e/downloadPacket.spec.js b/client/cypress/e2e/downloadPacket.spec.js
index e00188c4..2873ad67 100644
--- a/client/cypress/e2e/downloadPacket.spec.js
+++ b/client/cypress/e2e/downloadPacket.spec.js
@@ -2,20 +2,22 @@
describe('Census Block Group download', () => {
it('validate file download', () => {
- const filename = `usa.zip`;
+ // const filename = `usa.zip`;
cy.visit('localhost:8000/en/cejst');
- cy.get('#download-link').invoke('attr', 'target', '_blank');
- cy.intercept(`https://justice40-data.s3.amazonaws.com/Score/${filename}`,
- {
- body: 'success',
- headers: {
- 'Content-Type': 'text/html; charset=utf-8',
- 'Content-Disposition': 'attachment',
- },
- },
- ).as('downloadRequest');
- cy.get('button[class*="downloadPacket"]').click();
- cy.wait('@downloadRequest');
- cy.readFile(`cypress/downloads/${filename}`).should('exist');
+
+ // Todo VS: Download packet component is being moved. Will be re-enabled with
+ // cy.get('#download-link').invoke('attr', 'target', '_blank');
+ // cy.intercept(`https://justice40-data.s3.amazonaws.com/Score/${filename}`,
+ // {
+ // body: 'success',
+ // headers: {
+ // 'Content-Type': 'text/html; charset=utf-8',
+ // 'Content-Disposition': 'attachment',
+ // },
+ // },
+ // ).as('downloadRequest');
+ // cy.get('button[class*="downloadPacket"]').click();
+ // cy.wait('@downloadRequest');
+ // cy.readFile(`cypress/downloads/${filename}`).should('exist');
});
});
diff --git a/client/cypress/e2e/exploreToolPage.spec.js b/client/cypress/e2e/exploreToolPage.spec.js
new file mode 100644
index 00000000..96921d05
--- /dev/null
+++ b/client/cypress/e2e/exploreToolPage.spec.js
@@ -0,0 +1,13 @@
+// /
{intl.formatMessage(messages.subTitle)}
{intl.formatMessage(messages.priorityText)}
+//{intl.formatMessage(messages.thresholdText)}
+//