From 4c326ce36b379c200576ae2a74b719905c2dbcad Mon Sep 17 00:00:00 2001 From: ebb-tide Date: Mon, 14 May 2018 15:44:39 -0700 Subject: [PATCH 1/2] Transmit id as part of query payload to capture query status --- ui/src/data_explorer/components/Table.tsx | 2 +- ui/src/shared/actions/timeSeries.ts | 14 ++++++++++++-- ui/src/shared/apis/query.ts | 5 +++-- ui/src/shared/components/AutoRefresh.tsx | 1 + 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ui/src/data_explorer/components/Table.tsx b/ui/src/data_explorer/components/Table.tsx index d49bdab994..515701ebeb 100644 --- a/ui/src/data_explorer/components/Table.tsx +++ b/ui/src/data_explorer/components/Table.tsx @@ -225,7 +225,7 @@ class ChronoTable extends PureComponent { try { const {results} = await fetchTimeSeriesAsync({ source: this.source, - query: query.text, + query, tempVars: TEMPLATES, }) diff --git a/ui/src/shared/actions/timeSeries.ts b/ui/src/shared/actions/timeSeries.ts index d9ed0ab928..7f5c852ee2 100644 --- a/ui/src/shared/actions/timeSeries.ts +++ b/ui/src/shared/actions/timeSeries.ts @@ -51,14 +51,24 @@ export const handleError = (error, query, editQueryStatus) => { }) } +interface Query { + host: string | string[] + text: string + id: string + database?: string + db?: string + rp?: string +} + interface Payload { source: string - query: string + query: Query tempVars: any[] db?: string rp?: string resolution?: number } + export const fetchTimeSeriesAsync = async ( {source, db, rp, query, tempVars, resolution}: Payload, editQueryStatus = noop @@ -69,7 +79,7 @@ export const fetchTimeSeriesAsync = async ( source, db, rp, - query, + query: query.text, tempVars, resolution, }) diff --git a/ui/src/shared/apis/query.ts b/ui/src/shared/apis/query.ts index 6d280239c5..d3540f4a2a 100644 --- a/ui/src/shared/apis/query.ts +++ b/ui/src/shared/apis/query.ts @@ -29,6 +29,7 @@ interface Query { database: string db: string rp: string + id: string } const parseSource = source => { @@ -46,7 +47,7 @@ export const fetchTimeSeries = async ( editQueryStatus: () => any ) => { const timeSeriesPromises = queries.map(query => { - const {host, database, rp, text} = query + const {host, database, rp} = query // the key `database` was used upstream in HostPage.js, and since as of this writing // the codebase has not been fully converted to TypeScript, it's not clear where else // it may be used, but this slight modification is intended to allow for the use of @@ -72,7 +73,7 @@ export const fetchTimeSeries = async ( const tempVars = removeUnselectedTemplateValues(templatesWithIntervalVals) const source = parseSource(host) - const payload = {source, db, rp, query: text, tempVars, resolution} + const payload = {source, db, rp, query, tempVars, resolution} return fetchTimeSeriesAsync(payload, editQueryStatus) }) diff --git a/ui/src/shared/components/AutoRefresh.tsx b/ui/src/shared/components/AutoRefresh.tsx index cfbb2f5a53..98b8234b7a 100644 --- a/ui/src/shared/components/AutoRefresh.tsx +++ b/ui/src/shared/components/AutoRefresh.tsx @@ -18,6 +18,7 @@ interface Query { database: string db: string rp: string + id: string } interface TemplateQuery { From 3c98ced0904a130ae4888f40e80f8774661ce7d4 Mon Sep 17 00:00:00 2001 From: ebb-tide Date: Mon, 14 May 2018 17:25:31 -0700 Subject: [PATCH 2/2] Update Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8785affed1..9531281194 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ 1. [#3402](https://github.com/influxdata/chronograf/pull/3402): Fix missing icons when using basepath 1. [#3412](https://github.com/influxdata/chronograf/pull/3412): Limit max-width of TICKScript editor. 1. [#3166](https://github.com/influxdata/chronograf/pull/3166): Fixes naming of new TICKScripts - +1. [#3449](https://github.com/influxdata/chronograf/pull/3449): Fixes data explorer query error reporting regression ## v1.4.4.1 [2018-04-16]