diff --git a/ui/src/kapacitor/components/AlertTabs.js b/ui/src/kapacitor/components/AlertTabs.js index 7889ba0290..58467c486b 100644 --- a/ui/src/kapacitor/components/AlertTabs.js +++ b/ui/src/kapacitor/components/AlertTabs.js @@ -2,11 +2,7 @@ import React, {Component, PropTypes} from 'react' import _ from 'lodash' import {Tab, Tabs, TabPanel, TabPanels, TabList} from 'shared/components/Tabs' -import { - getKapacitorConfig, - updateKapacitorConfigSection, - testAlertOutput, -} from 'shared/apis' +import {getKapacitorConfig, updateKapacitorConfigSection} from 'shared/apis' import { AlertaConfig, @@ -92,22 +88,6 @@ class AlertTabs extends Component { } } - handleTestConfig = section => () => { - testAlertOutput(this.props.kapacitor, section, {}) - .then(() => { - this.props.addFlashMessage({ - type: 'success', - text: `Successfully relayed an alert to ${section}.`, - }) - }) - .catch(() => { - this.props.addFlashMessage({ - type: 'error', - text: `There was an error relaying an alert to ${section}.`, - }) - }) - } - sanitizeProperties = (section, properties) => { const cleanProps = {...properties, enabled: true} const {redacted} = this.getSection(this.state.configSections, section) @@ -136,7 +116,6 @@ class AlertTabs extends Component { , }, hipchat: { @@ -146,7 +125,6 @@ class AlertTabs extends Component { , }, opsgenie: { @@ -156,7 +134,6 @@ class AlertTabs extends Component { , }, pagerduty: { @@ -166,7 +143,6 @@ class AlertTabs extends Component { , }, pushover: { @@ -176,7 +152,6 @@ class AlertTabs extends Component { , }, sensu: { @@ -186,7 +161,6 @@ class AlertTabs extends Component { , }, slack: { @@ -196,7 +170,6 @@ class AlertTabs extends Component { , }, smtp: { @@ -206,7 +179,6 @@ class AlertTabs extends Component { , }, talk: { @@ -216,7 +188,6 @@ class AlertTabs extends Component { , }, telegram: { @@ -226,7 +197,6 @@ class AlertTabs extends Component { , }, victorops: { @@ -236,7 +206,6 @@ class AlertTabs extends Component { , }, } diff --git a/ui/src/kapacitor/components/config/SlackConfig.js b/ui/src/kapacitor/components/config/SlackConfig.js index b23cbf38e5..839b02cf7e 100644 --- a/ui/src/kapacitor/components/config/SlackConfig.js +++ b/ui/src/kapacitor/components/config/SlackConfig.js @@ -66,11 +66,6 @@ class SlackConfig extends Component { Update Slack Config -
-
-
- ❤️❤️❤️❤️Test Slack Config❤️❤️❤️❤️ -
) } @@ -86,7 +81,6 @@ SlackConfig.propTypes = { }).isRequired, }).isRequired, onSave: func.isRequired, - onTest: func, } export default SlackConfig diff --git a/ui/src/shared/apis/index.js b/ui/src/shared/apis/index.js index e2d6979b0b..bec7eea7c3 100644 --- a/ui/src/shared/apis/index.js +++ b/ui/src/shared/apis/index.js @@ -159,7 +159,12 @@ export function testAlertOutput(kapacitor, outputName, properties) { '/kapacitor/v1/service-tests' ).then(({data: {services}}) => { const service = services.find(s => s.name === outputName) - return kapacitorProxy(kapacitor, 'POST', service.link.href, {}) + return kapacitorProxy( + kapacitor, + 'POST', + service.link.href, + Object.assign({}, service.options, properties) + ) }) }