Implement downloads page and May 25th timed copy changes (#1653)

* Add initial side nav

* Add Download page as a sub-page under Meth&Data

- udpate S3 file path in .envs
- remove the DownloadPacket component
- move download copy from methodology to download
- modify header to use two types of navs:
--  mobile (with sub-pages) and
-- desktop (without subpages)
- create a SubPageNav component
- add SubPagNav to Meth and Download page
- update snapshots
- add global CSS overide to remove minus sign on mobile nav link accordion as it's permanently open

* Remove the update tag above Public eng button

* Make the 3rd bullet on explore page update on 5/25

* Make the RFI box text change after 5/25/22

* Update site with RFI expired copy, remove Alerts

- add Spanish translations
- update snapshots

* Fix typo on XLS file path

* Refactor HowYouCanHelp to standard form

* Add custom download links with icons

- add new DownloadLink compnent
- add Spanish translations

* Update download file sizes

* Allow meth&data nav link to collapse on mobile
This commit is contained in:
Vim 2022-05-26 00:01:04 -04:00 committed by GitHub
commit 226017654a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 966 additions and 1720 deletions

View file

@ -1,9 +1,10 @@
/* eslint-disable max-len */
import React from 'react';
import {defineMessages} from 'react-intl';
import {FormattedDate, FormattedMessage, FormattedNumber} from 'gatsby-plugin-intl';
import {FormattedMessage} from 'gatsby-plugin-intl';
import {boldFn, linkFn, simpleLink} from './common';
import * as styles from '../../components/DownloadPacket/downloadPacket.module.scss';
export const VERSION_NUMBER = 0.1;
export const PAGE = defineMessages({
TILE: {
@ -40,7 +41,6 @@ export const PAGE = defineMessages({
});
export const FORMULA = {
INTRO: <FormattedMessage
id={'methodology.page.formula.intro'}
@ -72,143 +72,6 @@ export const FORMULA = {
/>,
};
// Download Package
export const DOWNLOAD_FILE_SIZE = 53;
export const DOWNLOAD_SHAPE_FILE_SIZE = 742;
export const DOWNLOAD_TSD_FILE_SIZE = 2.5;
export const DOWNLOAD_ZIP_LAST_UPDATED = new Date('5/4/2022').getTime();
export const DOWNLOAD_SHAPE_LAST_UPDATED = new Date('4/26/2022').getTime();
export const DOWNLOAD_TSD_LAST_UPDATED = new Date('4/19/2022').getTime();
export const VERSION_NUMBER = 0.1;
export const DOWNLOAD_ZIP_URL = [
process.env.GATSBY_CDN_TILES_BASE_URL,
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
process.env.GATSBY_SCORE_DOWNLOAD_FILE_PATH,
].join('/');
export const DOWNLOAD_SHAPEFILE_URL = [
process.env.GATSBY_CDN_TILES_BASE_URL,
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
process.env.GATSBY_SHAPE_FILE_PATH,
].join('/');
// TSD = Tech Support Document
export const DOWNLOAD_TSD_URL = [
process.env.GATSBY_CDN_TILES_BASE_URL,
process.env.GATSBY_DATA_PIPELINE_SCORE_PATH,
process.env.GATSBY_TSD_DOWNLOAD_FILE_PATH,
].join('/');
const newCalloutFontColorFn = (str: string) => <span className={styles.newCalloutFontColor}>{str}</span>;
export const DOWNLOAD_PACKAGE = {
TITLE: <FormattedMessage
id={'methodology.page.downloadPacket.header.text'}
defaultMessage={`<callout>NEW</callout> files available for download`}
description={'Navigate to the methodology page. This is the download packet header text'}
values={{
callout: newCalloutFontColorFn,
}}
/>,
DESCRIPTION1: <FormattedMessage
id={'methodology.page.downloadPacket.info.text1'}
defaultMessage={`Download the data sources used in the CEJST (.csv, .xlxs, <callout>.pdf</callout> that describes how to use the list, and a <callout>codebook</callout>, {downloadFileSize} unzipped), the shapefile, along with a <callout>codebook</callout> (.zip, {shapefileSize} unzipped) or the technical support document (.pdf, {tsdFileSize} unzipped).`}
description={'Navigate to the methodology page. This is the download packet info text'}
values={{
callout: newCalloutFontColorFn,
downloadFileSize: <FormattedNumber
value={DOWNLOAD_FILE_SIZE}
style="unit"
unit="megabyte"
unitDisplay="narrow"
/>,
shapefileSize: <FormattedNumber
value={DOWNLOAD_SHAPE_FILE_SIZE}
style="unit"
unit="megabyte"
unitDisplay="narrow"
/>,
tsdFileSize: <FormattedNumber
value={DOWNLOAD_TSD_FILE_SIZE}
style="unit"
unit="megabyte"
unitDisplay="narrow"
/>,
}}
/>,
ZIP_LAST_UPDATED: <FormattedMessage
id={'methodology.page.downloadPacket.info.zip.last.updated'}
defaultMessage={`Last updated: {downloadLastUpdated} `}
description={'Navigate to the methodology page. This is the download packet info last updated'}
values={{
downloadLastUpdated: <FormattedDate
value={DOWNLOAD_ZIP_LAST_UPDATED}
year="2-digit"
month="2-digit"
day="2-digit"
/>,
}}
/>,
SHAPE_LAST_UPDATED: <FormattedMessage
id={'methodology.page.downloadPacket.info.shape.last.updated'}
defaultMessage={`Last updated: {shapeLastUpdated} `}
description={'Navigate to the methodology page. This is the download packet info last updated'}
values={{
shapeLastUpdated: <FormattedDate
value={DOWNLOAD_SHAPE_LAST_UPDATED}
year="2-digit"
month="2-digit"
day="2-digit"
/>,
}}
/>,
TSD_LAST_UPDATED: <FormattedMessage
id={'methodology.page.downloadPacket.info.tsd.last.updated'}
defaultMessage={`Last updated: {tsdLastUpdated} `}
description={'Navigate to the methodology page. This is the download packet info last updated'}
values={{
tsdLastUpdated: <FormattedDate
value={DOWNLOAD_TSD_LAST_UPDATED}
year="2-digit"
month="2-digit"
day="2-digit"
/>,
}}
/>,
BUTTON_TEXT1: <FormattedMessage
id={'methodology.page.downloadPacket.button1.text'}
defaultMessage={'Download data sources'}
description={'Navigate to the methodology page. This is the download packet button text'}
/>,
BUTTON_TEXT2: <FormattedMessage
id={'methodology.page.downloadPacket.button2.text'}
defaultMessage={'Download shapefile'}
description={'Navigate to the methodology page. This is the download shapefiles text'}
/>,
BUTTON_TEXT3: <FormattedMessage
id={'methodology.page.downloadPacket.button3.text'}
defaultMessage={'Download technical support document'}
description={'Navigate to the methodology page. This is the download technical support document spreadsheet'}
/>,
NEW_TAG: <FormattedMessage
id={'methodology.page.downloadPacket.new.tag.text'}
defaultMessage={`<boldtag>NEW</boldtag>`}
description={'Navigate to the methodology page. This is the new tag text'}
values={{
boldtag: boldFn,
}}
/>,
UPDATED_TAG: <FormattedMessage
id={'methodology.page.downloadPacket.updated.tag.text'}
defaultMessage={`<boldtag>Updated</boldtag>`}
description={'Navigate to the methodology page. This is the update callout tag text that overlaps the button'}
values={{
boldtag: boldFn,
}}
/>,
};
export const CATEGORY = {
HEADING: <FormattedMessage
id={'methodology.page.indicator.categories.heading'}