From 8712ff53ec07107ba60412f1e10d7957a7f865b4 Mon Sep 17 00:00:00 2001 From: Vim <86254807+vim-usds@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:27:56 -0800 Subject: [PATCH] Update survey links on behalf of lscharen (#2255) * Update survey links; ref external repo PR #117 * Restore the removed contact page survey link * Fix testing snapshots * linter errors * Update Spanish data survey link --------- Co-authored-by: Lucas Scharenbroich --- .../src/components/AreaDetail/AreaDetail.tsx | 1084 +++++++++++------ .../src/components/DatasetContainer/index.tsx | 4 +- .../datasetContainer.test.tsx.snap | 2 +- .../__snapshots__/howYouCanHelp.test.tsx.snap | 4 +- .../__snapshots__/J40Footer.spec.tsx.snap | 2 +- .../components/SurveyButton/SurveyButton.tsx | 5 +- .../__snapshots__/SurveyButton.test.tsx.snap | 2 +- client/src/data/constants.tsx | 364 +++--- client/src/data/copy/about.tsx | 14 +- client/src/data/copy/contact.tsx | 23 +- client/src/data/copy/faqs.tsx | 6 +- client/src/intl/en.json | 4 + client/src/pages/about.tsx | 4 +- client/src/pages/contact.tsx | 4 +- client/src/pages/downloads.tsx | 4 +- .../src/pages/frequently-asked-questions.tsx | 4 +- client/src/pages/index.tsx | 3 +- client/src/pages/methodology.tsx | 4 +- client/src/pages/previous-versions.tsx | 4 +- .../tests/__snapshots__/about.test.tsx.snap | 8 +- .../tests/__snapshots__/contact.test.tsx.snap | 19 +- .../__snapshots__/downloads.test.tsx.snap | 4 +- .../freqAskedQuestions.test.tsx.snap | 8 +- .../__snapshots__/methodology.test.tsx.snap | 6 +- .../__snapshots__/publicEng.test.tsx.snap | 2 +- .../techSupportDoc.test.tsx.snap | 2 +- 26 files changed, 979 insertions(+), 611 deletions(-) diff --git a/client/src/components/AreaDetail/AreaDetail.tsx b/client/src/components/AreaDetail/AreaDetail.tsx index 252fdc71..4e480dd8 100644 --- a/client/src/components/AreaDetail/AreaDetail.tsx +++ b/client/src/components/AreaDetail/AreaDetail.tsx @@ -1,30 +1,30 @@ /* eslint-disable quotes */ // External Libs: -import React from 'react'; -import {MessageDescriptor, useIntl} from 'gatsby-plugin-intl'; -import {Accordion, Button} from '@trussworks/react-uswds'; +import React from "react"; +import {MessageDescriptor, useIntl} from "gatsby-plugin-intl"; +import {Accordion, Button} from "@trussworks/react-uswds"; // Components: -import Category from '../Category'; -import DonutCopy from '../DonutCopy'; -import Indicator from '../Indicator'; -import PrioritizationCopy from '../PrioritizationCopy'; -import PrioritizationCopy2 from '../PrioritizationCopy2'; -import TractDemographics from '../TractDemographics'; -import TractInfo from '../TractInfo'; -import TractPrioritization from '../TractPrioritization'; +import Category from "../Category"; +import DonutCopy from "../DonutCopy"; +import Indicator from "../Indicator"; +import PrioritizationCopy from "../PrioritizationCopy"; +import PrioritizationCopy2 from "../PrioritizationCopy2"; +import TractDemographics from "../TractDemographics"; +import TractInfo from "../TractInfo"; +import TractPrioritization from "../TractPrioritization"; // Styles and constants -import * as styles from './areaDetail.module.scss'; -import * as constants from '../../data/constants'; -import * as EXPLORE_COPY from '../../data/copy/explore'; +import * as styles from "./areaDetail.module.scss"; +import * as constants from "../../data/constants"; +import * as EXPLORE_COPY from "../../data/copy/explore"; // @ts-ignore -import launchIcon from '/node_modules/uswds/dist/img/usa-icons/launch.svg'; +import launchIcon from "/node_modules/uswds/dist/img/usa-icons/launch.svg"; interface IAreaDetailProps { - properties: constants.J40Properties, - hash: string[], + properties: constants.J40Properties; + hash: string[]; } /** @@ -38,7 +38,7 @@ interface IAreaDetailProps { * - FUDS * */ -export type indicatorType = 'percentile' | 'percent' | 'boolean'; +export type indicatorType = "percentile" | "percent" | "boolean"; /** * This interface is used as define the various fields for each indicator in the side panel @@ -50,12 +50,12 @@ export type indicatorType = 'percentile' | 'percent' | 'boolean'; * threshold: a custom value of threshold for certain indicators * */ export interface indicatorInfo { - label: string, - description: string, - type: indicatorType, - value: number | boolean | null, - isDisadvagtaged: boolean, - threshold?: number, + label: string; + description: string; + type: indicatorType; + value: number | boolean | null; + isDisadvagtaged: boolean; + threshold?: number; } /** @@ -69,13 +69,13 @@ export interface indicatorInfo { * isExceedBothSocioBurdens: boolean to indicate if the category exceeds both socio-eco burdens * */ export interface ICategory { - id: string, - titleText: string, - indicators: indicatorInfo[], - socioEcIndicators: indicatorInfo[], - isDisadvagtaged: boolean | null, - isExceed1MoreBurden: boolean | null, - isExceedBothSocioBurdens: boolean | null, + id: string; + titleText: string; + indicators: indicatorInfo[]; + socioEcIndicators: indicatorInfo[]; + isDisadvagtaged: boolean | null; + isExceed1MoreBurden: boolean | null; + isExceedBothSocioBurdens: boolean | null; } /** @@ -90,13 +90,12 @@ export interface ICategory { * @param {MessageDescriptor} label - allows to re-use this filter for any number of indicators * @return {indicatorInfo} */ -export const indicatorFilter = (label:MessageDescriptor) => { +export const indicatorFilter = (label: MessageDescriptor) => { const intl = useIntl(); - return (indicator:indicatorInfo) => ( + return (indicator: indicatorInfo) => indicator.label !== intl.formatMessage(label) || - ( indicator.label == intl.formatMessage(label) && indicator.value != null) - ); + (indicator.label == intl.formatMessage(label) && indicator.value != null); }; /** @@ -116,7 +115,7 @@ export const getTribalPercentValue = (tribalPercentRaw: number) => { } if (tribalPercentRaw && tribalPercentRaw > 0) { - return ` ${parseFloat((tribalPercentRaw*100).toFixed())} %`; + return ` ${parseFloat((tribalPercentRaw * 100).toFixed())} %`; } }; @@ -131,31 +130,58 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { const intl = useIntl(); // console.log the properties of the census that is selected: - console.log("BE signals for tract (last one is the tract currently selected): ", properties); + console.log( + "BE signals for tract (last one is the tract currently selected): ", + properties, + ); // console.log around the donut, adjacency and tribal info: - console.log("Income imputed? ", properties[constants.IMPUTE_FLAG] === "0" ? ' NO' : ' YES'); - console.log("Adjacency indicator? ", properties[constants.ADJACENCY_EXCEEDS_THRESH] ? ' YES' : ' NO'); - console.log("% of tract tribal: ", getTribalPercentValue(properties[constants.TRIBAL_AREAS_PERCENTAGE])); - console.log("Tribal count in AK: ", properties[constants.TRIBAL_AREAS_COUNT_AK] >= 1 ? - ` ${properties[constants.TRIBAL_AREAS_COUNT_AK]}` : ` null`); - console.log("Tribal count in CONUS: ", properties[constants.TRIBAL_AREAS_COUNT_CONUS] >= 1 ? - ` ${properties[constants.TRIBAL_AREAS_COUNT_CONUS]}` : ` null`); - + console.log( + "Income imputed? ", + properties[constants.IMPUTE_FLAG] === "0" ? " NO" : " YES", + ); + console.log( + "Adjacency indicator? ", + properties[constants.ADJACENCY_EXCEEDS_THRESH] ? " YES" : " NO", + ); + console.log( + "% of tract tribal: ", + getTribalPercentValue(properties[constants.TRIBAL_AREAS_PERCENTAGE]), + ); + console.log( + "Tribal count in AK: ", + properties[constants.TRIBAL_AREAS_COUNT_AK] >= 1 ? + ` ${properties[constants.TRIBAL_AREAS_COUNT_AK]}` : + ` null`, + ); + console.log( + "Tribal count in CONUS: ", + properties[constants.TRIBAL_AREAS_COUNT_CONUS] >= 1 ? + ` ${properties[constants.TRIBAL_AREAS_COUNT_CONUS]}` : + ` null`, + ); // Fix constants.MISSING_DATA_STRING import const blockGroup = properties[constants.GEOID_PROPERTY] ? - properties[constants.GEOID_PROPERTY] : constants.MISSING_DATA_STRING; + properties[constants.GEOID_PROPERTY] : + constants.MISSING_DATA_STRING; const population = properties[constants.TOTAL_POPULATION] ? - properties[constants.TOTAL_POPULATION] : constants.MISSING_DATA_STRING; + properties[constants.TOTAL_POPULATION] : + constants.MISSING_DATA_STRING; const countyName = properties[constants.COUNTY_NAME] ? - properties[constants.COUNTY_NAME] : constants.MISSING_DATA_STRING; + properties[constants.COUNTY_NAME] : + constants.MISSING_DATA_STRING; const stateName = properties[constants.STATE_NAME] ? - properties[constants.STATE_NAME] : constants.MISSING_DATA_STRING; + properties[constants.STATE_NAME] : + constants.MISSING_DATA_STRING; const sidePanelState = properties[constants.SIDE_PANEL_STATE]; - const percentTractTribal = properties[constants.TRIBAL_AREAS_PERCENTAGE] >= 0 ? - parseFloat((properties[constants.TRIBAL_AREAS_PERCENTAGE]*100).toFixed()) : null; + const percentTractTribal = + properties[constants.TRIBAL_AREAS_PERCENTAGE] >= 0 ? + parseFloat( + (properties[constants.TRIBAL_AREAS_PERCENTAGE] * 100).toFixed(), + ) : + null; /** * The workforce development category has some indicators who's source will vary depending on which @@ -167,51 +193,69 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { */ const getWorkForceIndicatorValue = (indicatorName: string) => { if (sidePanelState === constants.SIDE_PANEL_STATE_VALUES.ISLAND_AREAS) { - if (indicatorName === 'lowMedInc') { - return properties.hasOwnProperty(constants - .ISLAND_AREAS_LOW_MEDIAN_INCOME_LOW_HS_EDU_PERCENTILE_FIELD) ? - properties[constants.ISLAND_AREAS_LOW_MEDIAN_INCOME_LOW_HS_EDU_PERCENTILE_FIELD] : null; + if (indicatorName === "lowMedInc") { + return properties.hasOwnProperty( + constants.ISLAND_AREAS_LOW_MEDIAN_INCOME_LOW_HS_EDU_PERCENTILE_FIELD, + ) ? + properties[ + constants + .ISLAND_AREAS_LOW_MEDIAN_INCOME_LOW_HS_EDU_PERCENTILE_FIELD + ] : + null; } - if (indicatorName === 'unemploy') { - return properties.hasOwnProperty(constants - .ISLAND_AREAS_UNEMPLOYMENT_LOW_HS_EDU_PERCENTILE_FIELD) ? - properties[constants.ISLAND_AREAS_UNEMPLOYMENT_LOW_HS_EDU_PERCENTILE_FIELD] : null; + if (indicatorName === "unemploy") { + return properties.hasOwnProperty( + constants.ISLAND_AREAS_UNEMPLOYMENT_LOW_HS_EDU_PERCENTILE_FIELD, + ) ? + properties[ + constants.ISLAND_AREAS_UNEMPLOYMENT_LOW_HS_EDU_PERCENTILE_FIELD + ] : + null; } - if (indicatorName === 'poverty') { - return properties.hasOwnProperty(constants - .ISLAND_AREAS_POVERTY_LOW_HS_EDU_PERCENTILE_FIELD) ? - properties[constants.ISLAND_AREAS_POVERTY_LOW_HS_EDU_PERCENTILE_FIELD] : null; + if (indicatorName === "poverty") { + return properties.hasOwnProperty( + constants.ISLAND_AREAS_POVERTY_LOW_HS_EDU_PERCENTILE_FIELD, + ) ? + properties[ + constants.ISLAND_AREAS_POVERTY_LOW_HS_EDU_PERCENTILE_FIELD + ] : + null; } - if (indicatorName === 'highSchool') { - return properties.hasOwnProperty(constants - .ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD) ? - properties[constants.ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD] : null; + if (indicatorName === "highSchool") { + return properties.hasOwnProperty( + constants.ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD, + ) ? + properties[constants.ISLAND_AREAS_HS_EDU_PERCENTAGE_FIELD] : + null; } } - if (indicatorName === 'lowMedInc') { - return properties.hasOwnProperty(constants - .LOW_MEDIAN_INCOME_PERCENTILE) ? - properties[constants.LOW_MEDIAN_INCOME_PERCENTILE] : null; + if (indicatorName === "lowMedInc") { + return properties.hasOwnProperty(constants.LOW_MEDIAN_INCOME_PERCENTILE) ? + properties[constants.LOW_MEDIAN_INCOME_PERCENTILE] : + null; } - if (indicatorName === 'unemploy') { - return properties.hasOwnProperty(constants - .UNEMPLOYMENT_PROPERTY_PERCENTILE) ? - properties[constants.UNEMPLOYMENT_PROPERTY_PERCENTILE] : null; + if (indicatorName === "unemploy") { + return properties.hasOwnProperty( + constants.UNEMPLOYMENT_PROPERTY_PERCENTILE, + ) ? + properties[constants.UNEMPLOYMENT_PROPERTY_PERCENTILE] : + null; } - if (indicatorName === 'poverty') { - return properties.hasOwnProperty(constants - .POVERTY_BELOW_100_PERCENTILE) ? - properties[constants.POVERTY_BELOW_100_PERCENTILE] : null; + if (indicatorName === "poverty") { + return properties.hasOwnProperty(constants.POVERTY_BELOW_100_PERCENTILE) ? + properties[constants.POVERTY_BELOW_100_PERCENTILE] : + null; } - if (indicatorName === 'highSchool') { - return properties.hasOwnProperty(constants - .HIGH_SCHOOL_PROPERTY_PERCENTILE) ? - properties[constants.HIGH_SCHOOL_PROPERTY_PERCENTILE] : null; + if (indicatorName === "highSchool") { + return properties.hasOwnProperty( + constants.HIGH_SCHOOL_PROPERTY_PERCENTILE, + ) ? + properties[constants.HIGH_SCHOOL_PROPERTY_PERCENTILE] : + null; } }; - /** * The workforce development category has some indicators who's disadvantaged boolean * will vary depending on which territory is selected. This function allows us to change @@ -222,51 +266,68 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { */ const getWorkForceIndicatorIsDisadv = (indicatorName: string) => { if (sidePanelState === constants.SIDE_PANEL_STATE_VALUES.ISLAND_AREAS) { - if (indicatorName === 'lowMedInc') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_LOW_MEDIAN_INCOME) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_LOW_MEDIAN_INCOME] : null; + if (indicatorName === "lowMedInc") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_LOW_MEDIAN_INCOME, + ) ? + properties[ + constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_LOW_MEDIAN_INCOME + ] : + null; } - if (indicatorName === 'unemploy') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_UNEMPLOYMENT) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_UNEMPLOYMENT] : null; + if (indicatorName === "unemploy") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_UNEMPLOYMENT, + ) ? + properties[constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_UNEMPLOYMENT] : + null; } - if (indicatorName === 'poverty') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_BELOW_100_POVERTY) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_BELOW_100_POVERTY] : null; + if (indicatorName === "poverty") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_BELOW_100_POVERTY, + ) ? + properties[ + constants.IS_EXCEEDS_THRESH_FOR_ISLAND_AREA_BELOW_100_POVERTY + ] : + null; } - if (indicatorName === 'highSchool') { - return properties.hasOwnProperty(constants - .ISLAND_AREA_LOW_HS_EDU) ? - properties[constants.ISLAND_AREA_LOW_HS_EDU] : null; + if (indicatorName === "highSchool") { + return properties.hasOwnProperty(constants.ISLAND_AREA_LOW_HS_EDU) ? + properties[constants.ISLAND_AREA_LOW_HS_EDU] : + null; } } - if (indicatorName === 'lowMedInc') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_LOW_MEDIAN_INCOME) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_LOW_MEDIAN_INCOME] : null; + if (indicatorName === "lowMedInc") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_LOW_MEDIAN_INCOME, + ) ? + properties[constants.IS_EXCEEDS_THRESH_FOR_LOW_MEDIAN_INCOME] : + null; } - if (indicatorName === 'unemploy') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_UNEMPLOYMENT) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_UNEMPLOYMENT] : null; + if (indicatorName === "unemploy") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_UNEMPLOYMENT, + ) ? + properties[constants.IS_EXCEEDS_THRESH_FOR_UNEMPLOYMENT] : + null; } - if (indicatorName === 'poverty') { - return properties.hasOwnProperty(constants - .IS_EXCEEDS_THRESH_FOR_BELOW_100_POVERTY) ? - properties[constants.IS_EXCEEDS_THRESH_FOR_BELOW_100_POVERTY] : null; + if (indicatorName === "poverty") { + return properties.hasOwnProperty( + constants.IS_EXCEEDS_THRESH_FOR_BELOW_100_POVERTY, + ) ? + properties[constants.IS_EXCEEDS_THRESH_FOR_BELOW_100_POVERTY] : + null; } - if (indicatorName === 'highSchool') { - return properties.hasOwnProperty(constants - .IS_LOW_HS_EDUCATION_LOW_HIGHER_ED_PRIORITIZED) ? - properties[constants.IS_LOW_HS_EDUCATION_LOW_HIGHER_ED_PRIORITIZED] : null; + if (indicatorName === "highSchool") { + return properties.hasOwnProperty( + constants.IS_LOW_HS_EDUCATION_LOW_HIGHER_ED_PRIORITIZED, + ) ? + properties[constants.IS_LOW_HS_EDUCATION_LOW_HIGHER_ED_PRIORITIZED] : + null; } }; - /** * Define each indicator in the side panel with constants from copy file (for intl) * @@ -276,57 +337,81 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { // Climate category const expAgLoss: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.EXP_AG_LOSS), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_AG_LOSS), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_AG_LOSS, + ), + type: "percentile", value: properties.hasOwnProperty(constants.EXP_AGRICULTURE_LOSS_PERCENTILE) ? - properties[constants.EXP_AGRICULTURE_LOSS_PERCENTILE] : null, + properties[constants.EXP_AGRICULTURE_LOSS_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_AGR_LOSS] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_AGR_LOSS] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_AGR_LOSS] : + null, }; const expBldLoss: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.EXP_BLD_LOSS), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_BLD_LOSS), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_BLD_LOSS, + ), + type: "percentile", value: properties.hasOwnProperty(constants.EXP_BUILDING_LOSS_PERCENTILE) ? - properties[constants.EXP_BUILDING_LOSS_PERCENTILE] : null, + properties[constants.EXP_BUILDING_LOSS_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_BLD_LOSS] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_BLD_LOSS] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_BLD_LOSS] : + null, }; const expPopLoss: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.EXP_POP_LOSS), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_POP_LOSS), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.EXP_POP_LOSS, + ), + type: "percentile", value: properties.hasOwnProperty(constants.EXP_POPULATION_LOSS_PERCENTILE) ? - properties[constants.EXP_POPULATION_LOSS_PERCENTILE] : null, + properties[constants.EXP_POPULATION_LOSS_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_POP_LOSS] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_POP_LOSS] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_EXP_POP_LOSS] : + null, }; const flooding: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.FLOODING), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.FLOODING), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.FLOODING, + ), + type: "percentile", value: properties.hasOwnProperty(constants.FLOODING_PERCENTILE) ? - properties[constants.FLOODING_PERCENTILE] : null, + properties[constants.FLOODING_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FLOODING] ? - properties[constants.IS_EXCEEDS_THRESH_FLOODING] : null, + properties[constants.IS_EXCEEDS_THRESH_FLOODING] : + null, }; const wildfire: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.WILDFIRE), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.WILDFIRE), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.WILDFIRE, + ), + type: "percentile", value: properties.hasOwnProperty(constants.WILDFIRE_PERCENTILE) ? - properties[constants.WILDFIRE_PERCENTILE] : null, + properties[constants.WILDFIRE_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_WILDFIRE] ? - properties[constants.IS_EXCEEDS_THRESH_WILDFIRE] : null, + properties[constants.IS_EXCEEDS_THRESH_WILDFIRE] : + null, }; const lowInc: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LOW_INCOME), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_INCOME), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_INCOME, + ), + type: "percentile", value: properties.hasOwnProperty(constants.POVERTY_BELOW_200_PERCENTILE) ? - properties[constants.POVERTY_BELOW_200_PERCENTILE] : null, + properties[constants.POVERTY_BELOW_200_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_FEDERAL_POVERTY_LEVEL_200] ? - properties[constants.IS_FEDERAL_POVERTY_LEVEL_200] : null, + properties[constants.IS_FEDERAL_POVERTY_LEVEL_200] : + null, threshold: 65, }; // const higherEd: indicatorInfo = { @@ -340,254 +425,378 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { // threshold: 80, // }; - // Energy category const energyCost: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.ENERGY_COST), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ENERGY_COST), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ENERGY_COST, + ), + type: "percentile", value: properties.hasOwnProperty(constants.ENERGY_PERCENTILE) ? - properties[constants.ENERGY_PERCENTILE] : null, + properties[constants.ENERGY_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_ENERGY_BURDEN] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_ENERGY_BURDEN] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_ENERGY_BURDEN] : + null, }; const pm25: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.PM_2_5), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PM_2_5), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PM_2_5, + ), + type: "percentile", value: properties.hasOwnProperty(constants.PM25_PERCENTILE) ? - properties[constants.PM25_PERCENTILE] : null, + properties[constants.PM25_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_PM25] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_PM25] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_PM25] : + null, }; // Health category const asthma: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.ASTHMA), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ASTHMA), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ASTHMA, + ), + type: "percentile", value: properties.hasOwnProperty(constants.ASTHMA_PERCENTILE) ? - properties[constants.ASTHMA_PERCENTILE] : null, + properties[constants.ASTHMA_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_ASTHMA] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_ASTHMA] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_ASTHMA] : + null, }; const diabetes: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.DIABETES), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.DIABETES), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.DIABETES, + ), + type: "percentile", value: properties.hasOwnProperty(constants.DIABETES_PERCENTILE) ? - properties[constants.DIABETES_PERCENTILE] : null, + properties[constants.DIABETES_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_DIABETES] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_DIABETES] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_DIABETES] : + null, }; const heartDisease: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HEART_DISEASE), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HEART_DISEASE), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HEART_DISEASE, + ), + type: "percentile", value: properties.hasOwnProperty(constants.HEART_PERCENTILE) ? - properties[constants.HEART_PERCENTILE] : null, + properties[constants.HEART_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_HEART_DISEASE] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_HEART_DISEASE] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_HEART_DISEASE] : + null, }; const lifeExpect: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LIFE_EXPECT), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_LIFE_EXPECT), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_LIFE_EXPECT, + ), + type: "percentile", value: properties.hasOwnProperty(constants.LIFE_PERCENTILE) ? - properties[constants.LIFE_PERCENTILE] : null, + properties[constants.LIFE_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_LOW_LIFE_EXP] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_LOW_LIFE_EXP] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_LOW_LIFE_EXP] : + null, }; - // Housing category const historicUnderinvest: indicatorInfo = { - label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HIST_UNDERINVEST), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HIST_UNDERINVEST), - type: 'boolean', - value: properties.hasOwnProperty(constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH) ? - (properties[constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH] === - constants.HISTORIC_UNDERINVESTMENT_RAW_YES ? true : false) : null, - isDisadvagtaged: properties.hasOwnProperty(constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH) && + label: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATORS.HIST_UNDERINVEST, + ), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HIST_UNDERINVEST, + ), + type: "boolean", + value: properties.hasOwnProperty( + constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH, + ) ? properties[constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH] === - constants.HISTORIC_UNDERINVESTMENT_RAW_YES ? true : false, + constants.HISTORIC_UNDERINVESTMENT_RAW_YES ? + true : + false : + null, + isDisadvagtaged: + properties.hasOwnProperty( + constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH, + ) && + properties[constants.HISTORIC_UNDERINVESTMENT_EXCEED_THRESH] === + constants.HISTORIC_UNDERINVESTMENT_RAW_YES ? + true : + false, }; const houseCost: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HOUSE_COST), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HOUSE_COST), - type: 'percentile', - value: properties.hasOwnProperty(constants.HOUSING_BURDEN_PROPERTY_PERCENTILE) ? - properties[constants.HOUSING_BURDEN_PROPERTY_PERCENTILE] : null, + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HOUSE_COST, + ), + type: "percentile", + value: properties.hasOwnProperty( + constants.HOUSING_BURDEN_PROPERTY_PERCENTILE, + ) ? + properties[constants.HOUSING_BURDEN_PROPERTY_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_HOUSE_BURDEN] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_HOUSE_BURDEN] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_HOUSE_BURDEN] : + null, }; const lackGreenSpace: indicatorInfo = { - label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LACK_GREEN_SPACE), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LACK_GREEN_SPACE), - type: 'percentile', + label: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATORS.LACK_GREEN_SPACE, + ), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LACK_GREEN_SPACE, + ), + type: "percentile", value: properties.hasOwnProperty(constants.IMPERVIOUS_PERCENTILE) ? - properties[constants.IMPERVIOUS_PERCENTILE] : null, + properties[constants.IMPERVIOUS_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_IMPERVIOUS] ? - properties[constants.IS_EXCEEDS_THRESH_IMPERVIOUS] : null, + properties[constants.IS_EXCEEDS_THRESH_IMPERVIOUS] : + null, }; const lackPlumbing: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LACK_PLUMBING), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LACK_PLUMBING), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LACK_PLUMBING, + ), + type: "percentile", value: properties.hasOwnProperty(constants.KITCHEN_PLUMB_PERCENTILE) ? - properties[constants.KITCHEN_PLUMB_PERCENTILE] : null, + properties[constants.KITCHEN_PLUMB_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_KITCHEN_PLUMB] ? - properties[constants.IS_EXCEEDS_THRESH_KITCHEN_PLUMB] : null, + properties[constants.IS_EXCEEDS_THRESH_KITCHEN_PLUMB] : + null, }; const leadPaint: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LEAD_PAINT), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LEAD_PAINT), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LEAD_PAINT, + ), + type: "percentile", value: properties.hasOwnProperty(constants.LEAD_PAINT_PERCENTILE) ? - properties[constants.LEAD_PAINT_PERCENTILE] : null, - isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_LEAD_PAINT_AND_MEDIAN_HOME_VAL] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_LEAD_PAINT_AND_MEDIAN_HOME_VAL] : null, + properties[constants.LEAD_PAINT_PERCENTILE] : + null, + isDisadvagtaged: properties[ + constants.IS_EXCEEDS_THRESH_FOR_LEAD_PAINT_AND_MEDIAN_HOME_VAL + ] ? + properties[ + constants.IS_EXCEEDS_THRESH_FOR_LEAD_PAINT_AND_MEDIAN_HOME_VAL + ] : + null, }; - // Pollution categeory const abandonMines: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.ABANDON_MINES), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ABANDON_MINES), - type: 'boolean', - value: properties.hasOwnProperty(constants.ABANDON_LAND_MINES_EXCEEDS_THRESH) ? - properties[constants.ABANDON_LAND_MINES_EXCEEDS_THRESH] : null, - isDisadvagtaged: properties.hasOwnProperty(constants.ABANDON_LAND_MINES_EXCEEDS_THRESH) ? - properties[constants.ABANDON_LAND_MINES_EXCEEDS_THRESH] : null, + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.ABANDON_MINES, + ), + type: "boolean", + value: properties.hasOwnProperty( + constants.ABANDON_LAND_MINES_EXCEEDS_THRESH, + ) ? + properties[constants.ABANDON_LAND_MINES_EXCEEDS_THRESH] : + null, + isDisadvagtaged: properties.hasOwnProperty( + constants.ABANDON_LAND_MINES_EXCEEDS_THRESH, + ) ? + properties[constants.ABANDON_LAND_MINES_EXCEEDS_THRESH] : + null, }; const formerDefSites: indicatorInfo = { - label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.FORMER_DEF_SITES), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.FORMER_DEF_SITES), - type: 'boolean', + label: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATORS.FORMER_DEF_SITES, + ), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.FORMER_DEF_SITES, + ), + type: "boolean", + // double equality is used in this instance as it seems that FUDS_RAW could be "1" or 1 from the BE value: properties.hasOwnProperty(constants.FORMER_DEF_SITES_RAW_VALUE) ? - // double equality is used in this instance as it seems that FUDS_RAW could be "1" or 1 from the BE - (properties[constants.FORMER_DEF_SITES_RAW_VALUE] == constants.FUDS_RAW_YES ? true : false) : + properties[constants.FORMER_DEF_SITES_RAW_VALUE] == + constants.FUDS_RAW_YES ? + true : + false : + null, + isDisadvagtaged: properties.hasOwnProperty( + constants.FORMER_DEF_SITES_EXCEEDS_THRESH, + ) ? + properties[constants.FORMER_DEF_SITES_EXCEEDS_THRESH] : null, - isDisadvagtaged: properties.hasOwnProperty(constants.FORMER_DEF_SITES_EXCEEDS_THRESH) ? - properties[constants.FORMER_DEF_SITES_EXCEEDS_THRESH] : null, }; const proxHaz: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.PROX_HAZ), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_HAZ), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_HAZ, + ), + type: "percentile", value: properties.hasOwnProperty(constants.PROXIMITY_TSDF_SITES_PERCENTILE) ? - properties[constants.PROXIMITY_TSDF_SITES_PERCENTILE] : null, + properties[constants.PROXIMITY_TSDF_SITES_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_HAZARD_WASTE] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_HAZARD_WASTE] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_HAZARD_WASTE] : + null, }; const proxRMP: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.PROX_RMP), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_RMP), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_RMP, + ), + type: "percentile", value: properties.hasOwnProperty(constants.PROXIMITY_RMP_SITES_PERCENTILE) ? - properties[constants.PROXIMITY_RMP_SITES_PERCENTILE] : null, + properties[constants.PROXIMITY_RMP_SITES_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_RMP] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_RMP] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_RMP] : + null, }; const proxNPL: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.PROX_NPL), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_NPL), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.PROX_NPL, + ), + type: "percentile", value: properties.hasOwnProperty(constants.PROXIMITY_NPL_SITES_PERCENTILE) ? - properties[constants.PROXIMITY_NPL_SITES_PERCENTILE] : null, + properties[constants.PROXIMITY_NPL_SITES_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_SUPERFUND] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_SUPERFUND] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_SUPERFUND] : + null, }; - // Transpotation category const dieselPartMatter: indicatorInfo = { - label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.DIESEL_PARTICULATE_MATTER), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.DIESEL_PARTICULATE_MATTER), - type: 'percentile', + label: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATORS.DIESEL_PARTICULATE_MATTER, + ), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.DIESEL_PARTICULATE_MATTER, + ), + type: "percentile", value: properties.hasOwnProperty(constants.DIESEL_MATTER_PERCENTILE) ? - properties[constants.DIESEL_MATTER_PERCENTILE] : null, + properties[constants.DIESEL_MATTER_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_DIESEL_PM] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_DIESEL_PM] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_DIESEL_PM] : + null, }; const barrierTransport: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.BARRIER_TRANS), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.BARRIER_TRANS), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.BARRIER_TRANS, + ), + type: "percentile", value: properties.hasOwnProperty(constants.TRAVEL_DISADV_PERCENTILE) ? - properties[constants.TRAVEL_DISADV_PERCENTILE] : null, + properties[constants.TRAVEL_DISADV_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_TRAVEL_DISADV] ? - properties[constants.IS_EXCEEDS_THRESH_TRAVEL_DISADV] : null, + properties[constants.IS_EXCEEDS_THRESH_TRAVEL_DISADV] : + null, }; const trafficVolume: indicatorInfo = { - label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.TRAFFIC_VOLUME), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.TRAFFIC_VOLUME), - type: 'percentile', + label: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATORS.TRAFFIC_VOLUME, + ), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.TRAFFIC_VOLUME, + ), + type: "percentile", value: properties.hasOwnProperty(constants.TRAFFIC_PERCENTILE) ? - properties[constants.TRAFFIC_PERCENTILE] : null, + properties[constants.TRAFFIC_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_TRAFFIC_PROX] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_TRAFFIC_PROX] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_TRAFFIC_PROX] : + null, }; - // Water category const leakyTanks: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LEAKY_TANKS), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LEAKY_TANKS), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LEAKY_TANKS, + ), + type: "percentile", value: properties.hasOwnProperty(constants.LEAKY_UNDER_PERCENTILE) ? - properties[constants.LEAKY_UNDER_PERCENTILE] : null, + properties[constants.LEAKY_UNDER_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_LEAKY_UNDER] ? - properties[constants.IS_EXCEEDS_THRESH_LEAKY_UNDER] : null, + properties[constants.IS_EXCEEDS_THRESH_LEAKY_UNDER] : + null, }; const wasteWater: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.WASTE_WATER), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.WASTE_WATER), - type: 'percentile', + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.WASTE_WATER, + ), + type: "percentile", value: properties.hasOwnProperty(constants.WASTEWATER_PERCENTILE) ? - properties[constants.WASTEWATER_PERCENTILE] : null, + properties[constants.WASTEWATER_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_WASTEWATER] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_WASTEWATER] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_WASTEWATER] : + null, }; - // Workforce dev category const lingIso: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LING_ISO), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LING_ISO), - type: 'percentile', - value: properties.hasOwnProperty(constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE) ? - properties[constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE] : null, + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LING_ISO, + ), + type: "percentile", + value: properties.hasOwnProperty( + constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE, + ) ? + properties[constants.LINGUISTIC_ISOLATION_PROPERTY_PERCENTILE] : + null, isDisadvagtaged: properties[constants.IS_EXCEEDS_THRESH_FOR_LINGUISITIC_ISO] ? - properties[constants.IS_EXCEEDS_THRESH_FOR_LINGUISITIC_ISO] : null, + properties[constants.IS_EXCEEDS_THRESH_FOR_LINGUISITIC_ISO] : + null, }; const lowMedInc: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.LOW_MED_INC), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_MED_INCOME), - type: 'percentile', - value: getWorkForceIndicatorValue('lowMedInc'), - isDisadvagtaged: getWorkForceIndicatorIsDisadv('lowMedInc'), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.LOW_MED_INCOME, + ), + type: "percentile", + value: getWorkForceIndicatorValue("lowMedInc"), + isDisadvagtaged: getWorkForceIndicatorIsDisadv("lowMedInc"), }; const unemploy: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.UNEMPLOY), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.UNEMPLOY), - type: 'percentile', - value: getWorkForceIndicatorValue('unemploy'), - isDisadvagtaged: getWorkForceIndicatorIsDisadv('unemploy'), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.UNEMPLOY, + ), + type: "percentile", + value: getWorkForceIndicatorValue("unemploy"), + isDisadvagtaged: getWorkForceIndicatorIsDisadv("unemploy"), }; const poverty: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.POVERTY), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.POVERTY), - type: 'percentile', - value: getWorkForceIndicatorValue('poverty'), - isDisadvagtaged: getWorkForceIndicatorIsDisadv('poverty'), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.POVERTY, + ), + type: "percentile", + value: getWorkForceIndicatorValue("poverty"), + isDisadvagtaged: getWorkForceIndicatorIsDisadv("poverty"), }; const highSchool: indicatorInfo = { label: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HIGH_SCL), - description: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HIGH_SKL), - type: 'percent', - value: getWorkForceIndicatorValue('highSchool'), - isDisadvagtaged: getWorkForceIndicatorIsDisadv('highSchool'), + description: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_INDICATOR_DESCRIPTION.HIGH_SKL, + ), + type: "percent", + value: getWorkForceIndicatorValue("highSchool"), + isDisadvagtaged: getWorkForceIndicatorIsDisadv("highSchool"), threshold: 10, }; @@ -597,106 +806,179 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { * The indicators property must be an array with last two elements being the * socioeconomic burdens. */ - let categories:ICategory[] = [ + let categories: ICategory[] = [ { - id: 'climate-change', + id: "climate-change", titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLIMATE), indicators: [expAgLoss, expBldLoss, expPopLoss, flooding, wildfire], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_CLIMATE_FACTOR_DISADVANTAGED] ? - properties[constants.IS_CLIMATE_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_CLIMATE_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_CLIMATE_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_CLIMATE_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_CLIMATE_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_CLIMATE_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'clean-energy', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_ENERGY), + id: "clean-energy", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_ENERGY, + ), indicators: [energyCost, pm25], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_ENERGY_FACTOR_DISADVANTAGED] ? - properties[constants.IS_ENERGY_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_ENERGY_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_ENERGY_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_ENERGY_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_ENERGY_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_ENERGY_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'health-burdens', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.HEALTH_BURDEN), + id: "health-burdens", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.HEALTH_BURDEN, + ), indicators: [asthma, diabetes, heartDisease, lifeExpect], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_HEALTH_FACTOR_DISADVANTAGED] ? - properties[constants.IS_HEALTH_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_HEALTH_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_HEALTH_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_HEALTH_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_HEALTH_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_HEALTH_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'sustain-house', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.SUSTAIN_HOUSE), - indicators: [historicUnderinvest, houseCost, lackGreenSpace, lackPlumbing, leadPaint], + id: "sustain-house", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.SUSTAIN_HOUSE, + ), + indicators: [ + historicUnderinvest, + houseCost, + lackGreenSpace, + lackPlumbing, + leadPaint, + ], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_HOUSING_FACTOR_DISADVANTAGED] ? - properties[constants.IS_HOUSING_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_HOUSING_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_HOUSING_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_HOUSING_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_HOUSING_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_HOUSING_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'leg-pollute', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.LEG_POLLUTE), + id: "leg-pollute", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.LEG_POLLUTE, + ), indicators: [abandonMines, formerDefSites, proxHaz, proxRMP, proxNPL], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_POLLUTION_FACTOR_DISADVANTAGED] ? - properties[constants.IS_POLLUTION_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_POLLUTION_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_POLLUTION_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_POLLUTION_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_POLLUTION_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_POLLUTION_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'clean-transport', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_TRANSPORT), + id: "clean-transport", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_TRANSPORT, + ), indicators: [dieselPartMatter, barrierTransport, trafficVolume], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_TRANSPORT_FACTOR_DISADVANTAGED] ? - properties[constants.IS_TRANSPORT_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_TRANSPORT_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_TRANSPORT_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_TRANSPORT_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_TRANSPORT_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_TRANSPORT_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'clean-water', - titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_WATER), + id: "clean-water", + titleText: intl.formatMessage( + EXPLORE_COPY.SIDE_PANEL_CATEGORY.CLEAN_WATER, + ), indicators: [leakyTanks, wasteWater], socioEcIndicators: [lowInc], isDisadvagtaged: properties[constants.IS_WATER_FACTOR_DISADVANTAGED] ? - properties[constants.IS_WATER_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_WATER_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_WATER_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_WATER_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_WATER_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_WATER_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, { - id: 'work-dev', + id: "work-dev", titleText: intl.formatMessage(EXPLORE_COPY.SIDE_PANEL_CATEGORY.WORK_DEV), indicators: [lingIso, lowMedInc, poverty, unemploy], socioEcIndicators: [highSchool], isDisadvagtaged: properties[constants.IS_WORKFORCE_FACTOR_DISADVANTAGED] ? - properties[constants.IS_WORKFORCE_FACTOR_DISADVANTAGED] : null, - isExceed1MoreBurden: properties[constants.IS_WORKFORCE_EXCEED_ONE_OR_MORE_INDICATORS] ? - properties[constants.IS_WORKFORCE_EXCEED_ONE_OR_MORE_INDICATORS] : null, - isExceedBothSocioBurdens: properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS] ? - properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS] : null, + properties[constants.IS_WORKFORCE_FACTOR_DISADVANTAGED] : + null, + isExceed1MoreBurden: properties[ + constants.IS_WORKFORCE_EXCEED_ONE_OR_MORE_INDICATORS + ] ? + properties[constants.IS_WORKFORCE_EXCEED_ONE_OR_MORE_INDICATORS] : + null, + isExceedBothSocioBurdens: properties[ + constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS + ] ? + properties[constants.IS_WORKFORCE_EXCEED_BOTH_SOCIO_INDICATORS] : + null, }, ]; - /** * Modify the category array depending on the sidePanelState field. This field comes from the backend * and is called UI_EXP. @@ -705,7 +987,9 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { */ if (sidePanelState === constants.SIDE_PANEL_STATE_VALUES.PUERTO_RICO) { // Allow all categories except health burdens: - categories = categories.filter((category) => category.id !== 'health-burdens'); + categories = categories.filter( + (category) => category.id !== "health-burdens", + ); // Re-define which burdens show up for each category: @@ -736,12 +1020,11 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { if (sidePanelState === constants.SIDE_PANEL_STATE_VALUES.ISLAND_AREAS) { // For Island Areas - only show workforce dev category - categories = categories.filter((category) => category.id === 'work-dev'); + categories = categories.filter((category) => category.id === "work-dev"); // For Island Areas - remove the linguistic Isolation categories[0].indicators = [lowMedInc, unemploy, poverty]; } - /** * Create the AccoridionItems by mapping over the categories array. In this array we define the * various indicators for a specific category. This is an array which then maps over the @@ -758,14 +1041,21 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { Casting 'h4' as const because it needs to be a heading type as specified HeadingLevel. */ - headingLevel: 'h4' as const, + headingLevel: "h4" as const, - title: , + title: ( + + ), content: ( <> {/* Indicators - filters then map */} {category.indicators - .filter(indicatorFilter(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HIST_UNDERINVEST)) + .filter( + indicatorFilter(EXPLORE_COPY.SIDE_PANEL_INDICATORS.HIST_UNDERINVEST), + ) .map((indicator: any, index: number) => { return ; })} @@ -783,21 +1073,24 @@ const AreaDetail = ({properties}: IAreaDetailProps) => { {/* socioeconomic indicators */} {category.socioEcIndicators.map((indicator: any, index: number) => { - return ; + return ( + + ); })} - ), expanded: false, })); return ( -