From 48eeba1dc1cf677007e67d8acbaadaa0ac36c790 Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 15 Aug 2023 17:53:27 +0200 Subject: [PATCH] Revamped node selection and edit process --- pkgs/ui/src/app/nodes/NodeList.tsx | 142 ++++++++++++++++------------- 1 file changed, 81 insertions(+), 61 deletions(-) diff --git a/pkgs/ui/src/app/nodes/NodeList.tsx b/pkgs/ui/src/app/nodes/NodeList.tsx index 2784a2d39..978a3b135 100644 --- a/pkgs/ui/src/app/nodes/NodeList.tsx +++ b/pkgs/ui/src/app/nodes/NodeList.tsx @@ -14,22 +14,26 @@ import TableSortLabel from "@mui/material/TableSortLabel"; import Toolbar from "@mui/material/Toolbar"; import Typography from "@mui/material/Typography"; import Paper from "@mui/material/Paper"; -import Checkbox from "@mui/material/Checkbox"; import IconButton from "@mui/material/IconButton"; import Tooltip from "@mui/material/Tooltip"; import FormControlLabel from "@mui/material/FormControlLabel"; import Switch from "@mui/material/Switch"; import DeleteIcon from "@mui/icons-material/Delete"; import FilterListIcon from "@mui/icons-material/FilterList"; +import SpeedDial, { CloseReason, OpenReason } from "@mui/material/SpeedDial"; +import SpeedDialIcon from "@mui/material/SpeedDialIcon"; +import SpeedDialAction from "@mui/material/SpeedDialAction"; import { visuallyHidden } from "@mui/utils"; import CircleIcon from "@mui/icons-material/Circle"; import Stack from "@mui/material/Stack/Stack"; -import ModeIcon from "@mui/icons-material/Mode"; -import ClearIcon from "@mui/icons-material/Clear"; -import Fade from "@mui/material/Fade/Fade"; +import EditIcon from "@mui/icons-material/ModeEdit"; +import SearchIcon from "@mui/icons-material/Search"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import NodePieChart, { PieData } from "./NodePieChart"; +import Fab from "@mui/material/Fab"; +import AddIcon from "@mui/icons-material/Add"; + import Grid2 from "@mui/material/Unstable_Grid2"; // Grid version 2 import { Card, @@ -114,6 +118,53 @@ function stableSort( return stabilizedThis.map((el) => el[0]); } +function BasicSpeedDial() { + const [open, setOpen] = React.useState(false); + + function handleClose(event: any, reason: CloseReason) { + if (reason === "toggle" || reason === "escapeKeyDown") { + setOpen(false); + } + } + + function handleOpen(event: any, reason: OpenReason) { + if (reason === "toggle") { + setOpen(true); + } + } + + return ( + + } + direction="down" + onClose={handleClose} + onOpen={handleOpen} + open={open} + > + } tooltipTitle="Edit" /> + } tooltipTitle="Add" /> + } + tooltipTitle="Delete" + /> + + + ); +} + interface EnhancedTableToolbarProps { selected: string | undefined; tableData: TableData[]; @@ -122,7 +173,8 @@ interface EnhancedTableToolbarProps { function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { const { selected, onClear, tableData } = props; const theme = useTheme(); - const matches = useMediaQuery(theme.breakpoints.down("lg")); + const is_lg = useMediaQuery(theme.breakpoints.down("lg")); + const is_sm = useMediaQuery(theme.breakpoints.down("sm")); const isSelected = selected != undefined; const [debug, setDebug] = React.useState(false); const debugSx = debug @@ -213,57 +265,9 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { ); - const selectedToolbar = ( - - alpha( - theme.palette.primary.main, - theme.palette.action.activatedOpacity, - ), - }} - > - - - - - - - {selected} selected - - - - - - - - ); - - const unselectedToolbar = ( - - - - - - - - - ); - return ( + {/* Debug Controls */} - + - + @@ -317,7 +321,18 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { {/*Toolbar Grid */} - {isSelected ? selectedToolbar : unselectedToolbar} + + + + + + + ); @@ -507,13 +522,18 @@ function Row(props: { Metadata - - Hello1 + + Hello1 - + Hello2 -