Skip to content

Commit abe63d9

Browse files
authored
Change All Programs Total key format (#422)
* Change All Programs Total key format * Update CHANGELOG.md
1 parent f99ae0f commit abe63d9

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1616
### Changed
1717
- Add comma to separate integer columns in Title I [#418](https://github.com/policy-design-lab/pdl-frontend/issues/418)
1818
- Reduced bottom marge for issue briefs on the Issue/White Paper page [#425](https://github.com/policy-design-lab/pdl-frontend/issues/425)
19+
- Change All Programs Total key format [#421](https://github.com/policy-design-lab/pdl-frontend/issues/421)
1920

2021
## [1.11.0] - 2025-07-31
2122

src/components/LandingPageMapTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default function LandingPageMapTab({
139139
let cropTotal = "";
140140
let snapTotal = "";
141141
if (cur !== undefined) {
142-
allProgramTotal = cur["18-22 All Programs Total"];
142+
allProgramTotal = cur["2018-2022 All Programs Total"];
143143
titleITotal = cur["Title I Total"];
144144
titleIITotal = cur["Title II Total"];
145145
cropTotal = cur["Crop Insurance Total"];

src/components/LandingPageProgramMap.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const MapChart = (props) => {
4949
});
5050
switch (title) {
5151
case "All Programs":
52-
searchKey = "18-22 All Programs Total";
52+
searchKey = "2018-2022 All Programs Total";
5353
color1 = "#FFF9D8";
5454
color2 = "#E1F2C4";
5555
color3 = "#9FD9BA";
@@ -161,7 +161,7 @@ const MapChart = (props) => {
161161
if (title === "All Programs") {
162162
records = allPrograms.filter((s) => s.State === cur.id);
163163
records.forEach((record) => {
164-
total += record["18-22 All Programs Total"];
164+
total += record["2018-2022 All Programs Total"];
165165
});
166166
} else {
167167
records = summary.filter((s) => s.State === cur.id && s.Title === title);

src/components/LandingPageTotalMap.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ const LandingPageTotalMap = ({
258258
if (!allPrograms || !summary) return 0;
259259
if (selectedPrograms.includes("All Programs")) {
260260
const stateProgram = allPrograms.find((s) => s.State === state);
261-
return stateProgram ? stateProgram["18-22 All Programs Total"] : 0;
261+
return stateProgram ? stateProgram["2018-2022 All Programs Total"] : 0;
262262
}
263263
return selectedPrograms.reduce((total, program) => {
264264
const programTotal = summary
@@ -273,7 +273,7 @@ const LandingPageTotalMap = ({
273273
if (selectedPrograms.includes("All Programs")) {
274274
return allStates.reduce((total, state) => {
275275
const stateProgram = allPrograms.find((s) => s.State === state.id);
276-
return total + (stateProgram?.["18-22 All Programs Total"] || 0);
276+
return total + (stateProgram?.["2018-2022 All Programs Total"] || 0);
277277
}, 0);
278278
}
279279
return allStates.reduce((total, state) => {
@@ -337,7 +337,7 @@ const LandingPageTotalMap = ({
337337
const hasData = allStates.some((state) => {
338338
setSelectedPrograms((prev) => [...prev]);
339339
const stateProgram = allPrograms.find((s) => s.State === state.id);
340-
return stateProgram && stateProgram["18-22 All Programs Total"] > 0;
340+
return stateProgram && stateProgram["2018-2022 All Programs Total"] > 0;
341341
});
342342
if (hasData) {
343343
setIsDataReady(true);

src/utils/legendConfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"18-22 All Programs Total": [5000000000, 10000000000, 30000000000, 40000000000],
2+
"2018-2022 All Programs Total": [5000000000, 10000000000, 30000000000, 40000000000],
33
"Crop Insurance Total":[0, 500000000, 1000000000, 5000000000],
44
"totalNetFarmerBenefit": [0, 250000000, 750000000, 2000000000],
55
"Title I Total":[50000000, 300000000, 600000000, 2000000000],

0 commit comments

Comments
 (0)