From 5ef90c230489859cbe21df5cf7e083b78f4257b8 Mon Sep 17 00:00:00 2001 From: Karandeep Lubana Date: Sat, 3 Jun 2023 17:15:09 -0400 Subject: [PATCH 1/2] IEEE-177 Maintain filters when drawer opens and closes --- .../dashboard/frontend/src/pages/Inventory/Inventory.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx b/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx index d9cb7f4dc..5486eaf56 100644 --- a/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx +++ b/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx @@ -28,7 +28,7 @@ import { isLoadingSelector, } from "slices/hardware/hardwareSlice"; import { getCategories } from "slices/hardware/categorySlice"; -import { Grid } from "@material-ui/core"; +import { Grid, ModalProps } from "@material-ui/core"; import { userTypeSelector } from "slices/users/userSlice"; import DateRestrictionAlert from "components/general/DateRestrictionAlert/DateRestrictionAlert"; @@ -59,7 +59,7 @@ const Inventory = () => { dispatch(getHardwareWithFilters()); dispatch(getCategories()); }, [dispatch]); - + return ( <>
@@ -69,6 +69,9 @@ const Inventory = () => { className={styles.inventoryFilterDrawer} open={mobileOpen} onClose={toggleFilter} + ModalProps={{ + keepMounted: true, // Prevent unmounting when closed + }} >
Filters From 3993cf1bbaca2792a069f92e162627fe06fb9248 Mon Sep 17 00:00:00 2001 From: Karandeep Lubana Date: Sat, 3 Jun 2023 17:39:11 -0400 Subject: [PATCH 2/2] IEEE-177 run prettier on Inventory.tsx --- .../dashboard/frontend/src/pages/Inventory/Inventory.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx b/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx index 5486eaf56..251218f38 100644 --- a/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx +++ b/hackathon_site/dashboard/frontend/src/pages/Inventory/Inventory.tsx @@ -59,7 +59,7 @@ const Inventory = () => { dispatch(getHardwareWithFilters()); dispatch(getCategories()); }, [dispatch]); - + return ( <>