Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

Fix(FE) : Ask for confirmation before deleting any dashboard from dashboard list (#534)

Nishidh Jaina0efa6318590
diff --git a/frontend/src/container/ListOfDashboard/TableComponents/DeleteButton.tsx b/frontend/src/container/ListOfDashboard/TableComponents/DeleteButton.tsx
index f0b2d183df..fd9ef16001 100644
--- a/frontend/src/container/ListOfDashboard/TableComponents/DeleteButton.tsx
+++ b/frontend/src/container/ListOfDashboard/TableComponents/DeleteButton.tsx
@@ -1,4 +1,6 @@
-import React, { useCallback } from 'react';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
+import { Modal } from 'antd';
+import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';
import { ThunkDispatch } from 'redux-thunk';
@@ -8,14 +10,29 @@ import AppActions from 'types/actions';
import { Data } from '../index';
import { TableLinkText } from './styles';
+const { confirm } = Modal;
+
function DeleteButton({ deleteDashboard, id }: DeleteButtonProps): JSX.Element {
- const onClickHandler = useCallback(() => {
- deleteDashboard({
- uuid: id,
+ const openConfirmationDialog = (): void => {
+ confirm({
+ title: 'Do you really want to delete this dashboard?',
+ icon: <ExclamationCircleOutlined style={{ color: '#e42b35' }} />,
+ onOk() {
+ deleteDashboard({
+ uuid: id,
+ });
+ },
+ okText: 'Delete',
+ okButtonProps: { danger: true },
+ centered: true,
});
- }, [id, deleteDashboard]);
+ };
- return <TableLinkText onClick={onClickHandler}>Delete</TableLinkText>;
+ return (
+ <TableLinkText type="danger" onClick={openConfirmationDialog}>
+ Delete
+ </TableLinkText>
+ );
}
interface DispatchProps {