influxdb: influxql: more robust resultformat-handling (#39330)

This commit is contained in:
Gábor Farkas
2021-09-17 12:33:09 +02:00
committed by GitHub
parent 52d7358d83
commit d116b2d71b
3 changed files with 24 additions and 28 deletions

View File

@@ -20,11 +20,14 @@ export const RawInfluxQLEditor = ({ query, onChange, onRunQuery }: Props): JSX.E
const aliasElementId = useUniqueId();
const selectElementId = useUniqueId();
const resultFormat = query.resultFormat ?? DEFAULT_RESULT_FORMAT;
const applyDelayedChangesAndRunQuery = () => {
onChange({
...query,
query: currentQuery,
alias: currentAlias,
resultFormat,
});
onRunQuery();
};
@@ -51,7 +54,7 @@ export const RawInfluxQLEditor = ({ query, onChange, onRunQuery }: Props): JSX.E
onChange({ ...query, resultFormat: v.value });
onRunQuery();
}}
value={query.resultFormat ?? DEFAULT_RESULT_FORMAT}
value={resultFormat}
options={RESULT_FORMATS}
/>
<InlineFormLabel htmlFor={aliasElementId}>Alias by</InlineFormLabel>