From f0a14115f8de2577ed2ca5f2af35159486843168 Mon Sep 17 00:00:00 2001 From: deniz kusefoglu Date: Fri, 8 Sep 2017 12:24:46 -0700 Subject: [PATCH] Clean up --- ui/src/kapacitor/components/DataSection.js | 87 ++++++---------------- 1 file changed, 23 insertions(+), 64 deletions(-) diff --git a/ui/src/kapacitor/components/DataSection.js b/ui/src/kapacitor/components/DataSection.js index c2f3c3ada2..2ea72d58b3 100644 --- a/ui/src/kapacitor/components/DataSection.js +++ b/ui/src/kapacitor/components/DataSection.js @@ -1,6 +1,4 @@ import React, {PropTypes, Component} from 'react' -import buildInfluxQLQuery from 'utils/influxql' -import classnames from 'classnames' import DatabaseList from 'src/shared/components/DatabaseList' import MeasurementList from 'src/shared/components/MeasurementList' @@ -13,10 +11,6 @@ class DataSection extends Component { super(props) } - getChildContext = () => { - return {source: this.props.source} - } - handleChooseNamespace = namespace => { this.props.actions.chooseNamespace(this.props.query.id, namespace) } @@ -56,66 +50,40 @@ class DataSection extends Component { } render() { - const {query, timeRange: {lower}, isKapacitorRule} = this.props - const statement = - query.rawText || buildInfluxQLQuery({lower}, query, isKapacitorRule) + const {query, isKapacitorRule, isDeadman} = this.props return (
-

Select a Time Series

-
-
-            
-              {statement || 'Build a query below'}
-            
-          
- {this.renderQueryBuilder()} +
+ + + {isDeadman + ? null + : }
) } - - renderQueryBuilder = () => { - const {query, isKapacitorRule, isDeadman} = this.props - return ( -
- - - {isDeadman - ? null - : } -
- ) - } } -const {string, func, shape, bool} = PropTypes +const {bool, func, shape, string} = PropTypes DataSection.propTypes = { - source: shape({ - links: shape({ - kapacitors: string.isRequired, - }).isRequired, - }), query: shape({ id: string.isRequired, }).isRequired, @@ -134,15 +102,6 @@ DataSection.propTypes = { onRemoveEvery: func.isRequired, timeRange: shape({}).isRequired, isKapacitorRule: bool, -} - -DataSection.childContextTypes = { - source: PropTypes.shape({ - links: PropTypes.shape({ - proxy: PropTypes.string.isRequired, - self: PropTypes.string.isRequired, - }).isRequired, - }).isRequired, isDeadman: bool, }