feat: show snackbar on flow removal
This commit is contained in:
@@ -4,6 +4,7 @@ import { Link } from 'react-router-dom';
|
||||
import Menu from '@mui/material/Menu';
|
||||
import type { PopoverProps } from '@mui/material/Popover';
|
||||
import MenuItem from '@mui/material/MenuItem';
|
||||
import { useSnackbar } from 'notistack';
|
||||
|
||||
import { DELETE_FLOW } from 'graphql/mutations/delete-flow';
|
||||
import * as URLS from 'config/urls';
|
||||
@@ -17,6 +18,7 @@ type ContextMenuProps = {
|
||||
|
||||
export default function ContextMenu(props: ContextMenuProps): React.ReactElement {
|
||||
const { flowId, onClose, anchorEl } = props;
|
||||
const { enqueueSnackbar } = useSnackbar();
|
||||
const [deleteFlow] = useMutation(DELETE_FLOW);
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
@@ -34,6 +36,8 @@ export default function ContextMenu(props: ContextMenuProps): React.ReactElement
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
enqueueSnackbar(formatMessage('flow.successfullyDeleted'), { variant: 'success' });
|
||||
}, [flowId, deleteFlow]);
|
||||
|
||||
return (
|
||||
|
@@ -43,6 +43,7 @@
|
||||
"flow.inactive": "OFF",
|
||||
"flow.published": "Published",
|
||||
"flow.draft": "Draft",
|
||||
"flow.successfullyDeleted": "The flow and associated executions have been deleted.",
|
||||
"flowEditor.publish": "PUBLISH",
|
||||
"flowEditor.unpublish": "UNPUBLISH",
|
||||
"flowEditor.publishedFlowCannotBeUpdated": "To edit this flow, you must first unpublish it.",
|
||||
|
Reference in New Issue
Block a user