From 88be3aa6bc9c2e0c3d04ddf6844d410e4d7ffa9e Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Tue, 4 Apr 2017 14:55:53 -0700 Subject: [PATCH] Pull out ternary into separate function property --- ui/src/data_explorer/components/Visualization.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/src/data_explorer/components/Visualization.js b/ui/src/data_explorer/components/Visualization.js index eb0ca1ed5..bbf9c90fc 100644 --- a/ui/src/data_explorer/components/Visualization.js +++ b/ui/src/data_explorer/components/Visualization.js @@ -102,17 +102,24 @@ const Visualization = React.createClass({ renderVisualization(view, queries, heightPixels, onEditRawStatus, activeQueryIndex) { const activeQuery = queries[activeQueryIndex] const defaultQuery = queries[0] - const q = activeQuery || defaultQuery switch (view) { case TABLE: - return (q ? :
Enter your query below
) + return this.renderTable(activeQuery || defaultQuery, heightPixels, onEditRawStatus) case GRAPH: default: this.renderGraph(queries) } }, + renderTable(query, heightPixels, onEditRawStatus) { + if (!query) { + return
Enter your query below
+ } + + return
+ }, + renderGraph(queries) { const {cellType, autoRefresh, activeQueryIndex} = this.props const isInDataExplorer = true