[InfluxDB] Fix event tracking bug (#107548)

This commit is contained in:
Alyssa (Bull) Joyner
2025-07-02 16:38:01 -06:00
committed by GitHub
parent b6eacc929a
commit 41eb49ad03
2 changed files with 8 additions and 6 deletions
@@ -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>