diff --git a/client/app/pages/alert/index.js b/client/app/pages/alert/index.js index 0d402d9e32..486629563c 100644 --- a/client/app/pages/alert/index.js +++ b/client/app/pages/alert/index.js @@ -1,6 +1,8 @@ import { template as templateBuilder } from 'lodash'; import notification from '@/services/notification'; +import Modal from 'antd/lib/modal'; import template from './alert.html'; +import navigateTo from '@/services/navigateTo'; function AlertCtrl($scope, $routeParams, $location, $sce, currentUser, Query, Events, Alert) { this.alertId = $routeParams.alertId; @@ -74,15 +76,24 @@ function AlertCtrl($scope, $routeParams, $location, $sce, currentUser, Query, Ev }; this.delete = () => { - this.alert.$delete( - () => { - $location.path('/alerts'); - notification.success('Alert deleted.'); - }, - () => { + const doDelete = () => { + this.alert.$delete(() => { + notification.success('Alert destination deleted successfully.'); + navigateTo('/alerts', true); + }, () => { notification.error('Failed deleting alert.'); - }, - ); + }); + }; + + Modal.confirm({ + title: 'Delete Alert', + content: 'Are you sure you want to delete this alert?', + okText: 'Delete', + okType: 'danger', + onOk: doDelete, + maskClosable: true, + autoFocusButton: null, + }); }; }