Merge pull request #3182 from influxdata/fix/notification-failure-creating-rp

Send notification when rp creation returns a failure
pull/10616/head
Brandon Farmer 2018-04-12 00:04:07 -07:00 committed by GitHub
commit 7d8531f524
3 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@
1. [#3149](https://github.com/influxdata/chronograf/pull/3149): Fixes errors caused by switching query tabs in CEO
1. [#3162](https://github.com/influxdata/chronograf/pull/3162): Only send threshold value to parent on blur
1. [#3168](https://github.com/influxdata/chronograf/pull/3168): Require that emails on GitHub & Generic OAuth2 principals be verified & primary, if those fields are provided
1. [#3182](https://github.com/influxdata/chronograf/pull/3182): Send notification when rp creation returns a failure
## v1.4.3.1 [2018-04-02]

View File

@ -50,6 +50,7 @@ import {
notifyRetentionPolicyDeleteFailed,
notifyRetentionPolicyUpdated,
notifyRetentionPolicyUpdateFailed,
notifyRetentionPolicyCreationError,
} from 'shared/copy/notifications'
import {REVERT_STATE_DELAY} from 'shared/constants'
@ -352,6 +353,7 @@ export const createRetentionPolicyAsync = (
dispatch(notify(notifyRetentionPolicyCreated()))
dispatch(syncRetentionPolicy(database, retentionPolicy, data))
} catch (error) {
dispatch(notify(notifyRetentionPolicyCreationError()))
dispatch(
errorThrown(notifyRetentionPolicyCreationFailed(error.data.message))
)

View File

@ -324,6 +324,11 @@ export const notifyRetentionPolicyCreated = () => ({
message: 'Retention Policy created successfully.',
})
export const notifyRetentionPolicyCreationError = () => ({
...defaultErrorNotification,
message: 'Failed to create Retention Policy. Please check name and duration.',
})
export const notifyRetentionPolicyCreationFailed = errorMessage =>
`Failed to create Retention Policy: ${errorMessage}`