diff --git a/ui/src/kapacitor/components/KapacitorRulesTable.js b/ui/src/kapacitor/components/KapacitorRulesTable.js
index 12db317e44..1079831b19 100644
--- a/ui/src/kapacitor/components/KapacitorRulesTable.js
+++ b/ui/src/kapacitor/components/KapacitorRulesTable.js
@@ -1,77 +1,75 @@
import React, {PropTypes} from 'react'
import {Link} from 'react-router'
-const KapacitorRulesTable = ({source, rules, onDelete, onChangeRuleStatus}) => {
- return (
-
-
-
-
- Name |
- Rule Type |
- Message |
- Alerts |
- Enabled |
- |
-
-
-
- {rules.map(rule => {
- return (
-
- )
- })}
-
-
-
- )
+const KapacitorRulesTable = ({rules, onDelete, onChangeRuleStatus}) => (
+
+
+
+
+ Name |
+ Rule Type |
+ Message |
+ Alerts |
+ Enabled |
+ |
+
+
+
+ {rules.map(rule => {
+ return (
+
+ )
+ })}
+
+
+
+)
+
+const RuleRow = ({rule, onDelete, onChangeRuleStatus}) => (
+
+
+
+ |
+ {rule.trigger} |
+ {rule.message} |
+ {rule.alerts.join(', ')} |
+
+
+ onChangeRuleStatus(rule)}
+ />
+
+
+ |
+
+
+ |
+
+)
+
+const RuleTitle = ({rule: {name, links, query}}) => {
+ // no queryConfig means the rule was manually created outside of Chronograf
+ if (!query) {
+ return {name}
+ }
+
+ return {name}
}
-const RuleRow = ({rule, source, onDelete, onChangeRuleStatus}) => {
- return (
-
-
-
- {rule.name}
-
- |
- {rule.trigger} |
- {rule.message} |
- {rule.alerts.join(', ')} |
-
-
- onChangeRuleStatus(rule)}
- />
-
-
- |
-
-
- |
-
- )
-}
-
-const {arrayOf, func, shape} = PropTypes
+const {arrayOf, func, shape, string} = PropTypes
KapacitorRulesTable.propTypes = {
- source: shape(),
rules: arrayOf(shape()),
onChangeRuleStatus: func,
onDelete: func,
@@ -84,4 +82,14 @@ RuleRow.propTypes = {
onDelete: func,
}
+RuleTitle.propTypes = {
+ rule: shape({
+ name: string.isRequired,
+ query: shape(),
+ links: shape({
+ self: string.isRequired,
+ }).isRequired,
+ }),
+}
+
export default KapacitorRulesTable