@@ -8,6 +8,7 @@ import { Alert as AlertType } from '@/components/proptypes';
8
8
import Form from 'antd/lib/form' ;
9
9
import Button from 'antd/lib/button' ;
10
10
import Tooltip from 'antd/lib/tooltip' ;
11
+ import AntAlert from 'antd/lib/alert' ;
11
12
12
13
import Title from './components/Title' ;
13
14
import Criteria from './components/Criteria' ;
@@ -47,6 +48,17 @@ AlertState.defaultProps = {
47
48
48
49
// eslint-disable-next-line react/prefer-stateless-function
49
50
export default class AlertView extends React . Component {
51
+ state = {
52
+ unmuting : false ,
53
+ }
54
+
55
+ unmute = ( ) => {
56
+ this . setState ( { unmuting : true } ) ;
57
+ this . props . unmute ( ) . finally ( ( ) => {
58
+ this . setState ( { unmuting : false } ) ;
59
+ } ) ;
60
+ }
61
+
50
62
render ( ) {
51
63
const { alert, queryResult, canEdit, onEdit, menuButton } = this . props ;
52
64
const { query, name, options, rearm } = alert ;
@@ -87,6 +99,24 @@ export default class AlertView extends React.Component {
87
99
</ Form >
88
100
</ div >
89
101
< div className = "col-md-4" >
102
+ { options . muted && (
103
+ < AntAlert
104
+ className = "m-b-20"
105
+ message = { < > < i className = "fa fa-bell-slash-o" /> Notifications are muted</ > }
106
+ description = { (
107
+ < >
108
+ Notifications for this alert will not be sent.< br />
109
+ { canEdit && (
110
+ < >
111
+ To restore notifications click
112
+ < Button size = "small" type = "primary" onClick = { this . unmute } loading = { this . state . unmuting } className = "m-t-5 m-l-5" > Unmute</ Button >
113
+ </ >
114
+ ) }
115
+ </ >
116
+ ) }
117
+ type = "warning"
118
+ />
119
+ ) }
90
120
< h4 > Destinations{ ' ' }
91
121
< Tooltip title = "Open Alert Destinations page in a new tab." >
92
122
< a href = "destinations" target = "_blank" >
@@ -108,8 +138,10 @@ AlertView.propTypes = {
108
138
canEdit : PropTypes . bool . isRequired ,
109
139
onEdit : PropTypes . func . isRequired ,
110
140
menuButton : PropTypes . node . isRequired ,
141
+ unmute : PropTypes . func ,
111
142
} ;
112
143
113
144
AlertView . defaultProps = {
114
145
queryResult : null ,
146
+ unmute : null ,
115
147
} ;
0 commit comments