From 3ef85bbcbff7722271f16eca088015fc83b19d53 Mon Sep 17 00:00:00 2001 From: "Daniel S. Hansen" Date: Fri, 22 Aug 2025 09:28:03 -0700 Subject: [PATCH] Save point, layout taking shape --- .../Canvas/CanvasComponents/DropDownMenu.jsx | 2 +- .../Canvas/views/AdminTabs/MEDataEntry.jsx | 111 +++++++++++++++--- 2 files changed, 97 insertions(+), 16 deletions(-) diff --git a/client/src/components/Canvas/CanvasComponents/DropDownMenu.jsx b/client/src/components/Canvas/CanvasComponents/DropDownMenu.jsx index 738351d..811fdbb 100644 --- a/client/src/components/Canvas/CanvasComponents/DropDownMenu.jsx +++ b/client/src/components/Canvas/CanvasComponents/DropDownMenu.jsx @@ -4,7 +4,7 @@ export default function DropDownMenu({ collection, placeholder = "Select...", si return ( - + diff --git a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx index 767ad02..ef25974 100644 --- a/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx +++ b/client/src/components/Canvas/views/AdminTabs/MEDataEntry.jsx @@ -1,4 +1,5 @@ -import { HStack, createListCollection } from "@chakra-ui/react" +import { useState } from 'react'; +import { Box, Button, Text, List, HStack, RadioGroup, Table, createListCollection } from "@chakra-ui/react" import DropDownMenu from "../../CanvasComponents/DropDownMenu" const startYear = 1970; @@ -26,24 +27,104 @@ items: [ }) const sections = createListCollection({ -items: [ - { label: "All", value: "all" }, - { label: "Com", value: "com" }, - { label: "Eng", value: "eng" }, - { label: "Gas", value: "gas" }, - { label: "Geophys", value: "geophys" }, - { label: "GRSP", value: "grsp" }, - { label: "IT", value: "it" }, -], + items: [ + { label: "All", value: "all" }, + { label: "Com", value: "com" }, + { label: "Eng", value: "eng" }, + { label: "Gas", value: "gas" }, + { label: "Geophys", value: "geophys" }, + { label: "GRSP", value: "grsp" }, + { label: "IT", value: "it" }, + ], }) export function MEDataEntry() { + const [value, setValue] = useState("") + const [rows, setRows] = useState([]); + return( - - - - - + + + + + + + + Use Volcano names as found in GVP and dashboard. (e.g. Nevado del Ruiz, Chiles-Cerro Negro). + + + Edit entry. + Delete entry. + Copy entry to form. Then hitting 'Save' will create a new entry. + + + + Number of people benefitting from VDAP activities, disaggregate by sex + + + + setValue(e.value)}> + + + + Section + Volcano + Country + Start Date of Assistance + End Date of Assistance + Assistance Type + VPI10 + Downstream Population + Male + Female + Total + + + + + {rows.length === 0 ? ( + + + No data yet + + + ) : ( + rows.map((r) => ( + + + + + + + + {r.section} + {r.volcano} + {r.country} + {r.start} + {r.end} + {r.type} + {r.vpi10} + {r.downstream} + {r.male} + {r.female} + {r.total} + + ))) + } + + + + + + + + {/* Row actions aligned right */} + + + + + + ); }