Fixes #1571 (TSD download button) (#1578)

* Fixes #1571

* Split out last updated for all downloads
This commit is contained in:
TomNUSDS 2022-04-19 12:30:42 -07:00 committed by GitHub
parent 5c0e6e8096
commit c07d790b77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 221 additions and 22 deletions

View file

@ -11,6 +11,7 @@ GATSBY_DATA_PIPELINE_SCORE_PATH=data-pipeline/data/score
GATSBY_SCORE_DOWNLOAD_FILE_PATH=downloadable/Screening_Tool_Data.zip GATSBY_SCORE_DOWNLOAD_FILE_PATH=downloadable/Screening_Tool_Data.zip
GATSBY_SHAPE_FILE_PATH=shapefile/usa.zip GATSBY_SHAPE_FILE_PATH=shapefile/usa.zip
GATSBY_TSD_DOWNLOAD_FILE_PATH=downloadable/cejst_technical_support_document.pdf
GATSBY_MAP_TILES_PATH=tiles GATSBY_MAP_TILES_PATH=tiles

View file

@ -8,4 +8,5 @@ GATSBY_CDN_TILES_BASE_URL=https://static-data-screeningtool.geoplatform.gov
GATSBY_DATA_PIPELINE_SCORE_PATH=data-pipeline/data/score GATSBY_DATA_PIPELINE_SCORE_PATH=data-pipeline/data/score
GATSBY_SCORE_DOWNLOAD_FILE_PATH=downloadable/Screening_Tool_Data.zip GATSBY_SCORE_DOWNLOAD_FILE_PATH=downloadable/Screening_Tool_Data.zip
GATSBY_SHAPE_FILE_PATH=shapefile/usa.zip GATSBY_SHAPE_FILE_PATH=shapefile/usa.zip
GATSBY_TSD_DOWNLOAD_FILE_PATH=downloadable/cejst_technical_support_document.pdf
GATSBY_MAP_TILES_PATH=tiles GATSBY_MAP_TILES_PATH=tiles

View file

@ -2575,20 +2575,26 @@
"value": "Download shapefile" "value": "Download shapefile"
} }
], ],
"methodology.page.downloadPacket.button3.text": [
{
"type": 0,
"value": "Download technical support document"
}
],
"methodology.page.downloadPacket.header.text": [ "methodology.page.downloadPacket.header.text": [
{ {
"type": 0, "type": 0,
"value": "Files available for download" "value": "Files available for download"
} }
], ],
"methodology.page.downloadPacket.info.last.updated": [ "methodology.page.downloadPacket.info.shape.last.updated": [
{ {
"type": 0, "type": 0,
"value": "Last updated: " "value": "Last updated: "
}, },
{ {
"type": 1, "type": 1,
"value": "downloadLastUpdated" "value": "shapeLastUpdated"
} }
], ],
"methodology.page.downloadPacket.info.text1": [ "methodology.page.downloadPacket.info.text1": [
@ -2602,7 +2608,7 @@
}, },
{ {
"type": 0, "type": 0,
"value": " unzipped) or the shapefile, along with a codebook (.zip, " "value": " unzipped), the shapefile, along with a codebook (.zip, "
}, },
{ {
"type": 1, "type": 1,
@ -2610,7 +2616,35 @@
}, },
{ {
"type": 0, "type": 0,
"value": " unzipped)." "value": " unzipped) or the technical support document (.pdf, "
},
{
"type": 1,
"value": "tsdFileSize"
},
{
"type": 0,
"value": ")."
}
],
"methodology.page.downloadPacket.info.tsd.last.updated": [
{
"type": 0,
"value": "Last updated: "
},
{
"type": 1,
"value": "tsdLastUpdated"
}
],
"methodology.page.downloadPacket.info.zip.last.updated": [
{
"type": 0,
"value": "Last updated: "
},
{
"type": 1,
"value": "downloadLastUpdated"
} }
], ],
"methodology.page.downloadPacket.new.tag.text": [ "methodology.page.downloadPacket.new.tag.text": [

View file

@ -26,7 +26,9 @@ const DownloadPacket = () => {
{/* Download box button 1 */} {/* Download box button 1 */}
<div className={styles.dataSourceButtonContainer}> <div className={styles.dataSourceButtonContainer}>
<a data-cy={'download-link'} download href={METHODOLOGY_COPY.DOWNLOAD_ZIP_URL}> <a data-cy={'download-link'}
download
href={METHODOLOGY_COPY.DOWNLOAD_ZIP_URL}>
<Button className={styles.downloadBoxButton} type="button"> <Button className={styles.downloadBoxButton} type="button">
<div> <div>
<img src={downloadIcon} alt={'download icon for download package'}/> <img src={downloadIcon} alt={'download icon for download package'}/>
@ -38,7 +40,7 @@ const DownloadPacket = () => {
</a> </a>
</div> </div>
<div className={styles.lastUpdated}> <div className={styles.lastUpdated}>
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.LAST_UPDATED} {METHODOLOGY_COPY.DOWNLOAD_PACKAGE.ZIP_LAST_UPDATED}
</div> </div>
@ -47,7 +49,9 @@ const DownloadPacket = () => {
<div className={styles.newTagContainer}> <div className={styles.newTagContainer}>
<Tag className={styles.newtag}>{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.NEW_TAG}</Tag> <Tag className={styles.newtag}>{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.NEW_TAG}</Tag>
</div> </div>
<a data-cy={'shapefile-link'} download href={METHODOLOGY_COPY.DOWNLOAD_SHAPEFILE_URL}> <a data-cy={'shapefile-link'}
download
href={METHODOLOGY_COPY.DOWNLOAD_SHAPEFILE_URL}>
<Button className={styles.downloadBoxButton} type="button"> <Button className={styles.downloadBoxButton} type="button">
<div> <div>
<img src={downloadIcon} alt={'download icon for download package'}/> <img src={downloadIcon} alt={'download icon for download package'}/>
@ -59,9 +63,33 @@ const DownloadPacket = () => {
</a> </a>
</div> </div>
<div className={styles.lastUpdated}> <div className={styles.lastUpdated}>
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.LAST_UPDATED} {METHODOLOGY_COPY.DOWNLOAD_PACKAGE.SHAPE_LAST_UPDATED}
</div> </div>
{/* Download box button 3 */}
<div className={styles.shapefileButtonContainer}>
<div className={styles.newTagContainer}>
<Tag className={styles.newtag}>{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.NEW_TAG}</Tag>
</div>
{/* target and rel required since PDFs open in browser and don't download */}
<a data-cy={'shapefile-link'}
download
target={'_blank'}
rel={'noreferrer'}
href={METHODOLOGY_COPY.DOWNLOAD_TSD_URL}>
<Button className={styles.downloadBoxButton} type="button">
<div>
<img src={downloadIcon} alt={'download icon for download package'}/>
</div>
<div className={styles.shapeFileButtonText}>
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.BUTTON_TEXT3}
</div>
</Button>
</a>
</div>
<div className={styles.lastUpdated}>
{METHODOLOGY_COPY.DOWNLOAD_PACKAGE.TSD_LAST_UPDATED}
</div>
</div> </div>
</div> </div>

View file

@ -13,7 +13,7 @@ exports[`download packet component defined checks if component renders 1`] = `
Files available for download Files available for download
</div> </div>
<div> <div>
Download the data sources used in the CEJST (.csv and .xlsx, 52MB unzipped) or the shapefile, along with a codebook (.zip, 742MB unzipped). Download the data sources used in the CEJST (.csv and .xlsx, 52MB unzipped), the shapefile, along with a codebook (.zip, 742MB unzipped) or the technical support document (.pdf, 913kB).
</div> </div>
<div> <div>
<a <a
@ -77,6 +77,44 @@ exports[`download packet component defined checks if component renders 1`] = `
<div> <div>
Last updated: 04/06/22 Last updated: 04/06/22
</div> </div>
<div>
<div>
<span
class="usa-tag"
data-testid="tag"
>
<strong>
NEW
</strong>
</span>
</div>
<a
data-cy="shapefile-link"
download=""
href="//"
rel="noreferrer"
target="_blank"
>
<button
class="usa-button"
data-testid="button"
type="button"
>
<div>
<img
alt="download icon for download package"
src="test-file-stub"
/>
</div>
<div>
Download technical support document
</div>
</button>
</a>
</div>
<div>
Last updated: 04/19/22
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -779,7 +779,7 @@ export const DOWNLOAD_DRAFT = {
unitDisplay="narrow" unitDisplay="narrow"
/>, />,
dateUpdated: <FormattedDate dateUpdated: <FormattedDate
value={METHODOLOGY_COPY.DOWNLOAD_LAST_UPDATED} value={METHODOLOGY_COPY.DOWNLOAD_ZIP_LAST_UPDATED}
year="2-digit" year="2-digit"
month="2-digit" month="2-digit"
day="2-digit" day="2-digit"

View file

@ -74,7 +74,10 @@ export const FORMULA = {
// Download Package // Download Package
export const DOWNLOAD_FILE_SIZE = 52; export const DOWNLOAD_FILE_SIZE = 52;
export const DOWNLOAD_SHAPE_FILE_SIZE = 742; export const DOWNLOAD_SHAPE_FILE_SIZE = 742;
export const DOWNLOAD_LAST_UPDATED = 1649287951000; export const DOWNLOAD_TSD_FILE_SIZE = 913; // in KB
export const DOWNLOAD_ZIP_LAST_UPDATED = new Date('4/6/2022').getTime();
export const DOWNLOAD_SHAPE_LAST_UPDATED = new Date('4/6/2022').getTime();
export const DOWNLOAD_TSD_LAST_UPDATED = new Date('4/19/2022').getTime();
export const VERSION_NUMBER = 0.1; export const VERSION_NUMBER = 0.1;
export const DOWNLOAD_ZIP_URL = [ export const DOWNLOAD_ZIP_URL = [
@ -89,6 +92,13 @@ export const DOWNLOAD_SHAPEFILE_URL = [
process.env.GATSBY_SHAPE_FILE_PATH, process.env.GATSBY_SHAPE_FILE_PATH,
].join('/'); ].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('/');
export const DOWNLOAD_PACKAGE = { export const DOWNLOAD_PACKAGE = {
TITLE: <FormattedMessage TITLE: <FormattedMessage
id={'methodology.page.downloadPacket.header.text'} id={'methodology.page.downloadPacket.header.text'}
@ -97,7 +107,7 @@ export const DOWNLOAD_PACKAGE = {
/>, />,
DESCRIPTION1: <FormattedMessage DESCRIPTION1: <FormattedMessage
id={ 'methodology.page.downloadPacket.info.text1'} id={ 'methodology.page.downloadPacket.info.text1'}
defaultMessage= {`Download the data sources used in the CEJST (.csv and .xlsx, {downloadFileSize} unzipped) or the shapefile, along with a codebook (.zip, {shapefileSize} unzipped).`} defaultMessage= {`Download the data sources used in the CEJST (.csv and .xlsx, {downloadFileSize} unzipped), the shapefile, along with a codebook (.zip, {shapefileSize} unzipped) or the technical support document (.pdf, {tsdFileSize}).`}
description= {'Navigate to the methodology page. This is the download packet info text'} description= {'Navigate to the methodology page. This is the download packet info text'}
values= {{ values= {{
downloadFileSize: <FormattedNumber downloadFileSize: <FormattedNumber
@ -112,15 +122,47 @@ export const DOWNLOAD_PACKAGE = {
unit="megabyte" unit="megabyte"
unitDisplay="narrow" unitDisplay="narrow"
/>, />,
tsdFileSize: <FormattedNumber
value={DOWNLOAD_TSD_FILE_SIZE}
style="unit"
unit="kilobyte"
unitDisplay="narrow"
/>,
}} }}
/>, />,
LAST_UPDATED: <FormattedMessage ZIP_LAST_UPDATED: <FormattedMessage
id={ 'methodology.page.downloadPacket.info.last.updated'} id={ 'methodology.page.downloadPacket.info.zip.last.updated'}
defaultMessage= {`Last updated: {downloadLastUpdated} `} defaultMessage= {`Last updated: {downloadLastUpdated} `}
description= {'Navigate to the methodology page. This is the download packet info last updated'} description= {'Navigate to the methodology page. This is the download packet info last updated'}
values= {{ values= {{
downloadLastUpdated: <FormattedDate downloadLastUpdated: <FormattedDate
value={DOWNLOAD_LAST_UPDATED} 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" year="2-digit"
month="2-digit" month="2-digit"
day="2-digit" day="2-digit"
@ -137,6 +179,11 @@ export const DOWNLOAD_PACKAGE = {
defaultMessage= {'Download shapefile'} defaultMessage= {'Download shapefile'}
description= {'Navigate to the methodology page. This is the download shapefiles text'} 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 NEW_TAG: <FormattedMessage
id={ 'methodology.page.downloadPacket.new.tag.text'} id={ 'methodology.page.downloadPacket.new.tag.text'}
defaultMessage= {`<boldtag>NEW</boldtag>`} defaultMessage= {`<boldtag>NEW</boldtag>`}

View file

@ -1203,18 +1203,30 @@
"defaultMessage": "Download shapefile", "defaultMessage": "Download shapefile",
"description": "Navigate to the methodology page. This is the download shapefiles text" "description": "Navigate to the methodology page. This is the download shapefiles text"
}, },
"methodology.page.downloadPacket.button3.text": {
"defaultMessage": "Download technical support document",
"description": "Navigate to the methodology page. This is the download technical support document spreadsheet"
},
"methodology.page.downloadPacket.header.text": { "methodology.page.downloadPacket.header.text": {
"defaultMessage": "Files available for download", "defaultMessage": "Files available for download",
"description": "Navigate to the methodology page. This is the download packet header text" "description": "Navigate to the methodology page. This is the download packet header text"
}, },
"methodology.page.downloadPacket.info.last.updated": { "methodology.page.downloadPacket.info.shape.last.updated": {
"defaultMessage": "Last updated: {downloadLastUpdated}", "defaultMessage": "Last updated: {shapeLastUpdated}",
"description": "Navigate to the methodology page. This is the download packet info last updated" "description": "Navigate to the methodology page. This is the download packet info last updated"
}, },
"methodology.page.downloadPacket.info.text1": { "methodology.page.downloadPacket.info.text1": {
"defaultMessage": "Download the data sources used in the CEJST (.csv and .xlsx, {downloadFileSize} unzipped) or the shapefile, along with a codebook (.zip, {shapefileSize} unzipped).", "defaultMessage": "Download the data sources used in the CEJST (.csv and .xlsx, {downloadFileSize} unzipped), the shapefile, along with a codebook (.zip, {shapefileSize} unzipped) or the technical support document (.pdf, {tsdFileSize}).",
"description": "Navigate to the methodology page. This is the download packet info text" "description": "Navigate to the methodology page. This is the download packet info text"
}, },
"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"
},
"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"
},
"methodology.page.downloadPacket.new.tag.text": { "methodology.page.downloadPacket.new.tag.text": {
"defaultMessage": "<boldtag>NEW</boldtag>", "defaultMessage": "<boldtag>NEW</boldtag>",
"description": "Navigate to the methodology page. This is the new tag text" "description": "Navigate to the methodology page. This is the new tag text"

View file

@ -383,7 +383,7 @@ exports[`rendering of the DatasetContainer checks if various text fields are vis
Files available for download Files available for download
</div> </div>
<div> <div>
Download the data sources used in the CEJST (.csv and .xlsx, 52MB unzipped) or the shapefile, along with a codebook (.zip, 742MB unzipped). Download the data sources used in the CEJST (.csv and .xlsx, 52MB unzipped), the shapefile, along with a codebook (.zip, 742MB unzipped) or the technical support document (.pdf, 913kB).
</div> </div>
<div> <div>
<a <a
@ -447,6 +447,44 @@ exports[`rendering of the DatasetContainer checks if various text fields are vis
<div> <div>
Last updated: 04/06/22 Last updated: 04/06/22
</div> </div>
<div>
<div>
<span
class="usa-tag"
data-testid="tag"
>
<strong>
NEW
</strong>
</span>
</div>
<a
data-cy="shapefile-link"
download=""
href="//"
rel="noreferrer"
target="_blank"
>
<button
class="usa-button"
data-testid="button"
type="button"
>
<div>
<img
alt="download icon for download package"
src="test-file-stub"
/>
</div>
<div>
Download technical support document
</div>
</button>
</a>
</div>
<div>
Last updated: 04/19/22
</div>
</div> </div>
</div> </div>
</div> </div>