From 27fcc0dd21a49f65b614a33efcb66dd5257cd263 Mon Sep 17 00:00:00 2001 From: Christopher Henn Date: Fri, 28 Sep 2018 13:29:47 -0700 Subject: [PATCH] Avoid uncaught exception in TableGraph --- ui/src/shared/components/TableGraph.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/src/shared/components/TableGraph.tsx b/ui/src/shared/components/TableGraph.tsx index bcc9b1dfb..50f2a3d28 100644 --- a/ui/src/shared/components/TableGraph.tsx +++ b/ui/src/shared/components/TableGraph.tsx @@ -29,6 +29,7 @@ import { TimeSeriesServerResponse, TimeSeriesValue, TimeSeriesToTableGraphReturnType, + InfluxQLQueryType, } from 'src/types/series' import {ColorString} from 'src/types/colors' import { @@ -83,6 +84,7 @@ interface State { transformedData: TimeSeriesValue[][] sortedTimeVals: TimeSeriesValue[] sortedLabels: Label[] + influxQLQueryType: InfluxQLQueryType hoveredColumnIndex: number hoveredRowIndex: number timeColumnWidth: number @@ -115,6 +117,7 @@ class TableGraph extends PureComponent { transformedData: [[]], sortedTimeVals: [], sortedLabels: [], + influxQLQueryType: InfluxQLQueryType.DataQuery, hoveredColumnIndex: NULL_ARRAY_INDEX, hoveredRowIndex: NULL_ARRAY_INDEX, sort: {field: sortField, direction: DEFAULT_SORT_DIRECTION}, @@ -303,7 +306,11 @@ class TableGraph extends PureComponent { ) } const data = _.get(result, 'data', this.state.data) - const influxQLQueryType = _.get(result, 'influxQLQueryType', null) + const influxQLQueryType = _.get( + result, + 'influxQLQueryType', + this.state.influxQLQueryType + ) if (_.isEmpty(data[0])) { return @@ -397,6 +404,7 @@ class TableGraph extends PureComponent { this.setState({ data, sortedLabels, + influxQLQueryType, transformedData, sortedTimeVals, sort,