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