From 86e5dc217bc63d0e0fa6fe60fdabb9ef06050c95 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Fri, 11 Aug 2017 13:53:13 -0700 Subject: [PATCH] Use QueryTabList component --- ui/src/data_explorer/components/QueryMaker.js | 64 ++++++------------- 1 file changed, 21 insertions(+), 43 deletions(-) diff --git a/ui/src/data_explorer/components/QueryMaker.js b/ui/src/data_explorer/components/QueryMaker.js index b1dca91654..bf866b0fcd 100644 --- a/ui/src/data_explorer/components/QueryMaker.js +++ b/ui/src/data_explorer/components/QueryMaker.js @@ -2,6 +2,7 @@ import React, {PropTypes} from 'react' import QueryBuilder from './QueryBuilder' import QueryMakerTab from './QueryMakerTab' +import QueryTabList from 'src/dashboards/components/QueryTabList' import buildInfluxQLQuery from 'utils/influxql' import classnames from 'classnames' @@ -42,7 +43,18 @@ const QueryMaker = React.createClass({ }, render() { - const {height, top, layout} = this.props + const { + height, + top, + layout, + queries, + timeRange, + onAddQuery, + onDeleteQuery, + activeQueryIndex, + setActiveQueryIndex, + } = this.props + return (
- {this.renderQueryTabList()} + {this.renderQueryBuilder()}
) @@ -109,47 +128,6 @@ const QueryMaker = React.createClass({ /> ) }, - - renderQueryTabList() { - const { - queries, - activeQueryIndex, - onDeleteQuery, - timeRange, - setActiveQueryIndex, - onAddQuery, - } = this.props - - return ( -
- {queries.map((q, i) => { - return ( - - ) - })} - {this.props.children} -
- -
-
- ) - }, }) QueryMaker.defaultProps = {