From f458e5752396c90f7d453339b5bc1202fbca271b Mon Sep 17 00:00:00 2001 From: ismail simsek Date: Mon, 3 Jun 2024 22:47:27 +0200 Subject: [PATCH] InfluxDB: Fix custom variable support (#88642) * fix variable support * prettier --- .../components/editor/variable/VariableQueryEditor.tsx | 10 +++++----- public/app/plugins/datasource/influxdb/variables.ts | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/public/app/plugins/datasource/influxdb/components/editor/variable/VariableQueryEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/variable/VariableQueryEditor.tsx index 9de9f8f216f..5cab87fe886 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/variable/VariableQueryEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/variable/VariableQueryEditor.tsx @@ -13,7 +13,7 @@ type Props = QueryEditorProps { - const getFluxVariableQuery = (q: InfluxVariableQuery | string) => { + const getVariableQuery = (q: InfluxVariableQuery | string) => { // in legacy variable support query can be only a string // in new variable support query can be an object and hold more information // to be able to support old version we check the query here @@ -24,7 +24,7 @@ export const InfluxVariableEditor = ({ onChange, datasource, query }: Props) => return { refId, query: q, - maxDataPoints: 1000, + ...(datasource.version === InfluxVersion.Flux ? { maxDataPoints: 1000 } : {}), }; }; @@ -34,7 +34,7 @@ export const InfluxVariableEditor = ({ onChange, datasource, query }: Props) => <> { onChange({ ...query, query: q.query ?? '' }); }} @@ -72,11 +72,11 @@ export const InfluxVariableEditor = ({ onChange, datasource, query }: Props) =>