diff --git a/public/app/plugins/datasource/influxdb/components/editor/config-v2/UrlAndAuthenticationSection.tsx b/public/app/plugins/datasource/influxdb/components/editor/config-v2/UrlAndAuthenticationSection.tsx index 425fec11210..7b0ff3fcd69 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/config-v2/UrlAndAuthenticationSection.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/config-v2/UrlAndAuthenticationSection.tsx @@ -43,11 +43,14 @@ export const UrlAndAuthenticationSection = (props: Props) => { options.jsonData.version === InfluxVersion.InfluxQL && ['InfluxDB OSS 1.x', 'InfluxDB OSS 2.x'].includes(options.jsonData.product); - const onProductChange = ({ value }: ComboboxOption) => + const onProductChange = ({ value }: ComboboxOption) => { + trackInfluxDBConfigV2ProductSelected({ product: value }); onOptionsChange({ ...options, jsonData: { ...options.jsonData, product: value, version: undefined } }); + }; const onQueryLanguageChange = (option: ComboboxOption) => { const { value } = option; + trackInfluxDBConfigV2QueryLanguageSelected({ version: value }); if (isInfluxVersion(value)) { onUpdateDatasourceJsonDataOptionSelect(props, 'version')(option); @@ -92,7 +95,6 @@ export const UrlAndAuthenticationSection = (props: Props) => { value={options.jsonData.product} options={INFLUXDB_VERSION_MAP.map(({ name }) => ({ value: name }))} onChange={onProductChange} - onBlur={() => trackInfluxDBConfigV2ProductSelected({ product: options.jsonData.product! })} /> @@ -103,7 +105,6 @@ export const UrlAndAuthenticationSection = (props: Props) => { value={options.jsonData.product !== '' ? options.jsonData.version : ''} options={getQueryLanguageOptions(options.jsonData.product || '')} onChange={onQueryLanguageChange} - onBlur={() => trackInfluxDBConfigV2QueryLanguageSelected({ version: options.url })} /> diff --git a/public/app/plugins/datasource/influxdb/components/editor/config/ConfigEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/config/ConfigEditor.tsx index bdfa310fa66..9958745eddb 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/config/ConfigEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/config/ConfigEditor.tsx @@ -68,6 +68,10 @@ export class ConfigEditor extends PureComponent { onVersionChanged = (selected: SelectableValue) => { const { options, onOptionsChange } = this.props; + if (selected.value) { + trackInfluxDBConfigV1QueryLanguageSelection({ version: selected.value }); + } + const copy: DataSourceSettings = { ...options, jsonData: { @@ -118,9 +122,6 @@ export class ConfigEditor extends PureComponent { options={versions} defaultValue={versionMap[InfluxVersion.InfluxQL]} onChange={this.onVersionChanged} - onBlur={() => - trackInfluxDBConfigV1QueryLanguageSelection({ version: this.props.options.jsonData.version || '' }) - } />