From 566430e7ac3d67a1f12f1af4778ebc3c11aec056 Mon Sep 17 00:00:00 2001 From: Pengyin Shan <92752107+pengyin-shan@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:48:11 -0500 Subject: [PATCH 1/7] release 1.0.5 (#319) --- CHANGELOG.md | 3 ++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eccf340..fd2b936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [1.0.4] - 2024-08-16 +## [1.0.5] - 2024-08-28 ### Added - Added the CSP session to the IRA page [#299](https://github.com/policy-design-lab/pdl-frontend/issues/299) @@ -286,6 +286,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Map data json [#12](https://github.com/policy-design-lab/pdl-frontend/issues/12) - Final landing page changes for initial milestone [#15](https://github.com/policy-design-lab/pdl-frontend/issues/15) +[1.0.5]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.4...1.0.5 [1.0.4]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.3...1.0.4 [1.0.3]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.2...1.0.3 [1.0.2]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.1...1.0.2 diff --git a/package-lock.json b/package-lock.json index f2c263d..2843d21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "policy-design-lab", - "version": "1.0.4", + "version": "1.0.5", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 59e3653..1bfd9b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "policy-design-lab", - "version": "1.0.4", + "version": "1.0.5", "description": "the front end of policy design lab", "repository": "https://github.com/policy-design-lab/pdl-frontend", "main": "src/app.tsx", From f4b07cf8fbc84c3b844da0b5da6b0b4b1ed4bbb3 Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Tue, 24 Sep 2024 15:44:19 -0500 Subject: [PATCH 2/7] #320, #322 update CRP, ACRP and RCPP to fit the new data structure --- src/components/ProgramDrawer.tsx | 36 ++++++++++-- src/components/acep/ACEPTable.tsx | 25 ++++----- src/components/acep/ACEPTotalMap.tsx | 15 +++-- src/components/crp/CRPTotalMap.tsx | 23 ++++---- src/components/crp/CRPTotalTable.tsx | 6 +- src/components/crp/CategoryMap.tsx | 77 ++++++++++++++------------ src/components/crp/CategoryTable.tsx | 40 +++++++------ src/components/rcpp/RCPPTotalMap.tsx | 7 +-- src/components/rcpp/RCPPTotalTable.tsx | 28 ++-------- src/pages/ACEPPage.tsx | 47 ++++++---------- src/pages/CRPPage.tsx | 44 +++++++-------- src/pages/RCPPPage.tsx | 30 ++-------- src/utils/legendConfig.json | 10 ++-- 13 files changed, 187 insertions(+), 201 deletions(-) diff --git a/src/components/ProgramDrawer.tsx b/src/components/ProgramDrawer.tsx index 1078db7..ed6d928 100644 --- a/src/components/ProgramDrawer.tsx +++ b/src/components/ProgramDrawer.tsx @@ -475,8 +475,8 @@ function CRPCheckboxList({ setCRPChecked, setShowPopUp, zeroCategory }) { const CRPList = [ "Total CRP", - "Total General Sign-up", - "Total Continuous Sign-Up", + "General Sign-up", + "Continuous Sign-up", "CREP Only", "Continuous Non-CREP", "Farmable Wetland", @@ -512,10 +512,10 @@ function CRPCheckboxList({ setCRPChecked, setShowPopUp, zeroCategory }) { ); } - if (category !== "CREP Only" && category !== "Continuous Non-CREP" && category !== "Farmable Wetland") { + if (category === "Total CRP") { return ( - + ); } + if (category === "General Sign-up" || category === "Continuous Sign-up" || category === "Grassland") { + return ( + + + + + + + + + ); + } return ( diff --git a/src/components/acep/ACEPTable.tsx b/src/components/acep/ACEPTable.tsx index 9a5bf2c..c5d7d84 100644 --- a/src/components/acep/ACEPTable.tsx +++ b/src/components/acep/ACEPTable.tsx @@ -31,13 +31,9 @@ function AcepProgramTable({ state = sValue.name; } }); - let programData = null; - programData = stateData.programs.filter((p) => { - return p.programName.toString() === program; - }); hashmap[state] = {}; attributes.forEach((attribute) => { - const attributeData = programData[0][attribute]; + const attributeData = stateData[attribute]; hashmap[state][attribute] = attributeData; }); }); @@ -48,7 +44,7 @@ function AcepProgramTable({ Object.entries(hashmap[s]).forEach(([attr, value]) => { if (attr.includes("Percentage")) { newRecord[attr] = `${value.toString()}%`; - } else if (attr === "totalAcres" || attr === "totalContracts") { + } else if (attr === "totalAreaInAcres" || attr === "totalContracts") { newRecord[attr] = `${ value.toLocaleString(undefined, { minimumFractionDigits: 2 }).toString().split(".")[0] }`; @@ -65,7 +61,8 @@ function AcepProgramTable({ attributes.forEach((attribute) => { let sortMethod = compareWithDollarSign; if (attribute.includes("Percentage")) sortMethod = compareWithPercentSign; - if (attribute.includes("totalContracts") || attribute.includes("totalAcres")) sortMethod = compareWithNumber; + if (attribute.includes("totalContracts") || attribute.includes("totalAreaInAcres")) + sortMethod = compareWithNumber; let attrName = attribute .replace(/([A-Z])/g, " $1") .trim() @@ -73,8 +70,8 @@ function AcepProgramTable({ .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) .join(" ") .toUpperCase(); - if (attribute === "assistancePaymentInDollars") attrName = "Total Payment in Dollars".toUpperCase(); - if (attribute === "assistancePaymentInPercentageNationwide") + if (attribute === "totalPaymentInDollars") attrName = "Total Payment in Dollars".toUpperCase(); + if (attribute === "totalPaymentInPercentageNationwide") attrName = "Total Payment In Percentage Nationwide".toUpperCase(); const json = { Header: attrName, @@ -84,12 +81,12 @@ function AcepProgramTable({ columnPrep.push(json); }); const columns = React.useMemo(() => columnPrep, []); - const paymentsIndex = columns.findIndex((c) => c.accessor === "assistancePaymentInDollars"); - const acresIndex = columns.findIndex((c) => c.accessor === "totalAcres"); + const paymentsIndex = columns.findIndex((c) => c.accessor === "totalPaymentInDollars"); + const acresIndex = columns.findIndex((c) => c.accessor === "totalAreaInAcres"); const contractsIndex = columns.findIndex((c) => c.accessor === "totalContracts"); - const paymentsPercentageIndex = columns.findIndex((c) => c.accessor === "assistancePaymentInPercentageNationwide"); - const contractsPercentageIndex = columns.findIndex((c) => c.accessor === "contractsInPercentageNationwide"); - const acresPercentageIndex = columns.findIndex((c) => c.accessor === "acresInPercentageNationwide"); + const paymentsPercentageIndex = columns.findIndex((c) => c.accessor === "totalPaymentInPercentageNationwide"); + const contractsPercentageIndex = columns.findIndex((c) => c.accessor === "totalContractsInPercentageNationwide"); + const acresPercentageIndex = columns.findIndex((c) => c.accessor === "totalAreaInPercentageNationwide"); const Styles = styled.div` padding: 0; margin: 0; diff --git a/src/components/acep/ACEPTotalMap.tsx b/src/components/acep/ACEPTotalMap.tsx index 4b4329d..09f61b7 100644 --- a/src/components/acep/ACEPTotalMap.tsx +++ b/src/components/acep/ACEPTotalMap.tsx @@ -43,9 +43,9 @@ const MapChart = (props) => { if (record === undefined || record.length === 0) { return null; } - const totalPaymentInDollars = record.programs[0].assistancePaymentInDollars; - const assistancePaymentInPercentageNationwide = - record.programs[0].assistancePaymentInPercentageNationwide; + const totalPaymentInDollars = record.totalPaymentInDollars; + const totalPaymentInPercentageNationwide = + record.totalPaymentInPercentageNationwide; const hoverContent = (
@@ -64,8 +64,8 @@ const MapChart = (props) => { PCT. Nationwide: - {assistancePaymentInPercentageNationwide - ? `${assistancePaymentInPercentageNationwide} %` + {totalPaymentInPercentageNationwide + ? `${totalPaymentInPercentageNationwide} %` : "0%"} @@ -171,9 +171,8 @@ const ACEPTotalMap = ({ const quantizeArray: number[] = []; const zeroPoints = []; statePerformance[year].forEach((value) => { - const programRecord = value.programs; - const ACur = programRecord.find((s) => s.programName === program); - const key = "assistancePaymentInDollars"; + const ACur = value; + const key = "totalPaymentInDollars"; quantizeArray.push(ACur[key]); ACur[key] === 0 && zeroPoints.push(value.state); return null; diff --git a/src/components/crp/CRPTotalMap.tsx b/src/components/crp/CRPTotalMap.tsx index 3dbe351..318cd25 100644 --- a/src/components/crp/CRPTotalMap.tsx +++ b/src/components/crp/CRPTotalMap.tsx @@ -44,9 +44,9 @@ const MapChart = (props) => { if (record === undefined || record.length === 0) { return null; } - const totalPaymentInDollars = record.programs[0].totalPaymentInDollars; + const totalPaymentInDollars = record.totalPaymentInDollars; const totalPaymentInPercentageNationwide = - record.programs[0].totalPaymentInPercentageNationwide; + record.totalPaymentInPercentageNationwide; const hoverContent = (
@@ -171,17 +171,18 @@ const CRPTotalMap = ({ const [content, setContent] = useState(""); const quantizeArray: number[] = []; const zeroPoints = []; - statePerformance[year].forEach((value) => { - const programRecord = value.programs; - const ACur = programRecord.find((s) => s.programName === program); - let key = getValueFromAttrDollar(ACur, attribute); - key = key !== "" ? key : attribute; - quantizeArray.push(ACur[key]); - ACur[key] === 0 && zeroPoints.push(value.state); - return null; - }); + // statePerformance[year].forEach((value) => { + // const programRecord = value.programs; + // const ACur = programRecord.find((s) => s.programName === program); + // let key = getValueFromAttrDollar(ACur, attribute); + // key = key !== "" ? key : attribute; + // quantizeArray.push(ACur[key]); + // ACur[key] === 0 && zeroPoints.push(value.state); + // return null; + // }); const category = "Total CRP"; const years = "2018-2022"; + statePerformance[year].forEach((value) => quantizeArray.push(value.totalPaymentInDollars)); const maxValue = Math.max(...quantizeArray); const mapColor = ["#F0F9E8", "#BAE4BC", "#7BCCC4", "#43A2CA", "#0868AC"]; const customScale = legendConfig[category]; diff --git a/src/components/crp/CRPTotalTable.tsx b/src/components/crp/CRPTotalTable.tsx index b72d80c..785d6ce 100644 --- a/src/components/crp/CRPTotalTable.tsx +++ b/src/components/crp/CRPTotalTable.tsx @@ -141,7 +141,7 @@ function App({ // eslint-disable-next-line no-restricted-syntax statePerformance[year].forEach((value) => { - const totalCrp = value.programs.find((s) => s.programName === "Total CRP"); + const totalCrp = value; let stateName; stateCodes.forEach((sValue) => { if (sValue.code.toUpperCase() === value.state.toUpperCase()) { @@ -159,7 +159,9 @@ function App({ .toLocaleString(undefined, { minimumFractionDigits: 0 }) .toString()}`, noFarm: `${totalCrp.totalFarms.toLocaleString(undefined, { minimumFractionDigits: 0 }).toString()}`, - totAcre: `${totalCrp.totalAcre.toLocaleString(undefined, { minimumFractionDigits: 0 }).toString()}` + totAcre: `${totalCrp.totalAreaInAcres + .toLocaleString(undefined, { minimumFractionDigits: 0 }) + .toString()}` }; }; crpTableData.push(newRecord()); diff --git a/src/components/crp/CategoryMap.tsx b/src/components/crp/CategoryMap.tsx index 25918c3..aac0021 100644 --- a/src/components/crp/CategoryMap.tsx +++ b/src/components/crp/CategoryMap.tsx @@ -50,27 +50,29 @@ const MapChart = (props) => { let DCur = {}; let ECur = {}; let FCur = {}; - record.programs.forEach((value) => { - if (value.programName === "Total General Sign-Up") { + record.subPrograms.forEach((value) => { + if (value.subProgramName === "General Sign-up") { ACur = value; - } else if (value.programName === "Total Continuous Sign-Up") { + } else if (value.subProgramName === "Continuous Sign-up") { BCur = value; - value.subPrograms.forEach((subValue) => { - if (subValue.programName === "CREP Only") { - CCur = subValue; - } else if (subValue.programName === "Continuous Non-CREP") { - DCur = subValue; - } else if (subValue.programName === "Farmable Wetland") { - ECur = subValue; - } - }); - } else if (value.programName === "Grassland") { + if (BCur.subSubPrograms !== undefined) { + BCur.subSubPrograms.forEach((subSubValue) => { + if (subSubValue.subSubProgramName === "CREP Only") { + CCur = subSubValue; + } else if (subSubValue.subSubProgramName === "Continuous Non-CREP") { + DCur = subSubValue; + } else if (subSubValue.subSubProgramName === "Farmable Wetland") { + ECur = subSubValue; + } + }); + } + } else if (value.subProgramName === "Grassland") { FCur = value; } }); - if (category === "Total General Sign-Up") { + if (category === "General Sign-up") { categoryRecord = ACur; - } else if (category === "Total Continuous Sign-Up") { + } else if (category === "Continuous Sign-up") { categoryRecord = BCur; } else if (category === "CREP Only") { categoryRecord = CCur; @@ -81,6 +83,12 @@ const MapChart = (props) => { } else { categoryRecord = FCur; } + if (categoryRecord === undefined || Object.values(categoryRecord).length === 0) { + categoryRecord = { + totalPaymentInDollars: 0, + totalPaymentInPercentageNationwide: 0 + }; + } const categoryPayment = categoryRecord.totalPaymentInDollars; const nationwidePercentage = categoryRecord.totalPaymentInPercentageNationwide; const hoverContent = ( @@ -205,28 +213,29 @@ const CategoryMap = ({ const zeroPoints = []; statePerformance[year].forEach((value) => { - const programRecord = value.programs; + const programRecord = value.subPrograms; let ACur = {}; - if ( - category === "Total General Sign-Up" || - category === "Total Continuous Sign-Up" || - category === "Grassland" - ) { - ACur = programRecord.find((s) => s.programName === category); + if (category === "General Sign-up" || category === "Continuous Sign-up" || category === "Grassland") { + ACur = programRecord.find((s) => s.subProgramName === category); } else if (category === "CREP Only" || category === "Continuous Non-CREP" || category === "Farmable Wetland") { - const contSingUp = programRecord.find((s) => s.programName === "Total Continuous Sign-Up"); - const subPrograms = contSingUp.subPrograms; - title = `CRP Total Continuous, ${category} from ${year}`; - subPrograms.forEach((subValue) => { - if (subValue.programName === category) { - ACur = subValue; - } - }); + const contSingUp = programRecord.find((s) => s.subProgramName === "Continuous Sign-up"); + if (contSingUp) { + const subSubPrograms = contSingUp.subSubPrograms; + title = `CRP Continuous Sign-up, ${category} from ${year}`; + + subSubPrograms.forEach((subValue) => { + if (subValue.subSubProgramName === category) { + ACur = subValue; + } + }); + } + } + if (ACur) { + let key = getValueFromAttrDollar(ACur, attribute); + key = key !== "" ? key : attribute; + quantizeArray.push(ACur[key]); + ACur[key] === 0 && zeroPoints.push(value.state); } - let key = getValueFromAttrDollar(ACur, attribute); - key = key !== "" ? key : attribute; - quantizeArray.push(ACur[key]); - ACur[key] === 0 && zeroPoints.push(value.state); return null; }); const years = "2018-2022"; diff --git a/src/components/crp/CategoryTable.tsx b/src/components/crp/CategoryTable.tsx index 92455f6..3088103 100644 --- a/src/components/crp/CategoryTable.tsx +++ b/src/components/crp/CategoryTable.tsx @@ -141,37 +141,35 @@ function App({ }): JSX.Element { const crpTableData: any[] = []; statePerformance[year].forEach((value) => { - const totalCrp = value.programs.find((s) => s.programName === "Total CRP"); + const totalCrp = value; let categoryCrp; - if ( - category === "Total General Sign-Up" || - category === "Total Continuous Sign-Up" || - category === "Grassland" - ) { - categoryCrp = value.programs.find((s) => s.programName === category); + if (category === "General Sign-up" || category === "Continuous Sign-up" || category === "Grassland") { + categoryCrp = value.subPrograms.find((s) => s.subProgramName === category); } else if (category === "CREP Only" || category === "Continuous Non-CREP" || category === "Farmable Wetland") { - const contSingUp = value.programs.find((s) => s.programName === "Total Continuous Sign-Up"); - const subPrograms = contSingUp.subPrograms; - subPrograms.forEach((subValue) => { - if (subValue.programName === category) { - categoryCrp = subValue; - } - }); + const contSingUp = value.subPrograms.find((s) => s.subProgramName === "Continuous Sign-up"); + if (contSingUp) { + const subSubPrograms = contSingUp.subSubPrograms; + subSubPrograms.forEach((subValue) => { + if (subValue.subSubProgramName === category) { + categoryCrp = subValue; + } + }); + } } let stateName; - // let percentageValue = 0; - // if (Number.parseInt(totalCrp.totalPaymentInDollars, 10) > 0) { - // percentageValue = - // (Number.parseInt(categoryCrp.totalPaymentInDollars, 10) / Number.parseInt(totalCrp.totalPaymentInDollars, 10)) * - // 100; - // } - stateCodes.forEach((sValue) => { if (sValue.code.toUpperCase() === value.state.toUpperCase()) { stateName = sValue.name; } }); + if (categoryCrp === undefined) { + categoryCrp = { + totalPaymentInDollars: 0, + totalPaymentInPercentageWithinState: 0, + totalPaymentInPercentageNationwide: 0 + }; + } const newRecord = () => { return { state: stateName, diff --git a/src/components/rcpp/RCPPTotalMap.tsx b/src/components/rcpp/RCPPTotalMap.tsx index 9ae14cb..03a43cf 100644 --- a/src/components/rcpp/RCPPTotalMap.tsx +++ b/src/components/rcpp/RCPPTotalMap.tsx @@ -45,10 +45,10 @@ const MapChart = (props) => { return null; } // the totalPaymentInDolloars in RCPP is financial assistancePaymentInDollars - const totalPaymentInDollars = record.programs[0].assistancePaymentInDollars; + const totalPaymentInDollars = record.totalPaymentInDollars; // since the total is financial assistance, the percentage should also be financial one const totalPaymentInPercentageNationwide = - record.programs[0].assistancePaymentInPercentageNationwide; + record.totalPaymentInPercentageNationwide; const hoverContent = (
@@ -174,8 +174,7 @@ const RCPPTotalMap = ({ const quantizeArray: number[] = []; const zeroPoints = []; statePerformance[year].forEach((value) => { - const programRecord = value.programs; - const ACur = programRecord.find((s) => s.programName === program); + const ACur = value; let key = getValueFromAttrDollar(ACur, attribute); key = key !== "" ? key : attribute; quantizeArray.push(ACur[key]); diff --git a/src/components/rcpp/RCPPTotalTable.tsx b/src/components/rcpp/RCPPTotalTable.tsx index 9656b4b..3a741b0 100644 --- a/src/components/rcpp/RCPPTotalTable.tsx +++ b/src/components/rcpp/RCPPTotalTable.tsx @@ -140,7 +140,7 @@ function App({ // eslint-disable-next-line no-restricted-syntax statePerformance[year].forEach((value) => { - const totalRcpp = value.programs.find((s) => s.programName === "RCPP"); + const totalRcpp = value; let stateName; stateCodes.forEach((sValue) => { if (sValue.code.toUpperCase() === value.state.toUpperCase()) { @@ -156,29 +156,13 @@ function App({ .toString() .split(".")[0] }`, - percentage: `${totalRcpp.assistancePaymentInPercentageNationwide.toString()}%`, + percentage: `${totalRcpp.totalPaymentInPercentageNationwide.toString()}%`, noContract: `${totalRcpp.totalContracts .toLocaleString(undefined, { minimumFractionDigits: 0 }) .toString()}`, - totAcre: `${totalRcpp.totalAcres.toLocaleString(undefined, { minimumFractionDigits: 0 }).toString()}`, - finPayment: `$${ - totalRcpp.assistancePaymentInDollars - .toLocaleString(undefined, { minimumFractionDigits: 2 }) - .toString() - .split(".")[0] - }`, - reimbursePayment: `$${ - totalRcpp.reimbursePaymentInDollars - .toLocaleString(undefined, { minimumFractionDigits: 2 }) - .toString() - .split(".")[0] - }`, - techPayment: `$${ - totalRcpp.techPaymentInDollars - .toLocaleString(undefined, { minimumFractionDigits: 2 }) - .toString() - .split(".")[0] - }` + totAcre: `${totalRcpp.totalAreaInAcres + .toLocaleString(undefined, { minimumFractionDigits: 0 }) + .toString()}` }; }; rcppTableData.push(newRecord()); @@ -207,7 +191,7 @@ function App({ TOTAL RCPP BENEFITS ), - accessor: "finPayment", + accessor: "rcppBenefit", sortType: compareWithDollarSign, Cell: function styleCells(row) { return
{row.value}
; diff --git a/src/pages/ACEPPage.tsx b/src/pages/ACEPPage.tsx index 7c2886a..cccd0c1 100644 --- a/src/pages/ACEPPage.tsx +++ b/src/pages/ACEPPage.tsx @@ -30,10 +30,7 @@ export default function ACEPPage(): JSX.Element { const zeroCategory = []; let totalACEPPaymentInDollars = 0; let totalContracts = 0; - let totalAcres = 0; - const assistancePaymentInDollars = 0; - const reimbursePaymentInDollars = 0; - const techPaymentInDollars = 0; + let totalAreaInAcres = 0; React.useEffect(() => { const allstates_url = `${config.apiUrl}/states`; @@ -65,21 +62,15 @@ export default function ACEPPage(): JSX.Element { } }; const processData = (chartData) => { - if (chartData.programs === undefined) return; - const cur1 = chartData.programs.find((s) => s.programName === "ACEP"); - totalACEPPaymentInDollars = cur1.assistancePaymentInDollars; + if (chartData === undefined) return; + const cur1 = chartData; + totalACEPPaymentInDollars = cur1.totalPaymentInDollars; setTotalAcep(totalACEPPaymentInDollars); if (totalACEPPaymentInDollars === 0) zeroCategory.push("ACEP"); totalContracts = cur1.totalContracts; if (totalContracts === 0) zeroCategory.push("Total Contracts"); - totalAcres = cur1.totalAcre; - if (totalAcres === 0) zeroCategory.push("Total Acres"); - // assistancePaymentInDollars = cur1.assistancePaymentInDollars; - // if (assistancePaymentInDollars === 0) zeroCategory.push("Assistance Payment"); - // reimbursePaymentInDollars = cur1.reimbursePaymentInDollars; - // if (reimbursePaymentInDollars === 0) zeroCategory.push("Reimburse Payment"); - // techPaymentInDollars = cur1.techPaymentInDollars; - // if (techPaymentInDollars === 0) zeroCategory.push("Tech Payment"); + totalAreaInAcres = cur1.totalAreaInAcres; + if (totalAreaInAcres === 0) zeroCategory.push("Total Acres"); setZeroCategories(zeroCategory); }; function prepData(program, subprogram, data, dataYear) { @@ -87,20 +78,18 @@ export default function ACEPPage(): JSX.Element { const originalData: Record[] = []; data[dataYear].forEach((stateData) => { const state = stateData.state; - const programData = stateData.programs.filter((p) => { - return p.programName.toString() === program; - }); + const programData = stateData; organizedData.push({ state, - acres: programData[0].totalAcres, - payments: programData[0].assistancePaymentInDollars, - contracts: programData[0].totalContracts + acres: programData.totalAreaInAcres, + payments: programData.totalPaymentInDollars, + contracts: programData.totalContracts }); originalData.push({ state, - acres: programData[0].totalAcres, - payments: programData[0].assistancePaymentInDollars, - contracts: programData[0].totalContracts + acres: programData.totalAreaInAcres, + payments: programData.totalPaymentInDollars, + contracts: programData.totalContracts }); }); return [organizedData, originalData]; @@ -226,12 +215,12 @@ export default function ACEPPage(): JSX.Element { tableTitle="Total ACEP Benefits, Acres and No. of Contracts" program="ACEP" attributes={[ - "assistancePaymentInDollars", - "assistancePaymentInPercentageNationwide", - "totalAcres", - "acresInPercentageNationwide", + "totalPaymentInDollars", + "totalPaymentInPercentageNationwide", + "totalAreaInAcres", + "totalAreaInPercentageNationwide", "totalContracts", - "contractsInPercentageNationwide" + "totalContractsInPercentageNationwide" ]} skipColumns={[]} stateCodes={stateCodesArray} diff --git a/src/pages/CRPPage.tsx b/src/pages/CRPPage.tsx index 49f2431..bec5a7d 100644 --- a/src/pages/CRPPage.tsx +++ b/src/pages/CRPPage.tsx @@ -62,35 +62,33 @@ export default function CRPPage(): JSX.Element { }, []); const processData = (chartData) => { - if (chartData.programs === undefined) return; + if (chartData.subPrograms === undefined) return; - const cur1 = chartData.programs.find((s) => s.programName === "Total CRP"); - const cur2 = chartData.programs.find((s) => s.programName === "Total General Sign-Up"); - const cur3 = chartData.programs.find((s) => s.programName === "Total Continuous"); + const cur1 = chartData.subPrograms.find((s) => s.subProgramName === "General Sign-up"); + const cur2 = chartData.subPrograms.find((s) => s.subProgramName === "Continuous Sign-up"); + const cur3 = chartData.subPrograms.find((s) => s.subProgramName === "Grassland"); let cur4; let cur5; let cur6; - const cur7 = chartData.programs.find((s) => s.programName === "Grassland"); - const subCurs = cur3.subPrograms; - + const subCurs = cur2.subSubPrograms; if (subCurs !== undefined) { subCurs.forEach((value) => { - if (value.programName === "CREP Only") { + if (value.subSubProgramName === "CREP Only") { cur4 = value; - } else if (value.programName === "Continuous Non-CREP") { + } else if (value.subSubProgramName === "Continuous Non-CREP") { cur5 = value; - } else if (value.programName === "Farmable Wetland") { + } else if (value.subSubProgramName === "Farmable Wetland") { cur6 = value; } }); - totalCRPPaymentInDollars = cur1.totalPaymentInDollars; + totalCRPPaymentInDollars = chartData.totalPaymentInDollars; setTotalCrp(totalCRPPaymentInDollars); if (totalCRPPaymentInDollars === 0) zeroCategory.push("Total CRP"); - generalSignUpPaymentInDollars = cur2.totalPaymentInDollars; - if (generalSignUpPaymentInDollars === 0) zeroCategory.push("Total General Sign-Up"); - continuousSingUpPaymentInDollars = cur3.totalPaymentInDollars; - if (continuousSingUpPaymentInDollars === 0) zeroCategory.push("Total Continuous"); + generalSignUpPaymentInDollars = cur1.totalPaymentInDollars; + if (generalSignUpPaymentInDollars === 0) zeroCategory.push("General Sign-up"); + continuousSingUpPaymentInDollars = cur2.totalPaymentInDollars; + if (continuousSingUpPaymentInDollars === 0) zeroCategory.push("Continuous Sign-up"); setTotalSub(continuousSingUpPaymentInDollars); crepPaymentInDollars = cur4.totalPaymentInDollars; if (crepPaymentInDollars === 0) zeroCategory.push("CREP Only"); @@ -98,15 +96,15 @@ export default function CRPPage(): JSX.Element { if (nocCrepPaymentInDollars === 0) zeroCategory.push("Continuous Non-CREP"); wetlandPaymentInDollars = cur6.totalPaymentInDollars; if (wetlandPaymentInDollars === 0) zeroCategory.push("Farmable Wetland"); - grasslandPyamentInDollars = cur7.totalPaymentInDollars; + grasslandPyamentInDollars = cur3.totalPaymentInDollars; if (grasslandPyamentInDollars === 0) zeroCategory.push("Grassland"); if (zeroCategory.length > 0) setZeroCategories(zeroCategory); else setZeroCategories(["None"]); setTotalChartData([ - { name: "Total General Sign-Up", value: generalSignUpPaymentInDollars, color: "#2F7164" }, - { name: "Total Continuous", value: continuousSingUpPaymentInDollars, color: "#9CBAB4" }, + { name: "General Sign-up", value: generalSignUpPaymentInDollars, color: "#2F7164" }, + { name: "Continuous Sign-up", value: continuousSingUpPaymentInDollars, color: "#9CBAB4" }, { name: "Grassland", value: grasslandPyamentInDollars, color: "#CDDBD8" } ]); @@ -123,7 +121,7 @@ export default function CRPPage(): JSX.Element { {Object.keys(stateCodesData).length > 0 && Object.keys(allStatesData).length > 0 && Object.keys(stateDistributionData).length > 0 && - zeroCategories.length > 0 ? ( + zeroCategories.length >= 0 ? ( @@ -158,7 +156,7 @@ export default function CRPPage(): JSX.Element { > { const allstates_url = `${config.apiUrl}/states`; getJsonDataFromUrl(allstates_url).then((response) => { @@ -57,30 +53,16 @@ export default function RCPPPage(): JSX.Element { }, []); const processData = (chartData) => { - if (chartData.programs === undefined) return; - - const cur1 = chartData.programs.find((s) => s.programName === "RCPP"); - + if (chartData === undefined) return; + const cur1 = chartData; totalRCPPPaymentInDollars = cur1.totalPaymentInDollars; setTotalRcpp(totalRCPPPaymentInDollars); if (totalRCPPPaymentInDollars === 0) zeroCategory.push("RCPP"); totalContracts = cur1.totalContracts; - totalAcres = cur1.totalAcres; - assistancePayments = cur1.assistancePaymentInDollars; - reimbursePayments = cur1.reimbursePaymentInDollars; - techPayments = cur1.techPaymentInDollars; - + totalAreaInAcres = cur1.totalAreaInAcres; setZeroCategories(zeroCategory); - - setTotalChartData([ - { name: "Total Financial Assistance Payments", value: assistancePayments, color: "#2F7164" }, - { name: "Total Reimbursable Payments", value: reimbursePayments, color: "#9CBAB4" }, - { name: "Total Techinical Assistance Payments", value: techPayments, color: "#CDDBD8" } - ]); - setTotalBenefit( - // total benefit should be financial assistance payment - assistancePayments.toLocaleString(undefined, { minimumFractionDigits: 2 }).toString().split(".")[0] + totalRCPPPaymentInDollars.toLocaleString(undefined, { minimumFractionDigits: 2 }).toString().split(".")[0] ); }; diff --git a/src/utils/legendConfig.json b/src/utils/legendConfig.json index 52944fa..2260c4e 100644 --- a/src/utils/legendConfig.json +++ b/src/utils/legendConfig.json @@ -63,11 +63,11 @@ "Bundles": [50000, 100000, 300000, 800000], "Total CRP": [100000, 10000000, 100000000, 500000000], - "Total General Sign-Up":[10000, 100000, 10000000, 100000000], - "Total Continuous Sign-Up":[10000, 100000, 100000000, 1000000000], - "CREP Only":[100000, 10000000, 50000000, 80000000], - "Continuous Non-CREP":[10000, 100000, 100000000, 200000000], - "Farmable Wetland":[10000, 100000, 500000, 10000000], + "General Sign-up":[10000, 100000, 10000000, 100000000], + "Continuous Sign-up":[10000, 100000, 100000000, 1000000000], + "CREP Only":[1000000, 10000000, 50000000, 80000000], + "Continuous Non-CREP":[100000, 500000, 10000000, 100000000], + "Farmable Wetland":[8000, 200000, 500000, 10000000], "Grassland-CRP":[10000, 100000, 500000, 10000000], "Total ACEP": [1000000, 5000000, 10000000, 50000000], From 023667b9ecf6052ad76139617e57cb2211a1f058 Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Wed, 25 Sep 2024 09:54:09 -0500 Subject: [PATCH 3/7] update Crop Insurance page for the new data --- .../cropinsurance/CropInsuranceMap.tsx | 9 ++++----- .../cropinsurance/CropInsuranceTable.tsx | 9 ++------- .../cropinsurance/chart/CropInsuranceBar.tsx | 19 +++++++++---------- src/pages/CropInsurancePage.tsx | 6 +++--- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/components/cropinsurance/CropInsuranceMap.tsx b/src/components/cropinsurance/CropInsuranceMap.tsx index e175a41..5d4adbb 100644 --- a/src/components/cropinsurance/CropInsuranceMap.tsx +++ b/src/components/cropinsurance/CropInsuranceMap.tsx @@ -57,10 +57,10 @@ const MapChart = ({ return null; } const key = - getValueFromAttrDollar(state.programs[0], attribute) !== "" - ? getValueFromAttrDollar(state.programs[0], attribute) + getValueFromAttrDollar(state, attribute) !== "" + ? getValueFromAttrDollar(state, attribute) : "totalNetFarmerBenefit"; - programPayment = state.programs[0][key]; + programPayment = state[key]; const hoverContent = (
@@ -199,8 +199,7 @@ const CropInsuranceMap = ({ const quantizeArray: number[] = []; const zeroPoints = []; statePerformance[year].forEach((value) => { - const programRecord = value.programs; - const ACur = programRecord.find((s) => s.programName === program); + const ACur = value; let key = getValueFromAttrDollar(ACur, attribute); key = key !== "" ? key : "totalNetFarmerBenefit"; quantizeArray.push(ACur[key]); diff --git a/src/components/cropinsurance/CropInsuranceTable.tsx b/src/components/cropinsurance/CropInsuranceTable.tsx index 96feb44..a420241 100644 --- a/src/components/cropinsurance/CropInsuranceTable.tsx +++ b/src/components/cropinsurance/CropInsuranceTable.tsx @@ -7,8 +7,7 @@ import { compareWithNumber, compareWithAlphabetic, compareWithDollarSign, - compareWithPercentSign, - sortByDollars + compareWithPercentSign } from "../shared/TableCompareFunctions"; import "../../styles/table.css"; import { ShortFormat } from "../shared/ConvertionFormats"; @@ -28,13 +27,9 @@ function CropInsuranceProgramTable({ // eslint-disable-next-line no-restricted-syntax CropInsuranceData[year].forEach((stateData) => { const state = stateData.state; - let programData = null; - programData = stateData.programs.filter((p) => { - return p.programName.toString() === program; - }); hashmap[state] = {}; attributes.forEach((attribute) => { - const attributeData = programData[0][attribute]; + const attributeData = stateData[attribute]; hashmap[state][attribute] = attributeData; }); }); diff --git a/src/components/cropinsurance/chart/CropInsuranceBar.tsx b/src/components/cropinsurance/chart/CropInsuranceBar.tsx index f190c9d..b4627c5 100644 --- a/src/components/cropinsurance/chart/CropInsuranceBar.tsx +++ b/src/components/cropinsurance/chart/CropInsuranceBar.tsx @@ -1,9 +1,8 @@ import * as React from "react"; import * as d3 from "d3"; import styled from "styled-components"; -import { randomBytes } from "crypto"; import { Box, Typography } from "@mui/material"; -import { ShortFormat, ToPercentageString, ToDollarString } from "../../shared/ConvertionFormats"; +import { ShortFormat, ToDollarString } from "../../shared/ConvertionFormats"; export default function CropInsuranceBar({ CIData, @@ -132,29 +131,29 @@ export default function CropInsuranceBar({ const prepStackedBarData = (data) => { data.sort(function (a, b) { - if (a.programs[0].totalPremiumInDollars === b.programs[0].totalPremiumInDollars) return 0; - if (a.programs[0].totalPremiumInDollars > b.programs[0].totalPremiumInDollars) return -1; + if (a.totalPremiumInDollars === b.totalPremiumInDollars) return 0; + if (a.totalPremiumInDollars > b.totalPremiumInDollars) return -1; return 1; }); const states = data.map((d) => d.state); const res = states.map((state, i) => ({ state, - totalFarmerPaidPremiumInDollars: data[i].programs[0].totalFarmerPaidPremiumInDollars, - totalPremiumSubsidyInDollars: data[i].programs[0].totalPremiumSubsidyInDollars + totalFarmerPaidPremiumInDollars: data[i].totalFarmerPaidPremiumInDollars, + totalPremiumSubsidyInDollars: data[i].totalPremiumSubsidyInDollars })); return res; }; const prepDueBarData = (data, sortedAttr) => { data.sort(function (a, b) { - if (a.programs[0][sortedAttr] === b.programs[0][sortedAttr]) return 0; - if (a.programs[0][sortedAttr] > b.programs[0][sortedAttr]) return -1; + if (a[sortedAttr] === b[sortedAttr]) return 0; + if (a[sortedAttr] > b[sortedAttr]) return -1; return 1; }); const states = data.map((d) => d.state); const res = states.map((state, i) => ({ state, - totalPoliciesEarningPremium: data[i].programs[0].totalPoliciesEarningPremium, - totalIndemnitiesInDollars: data[i].programs[0].totalIndemnitiesInDollars + totalPoliciesEarningPremium: data[i].totalPoliciesEarningPremium, + totalIndemnitiesInDollars: data[i].totalIndemnitiesInDollars })); return res; }; diff --git a/src/pages/CropInsurancePage.tsx b/src/pages/CropInsurancePage.tsx index a6c0396..11127d4 100644 --- a/src/pages/CropInsurancePage.tsx +++ b/src/pages/CropInsurancePage.tsx @@ -65,9 +65,9 @@ export default function CropInsurancePage(): JSX.Element { stateDistributionData[year].forEach((stateData) => { const initObject = { State: stateData.state, - TotalIndemnities: stateData.programs[0].totalIndemnitiesInDollars, - TotalFarmerPaidPremium: stateData.programs[0].totalFarmerPaidPremiumInDollars, - OriginalNetFarmerBenefit: stateData.programs[0].totalNetFarmerBenefitInDollars, + TotalIndemnities: stateData.totalIndemnitiesInDollars, + TotalFarmerPaidPremium: stateData.totalFarmerPaidPremiumInDollars, + OriginalNetFarmerBenefit: stateData.totalNetFarmerBenefitInDollars, NetFarmerBenefit: 0 }; res.push(initObject); From 979e97848b9279d0a4b6230a040d18ad302c31ad Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Wed, 2 Oct 2024 17:05:59 -0500 Subject: [PATCH 4/7] #325: replace the treemap on the ACEP page with the table --- CHANGELOG.md | 10 + src/components/acep/ACEPTotalTable.tsx | 273 +++++++++++++++++++++++++ src/pages/ACEPPage.tsx | 83 ++------ 3 files changed, 296 insertions(+), 70 deletions(-) create mode 100644 src/components/acep/ACEPTotalTable.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index fd2b936..aaeb6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [unreleased] +- Updated the CRP page to use the latest data structure from the API endpoint [#320](https://github.com/policy-design-lab/pdl-frontend/issues/320) +- Updated the ACEP and RCPP page to use the latest data from the API endpoint [#322](https://github.com/policy-design-lab/pdl-frontend/issues/322) +- Updated the Crop Insurance page to use the latest data from the API endpoint [#324](https://github.com/policy-design-lab/pdl-frontend/issues/324) +- Replaced the treemap on the ACEP page with the table [#325](https://github.com/policy-design-lab/pdl-frontend/issues/325) + +### Changed +- Changed the "Other Improvement" in the EQIP page categories to "Other Improvements" [#311](https://github.com/policy-design-lab/pdl-frontend/issues/311) +- Updated CSP category list to match latest data [#305](https://github.com/policy-design-lab/pdl-frontend/issues/305) + ## [1.0.5] - 2024-08-28 ### Added diff --git a/src/components/acep/ACEPTotalTable.tsx b/src/components/acep/ACEPTotalTable.tsx new file mode 100644 index 0000000..95a6c1e --- /dev/null +++ b/src/components/acep/ACEPTotalTable.tsx @@ -0,0 +1,273 @@ +import React from "react"; +import styled from "styled-components"; +import { useTable, useSortBy } from "react-table"; +import Box from "@mui/material/Box"; +import SwapVertIcon from "@mui/icons-material/SwapVert"; +import "../../styles/table.css"; +import { compareWithDollarSign, compareWithNumber } from "../shared/TableCompareFunctions"; + +const Styles = styled.div` + padding: 1rem; + + table { + border-spacing: 0; + border: 1px solid #e4ebe7; + border-left: none; + border-right: none; + + tr { + :last-child { + td { + border-bottom: 0; + } + } + } + + th { + background-color: #f1f1f1; + padding: 1rem; + } + + td { + margin: 0; + padding: 1rem; + padding-left: 5rem; + padding-right: 5rem; + border-bottom: 1px solid #e4ebe7; + border-right: none; + + :last-child { + border-right: 0; + } + } + } +`; + +// eslint-disable-next-line +function Table({ columns, data }: { columns: any; data: any }) { + const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable( + { + columns, + data + }, + useSortBy + ); + + const firstPageRows = rows.slice(0, 50); + + return ( + <> + + + {headerGroups.map((headerGroup) => ( + + {headerGroup.headers.map((column) => ( + // Add the sorting props to control sorting. + + ))} + + ))} + + + { + // eslint-disable-next-line + firstPageRows.map((row, i) => { + prepareRow(row); + return ( + + {row.cells.map((cell) => { + return ( + + ); + })} + + ); + }) + } + +
+ + {column.render("Header")} +
+ {(() => { + if (!column.isSorted) + return ( + + + + ); + if (column.isSortedDesc) return {"\u{25BC}"}; + return {"\u{25B2}"}; + })()} +
+
+
+ {cell.render("Cell")} +
+
+
+ Showing the first {rows.length} results of {rows.length} rows +
+ + ); +} + +function App({ + statePerformance, + year, + stateCodes +}: { + statePerformance: any; + year: any; + stateCodes: any; +}): JSX.Element { + const rcppTableData: any[] = []; + + // eslint-disable-next-line no-restricted-syntax + statePerformance[year].forEach((value) => { + const totalRcpp = value; + let stateName; + stateCodes.forEach((sValue) => { + if (sValue.code.toUpperCase() === value.state.toUpperCase()) { + stateName = sValue.name; + } + }); + const newRecord = () => { + return { + state: stateName, + rcppBenefit: `$${ + totalRcpp.totalPaymentInDollars + .toLocaleString(undefined, { minimumFractionDigits: 2 }) + .toString() + .split(".")[0] + }`, + percentage: `${totalRcpp.totalPaymentInPercentageNationwide.toString()}%`, + noContract: `${totalRcpp.totalContracts + .toLocaleString(undefined, { minimumFractionDigits: 0 }) + .toString()}`, + totAcre: `${totalRcpp.totalAreaInAcres + .toLocaleString(undefined, { minimumFractionDigits: 0 }) + .toString()}` + }; + }; + rcppTableData.push(newRecord()); + }); + + // PENDING: The 'pl' below are hard coded values that are inherited from old code design. Need to update this in the future + const columns = React.useMemo( + () => [ + { + Header: STATES, + accessor: "state", + paddingLeft: "5rem", + paddingRight: "5rem" + }, + { + Header: ( + + TOTAL ACEP BENEFITS + + ), + accessor: "rcppBenefit", + sortType: compareWithDollarSign, + Cell: function styleCells(row) { + return
{row.value}
; + } + }, + { + Header: ( + + NO. OF CONTRACTS + + ), + accessor: "noContract", + sortType: compareWithNumber, + Cell: function styleCells(row) { + return
{row.value}
; + } + }, + { + Header: ( + +
ACRES
+
+ ), + accessor: "totAcre", + sortType: compareWithNumber, + Cell: function styleCells(row) { + return
{row.value}
; + } + }, + { + Header: ( + +
PCT. NATIONWIDE
+
+ ), + accessor: "percentage", + sortType: compareWithNumber, + Cell: function styleCells(row) { + return
{row.value}
; + } + } + ], + [] + ); + + return ( + + + + + + ); +} + +export default App; diff --git a/src/pages/ACEPPage.tsx b/src/pages/ACEPPage.tsx index cccd0c1..8ccf196 100644 --- a/src/pages/ACEPPage.tsx +++ b/src/pages/ACEPPage.tsx @@ -1,17 +1,14 @@ import Box from "@mui/material/Box"; import * as React from "react"; import { createTheme, Grid, ThemeProvider, ToggleButton, ToggleButtonGroup, Typography } from "@mui/material"; -import TableChartIcon from "@mui/icons-material/TableChart"; -import InsertChartIcon from "@mui/icons-material/InsertChart"; + import NavBar from "../components/NavBar"; import Drawer from "../components/ProgramDrawer"; import ACEPTotalMap from "../components/acep/ACEPTotalMap"; import { config } from "../app.config"; import { convertAllState, getJsonDataFromUrl } from "../utils/apiutil"; import NavSearchBar from "../components/shared/NavSearchBar"; -import ACEPTable from "../components/acep/ACEPTable"; -import AcepTreeMap from "../components/acep/AcepTreeMap"; - +import DataTable from "../components/acep/ACEPTotalTable"; import "../styles/subpage.css"; export default function ACEPPage(): JSX.Element { @@ -165,71 +162,17 @@ export default function ACEPPage(): JSX.Element { a single program. - - - - Performance by States - - - - - - - - - - - - - 1440 ? window.innerWidth * 0.7 : window.innerWidth * 0.6 - } - svgH={3000} - /> - - - - - + + + Performance by States + + + + From b3a8428583eb3ea61fce7a587a91eaf8774f1dc1 Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Wed, 2 Oct 2024 17:06:38 -0500 Subject: [PATCH 5/7] update changelog --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaeb6bd..0339c7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [unreleased] + +### Changed - Updated the CRP page to use the latest data structure from the API endpoint [#320](https://github.com/policy-design-lab/pdl-frontend/issues/320) - Updated the ACEP and RCPP page to use the latest data from the API endpoint [#322](https://github.com/policy-design-lab/pdl-frontend/issues/322) - Updated the Crop Insurance page to use the latest data from the API endpoint [#324](https://github.com/policy-design-lab/pdl-frontend/issues/324) - Replaced the treemap on the ACEP page with the table [#325](https://github.com/policy-design-lab/pdl-frontend/issues/325) -### Changed -- Changed the "Other Improvement" in the EQIP page categories to "Other Improvements" [#311](https://github.com/policy-design-lab/pdl-frontend/issues/311) -- Updated CSP category list to match latest data [#305](https://github.com/policy-design-lab/pdl-frontend/issues/305) - ## [1.0.5] - 2024-08-28 ### Added From ce4cb7eee19ae28c62af687ddea6ad723bd901f0 Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Fri, 4 Oct 2024 10:13:34 -0500 Subject: [PATCH 6/7] 1.1.0 release --- CHANGELOG.md | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0339c7f..2cf2f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [unreleased] +## [1.1.0] - 2024-10-04 ### Changed - Updated the CRP page to use the latest data structure from the API endpoint [#320](https://github.com/policy-design-lab/pdl-frontend/issues/320) diff --git a/package-lock.json b/package-lock.json index 2843d21..19b013b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "policy-design-lab", - "version": "1.0.5", + "version": "1.1.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 1bfd9b4..bd46308 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "policy-design-lab", - "version": "1.0.5", + "version": "1.1.0", "description": "the front end of policy design lab", "repository": "https://github.com/policy-design-lab/pdl-frontend", "main": "src/app.tsx", From a4d14b90ac2a1fb05dc8c473c76ee40a7c72053f Mon Sep 17 00:00:00 2001 From: "Wendy(Pengyin) Shan" Date: Fri, 4 Oct 2024 10:14:55 -0500 Subject: [PATCH 7/7] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cf2f2b..530ff57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -294,6 +294,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Map data json [#12](https://github.com/policy-design-lab/pdl-frontend/issues/12) - Final landing page changes for initial milestone [#15](https://github.com/policy-design-lab/pdl-frontend/issues/15) +[1.1.0]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.5...1.1.0 [1.0.5]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.4...1.0.5 [1.0.4]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.3...1.0.4 [1.0.3]: https://github.com/policy-design-lab/pdl-frontend/compare/1.0.2...1.0.3