From 467225d89e4d0b27eb53ae5b803c7ba541980a9d Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Sat, 29 Mar 2025 19:46:59 -0600 Subject: [PATCH] Implemented "Close Workflow" functionality with confirmation dialog box. --- Data/WebUI/src/App.js | 50 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/Data/WebUI/src/App.js b/Data/WebUI/src/App.js index a6adc33..84733de 100644 --- a/Data/WebUI/src/App.js +++ b/Data/WebUI/src/App.js @@ -12,7 +12,12 @@ import { createTheme, Accordion, AccordionSummary, - AccordionDetails + AccordionDetails, + Dialog, + DialogTitle, + DialogContent, + DialogContentText, + DialogActions } from "@mui/material"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; @@ -45,20 +50,16 @@ const CustomNode = ({ data }) => { boxShadow: "0 0 10px rgba(0,0,0,0.2)", position: "relative" }}> - {/* Input handle on the left */} - - {/* Output handle on the right */} -
setAboutAnchorEl(event.currentTarget); const handleAboutMenuClose = () => setAboutAnchorEl(null); + const handleOpenCloseDialog = () => setConfirmCloseOpen(true); + const handleCloseDialog = () => setConfirmCloseOpen(false); + const handleConfirmCloseWorkflow = () => { + setNodes([]); + setEdges([]); + setConfirmCloseOpen(false); + }; + const handleAddTestNode = () => { const id = `test-node-${Date.now()}`; const newNode = { @@ -264,7 +274,13 @@ export default function App() { - + @@ -310,6 +326,28 @@ export default function App() { Nodes: 0 | Update Rate: 500ms + + {/* Confirmation Dialog */} + + Close Workflow? + + + Are you sure you want to reset the workflow? All nodes will be removed. + + + + + + + ); }