[InfluxDB] Fix event tracking bug (#107548)

pull/99402/head^2
Alyssa (Bull) Joyner 3 weeks ago committed by GitHub
parent b6eacc929a
commit 41eb49ad03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      public/app/plugins/datasource/influxdb/components/editor/config-v2/UrlAndAuthenticationSection.tsx
  2. 7
      public/app/plugins/datasource/influxdb/components/editor/config/ConfigEditor.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! })}
/>
</Field>
</Box>
@ -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 })}
/>
</Field>
</Box>

@ -68,6 +68,10 @@ export class ConfigEditor extends PureComponent<Props, State> {
onVersionChanged = (selected: SelectableValue<InfluxVersion>) => {
const { options, onOptionsChange } = this.props;
if (selected.value) {
trackInfluxDBConfigV1QueryLanguageSelection({ version: selected.value });
}
const copy: DataSourceSettings<InfluxOptionsV1, {}> = {
...options,
jsonData: {
@ -118,9 +122,6 @@ export class ConfigEditor extends PureComponent<Props, State> {
options={versions}
defaultValue={versionMap[InfluxVersion.InfluxQL]}
onChange={this.onVersionChanged}
onBlur={() =>
trackInfluxDBConfigV1QueryLanguageSelection({ version: this.props.options.jsonData.version || '' })
}
/>
</Field>
</FieldSet>

Loading…
Cancel
Save