fix(alert): alert creation detailed response
parent
187fca793f
commit
89c4ba784e
|
@ -52,10 +52,10 @@ class KapacitorRule extends Component {
|
|||
createRule(kapacitor, newRule)
|
||||
.then(() => {
|
||||
router.push(pathname || `/sources/${source.id}/alert-rules`)
|
||||
notify(notifyAlertRuleCreated())
|
||||
notify(notifyAlertRuleCreated(newRule.name))
|
||||
})
|
||||
.catch(() => {
|
||||
notify(notifyAlertRuleCreateFailed())
|
||||
.catch(e => {
|
||||
notify(notifyAlertRuleCreateFailed(newRule.name, e.data.message))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -490,14 +490,14 @@ export const notifyViewerUnauthorizedToSetTempVars = () => ({
|
|||
|
||||
// Rule Builder Notifications
|
||||
// ----------------------------------------------------------------------------
|
||||
export const notifyAlertRuleCreated = () => ({
|
||||
export const notifyAlertRuleCreated = ruleName => ({
|
||||
...defaultSuccessNotification,
|
||||
message: 'Alert Rule created successfully.',
|
||||
message: `${ruleName} created successfully.`,
|
||||
})
|
||||
|
||||
export const notifyAlertRuleCreateFailed = () => ({
|
||||
export const notifyAlertRuleCreateFailed = (ruleName, errorMessage) => ({
|
||||
...defaultErrorNotification,
|
||||
message: 'Alert Rule could not be created.',
|
||||
message: `There was a problem creating ${ruleName}: ${errorMessage}`,
|
||||
})
|
||||
|
||||
export const notifyAlertRuleUpdated = ruleName => ({
|
||||
|
|
Loading…
Reference in New Issue