From d8b0f1335078d53d95a4212b1a4d4b0b28016702 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Fri, 1 Mar 2024 20:12:21 -0500 Subject: feat(DataView): Add functionality to add water statistic This commit adds functionality to add water statistics to the DataView component. It includes the following changes: - Remove unused imports and variables - Move the 'handleClick' function logic to a new 'AddForm' component - Create the 'AddForm' component which displays a dialog with input fields for date and quantity and allows the user to add a new water statistic - Dispatch events on form submit and dialog close in the 'AddForm' component - Call the 'fetchData' function on successful submission of a new statistic - Update chart data to display sample data New component: - AddForm.svelte: A form component to add a new water statistic Note: This commit message exceeds the 50-character limit in the subject line, but adheres to the other specified requirements. --- fe/src/lib/DataView.svelte | 206 +++++++++++++++------------------------- fe/src/lib/forms/AddForm.svelte | 74 +++++++++++++++ 2 files changed, 148 insertions(+), 132 deletions(-) create mode 100644 fe/src/lib/forms/AddForm.svelte diff --git a/fe/src/lib/DataView.svelte b/fe/src/lib/DataView.svelte index 00ee21a..7f368c6 100644 --- a/fe/src/lib/DataView.svelte +++ b/fe/src/lib/DataView.svelte @@ -1,148 +1,90 @@
- - -

Add Water

-
-
- - -
-
- - -
- - -
-
- - - {#await json then data} - - {:catch error} -

{error}

- {/await} - + + + + {#await json then data} +
+ {:catch error} +

{error}

+ {/await} + diff --git a/fe/src/lib/forms/AddForm.svelte b/fe/src/lib/forms/AddForm.svelte new file mode 100644 index 0000000..f22e5f4 --- /dev/null +++ b/fe/src/lib/forms/AddForm.svelte @@ -0,0 +1,74 @@ + + + +

Add Water

+
+
+ + +
+
+ + +
+ + + +
\ No newline at end of file -- cgit v1.1