From caad4e117e284655b14caf37143273edcc213669 Mon Sep 17 00:00:00 2001 From: "Daniel S. Hansen" Date: Mon, 25 Aug 2025 14:15:04 -0700 Subject: [PATCH 1/2] Add form type validation for date and number values along with interactive row highlighting in the main M&E Data Entry table --- .../Canvas/views/AdminTabs/MEDataEntry.jsx | 92 ++++++++++++------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx index 18ed766..f0f5b21 100644 --- a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx +++ b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx @@ -116,12 +116,29 @@ const items = [ export function MEDataEntry() { const [value, setValue] = useState(""); const [selection, setSelection] = useState([]); + const { register, handleSubmit, + reset, watch, formState: { errors }, - } = useForm(); + } = useForm({ + defaultValues: { + id: "", + section: "", + volcano: "", + country: "", + start: "", + end: "", + type: "", + vpi10: "", + downstream: 0, + male: 0, + female: 0, + total: 0, + } + }); const onSubmit = (data) => { console.log("Form submitted:", data); @@ -184,34 +201,36 @@ export function MEDataEntry() { - + Number of people benefitting from VDAP activities, disaggregate by sex - - - - - {/* padding for checkboxes */} - Section - Volcano - Country - Start Date of Assistance - End Date of Assistance - Assistance Type - VPI10 - Downstream Population - Male - Female - Total - - + {/* */} + + + + + {/* padding for checkboxes */} + Section + Volcano + Country + Start Date of Assistance + End Date of Assistance + Assistance Type + VPI10 + Downstream Population + Male + Female + Total + + - - {rows} - - - + + {rows} + + + + {/* */} {/* Row actions aligned right */} @@ -223,8 +242,13 @@ export function MEDataEntry() { {/* Form Section */} - - + + Fill in Form @@ -237,7 +261,7 @@ export function MEDataEntry() { Start Date of Assistance: - + @@ -254,29 +278,29 @@ export function MEDataEntry() { End Date of Assistance: - + Downstream Affected Population: - + Male Population: - + Female Population: - + Total Population: - + @@ -290,7 +314,7 @@ export function MEDataEntry() { - From bdd92f2f2c4041d11f0255bdd46e58f851e99057 Mon Sep 17 00:00:00 2001 From: "Daniel S. Hansen" Date: Mon, 25 Aug 2025 15:12:20 -0700 Subject: [PATCH 2/2] Add ScrollArea to main M&E Data Entry table along with sticky header --- .../Canvas/views/AdminTabs/MEDataEntry.jsx | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx index f0f5b21..f3ee9ba 100644 --- a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx +++ b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx @@ -111,6 +111,20 @@ const items = [ female: 550, total: 1100, }, + { + id: "r6", + section: "Gas", + volcano: "Ranier", + country: "US", + start: "2024-07-02", + end: "2027-05-12", + type: "Deployment", + vpi10: "Yes", + downstream: 1200, + male: 570, + female: 570, + total: 1400, + }, ]; export function MEDataEntry() { @@ -123,22 +137,7 @@ export function MEDataEntry() { reset, watch, formState: { errors }, - } = useForm({ - defaultValues: { - id: "", - section: "", - volcano: "", - country: "", - start: "", - end: "", - type: "", - vpi10: "", - downstream: 0, - male: 0, - female: 0, - total: 0, - } - }); + } = useForm(); const onSubmit = (data) => { console.log("Form submitted:", data); @@ -201,16 +200,16 @@ export function MEDataEntry() { - + Number of people benefitting from VDAP activities, disaggregate by sex {/* */} - - + + - - {/* padding for checkboxes */} + + Section Volcano Country