diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ae81e9..15978f8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Add comma to separate integer columns in Title I [#418](https://github.com/policy-design-lab/pdl-frontend/issues/418) - Reduced bottom marge for issue briefs on the Issue/White Paper page [#425](https://github.com/policy-design-lab/pdl-frontend/issues/425) +- Change All Programs Total key format [#421](https://github.com/policy-design-lab/pdl-frontend/issues/421) ## [1.11.0] - 2025-07-31 diff --git a/src/components/LandingPageMapTab.tsx b/src/components/LandingPageMapTab.tsx index 3f0a5bc3..49c3a200 100644 --- a/src/components/LandingPageMapTab.tsx +++ b/src/components/LandingPageMapTab.tsx @@ -139,7 +139,7 @@ export default function LandingPageMapTab({ let cropTotal = ""; let snapTotal = ""; if (cur !== undefined) { - allProgramTotal = cur["18-22 All Programs Total"]; + allProgramTotal = cur["2018-2022 All Programs Total"]; titleITotal = cur["Title I Total"]; titleIITotal = cur["Title II Total"]; cropTotal = cur["Crop Insurance Total"]; diff --git a/src/components/LandingPageProgramMap.tsx b/src/components/LandingPageProgramMap.tsx index c8234610..6e9783a4 100644 --- a/src/components/LandingPageProgramMap.tsx +++ b/src/components/LandingPageProgramMap.tsx @@ -49,7 +49,7 @@ const MapChart = (props) => { }); switch (title) { case "All Programs": - searchKey = "18-22 All Programs Total"; + searchKey = "2018-2022 All Programs Total"; color1 = "#FFF9D8"; color2 = "#E1F2C4"; color3 = "#9FD9BA"; @@ -161,7 +161,7 @@ const MapChart = (props) => { if (title === "All Programs") { records = allPrograms.filter((s) => s.State === cur.id); records.forEach((record) => { - total += record["18-22 All Programs Total"]; + total += record["2018-2022 All Programs Total"]; }); } else { records = summary.filter((s) => s.State === cur.id && s.Title === title); diff --git a/src/components/LandingPageTotalMap.tsx b/src/components/LandingPageTotalMap.tsx index 34f2d792..92bf555f 100644 --- a/src/components/LandingPageTotalMap.tsx +++ b/src/components/LandingPageTotalMap.tsx @@ -258,7 +258,7 @@ const LandingPageTotalMap = ({ if (!allPrograms || !summary) return 0; if (selectedPrograms.includes("All Programs")) { const stateProgram = allPrograms.find((s) => s.State === state); - return stateProgram ? stateProgram["18-22 All Programs Total"] : 0; + return stateProgram ? stateProgram["2018-2022 All Programs Total"] : 0; } return selectedPrograms.reduce((total, program) => { const programTotal = summary @@ -273,7 +273,7 @@ const LandingPageTotalMap = ({ if (selectedPrograms.includes("All Programs")) { return allStates.reduce((total, state) => { const stateProgram = allPrograms.find((s) => s.State === state.id); - return total + (stateProgram?.["18-22 All Programs Total"] || 0); + return total + (stateProgram?.["2018-2022 All Programs Total"] || 0); }, 0); } return allStates.reduce((total, state) => { @@ -337,7 +337,7 @@ const LandingPageTotalMap = ({ const hasData = allStates.some((state) => { setSelectedPrograms((prev) => [...prev]); const stateProgram = allPrograms.find((s) => s.State === state.id); - return stateProgram && stateProgram["18-22 All Programs Total"] > 0; + return stateProgram && stateProgram["2018-2022 All Programs Total"] > 0; }); if (hasData) { setIsDataReady(true); diff --git a/src/utils/legendConfig.json b/src/utils/legendConfig.json index 86a9d402..6cfef5f3 100644 --- a/src/utils/legendConfig.json +++ b/src/utils/legendConfig.json @@ -1,5 +1,5 @@ { - "18-22 All Programs Total": [5000000000, 10000000000, 30000000000, 40000000000], + "2018-2022 All Programs Total": [5000000000, 10000000000, 30000000000, 40000000000], "Crop Insurance Total":[0, 500000000, 1000000000, 5000000000], "totalNetFarmerBenefit": [0, 250000000, 750000000, 2000000000], "Title I Total":[50000000, 300000000, 600000000, 2000000000],