[v9.4.x] TestData: Fix bug when selecting "Log" streaming (#63725)

TestData: Fix bug when selecting "Log" streaming (#63190)

* fix wrong fields getting populated

* fix bug not being able to select another streaming type

* add correct arg type

* remove unused import

(cherry picked from commit b3c0e7e977)

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2023-02-24 08:21:25 -05:00
committed by GitHub
co-authored by Sven Grossmann
parent f18c84af5a
commit 65c2b4fea2
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
import React, { ChangeEvent, FormEvent, useMemo } from 'react';
import React, { FormEvent, useMemo } from 'react';
import { useAsync } from 'react-use';
import { QueryEditorProps, SelectableValue } from '@grafana/data';
@@ -138,8 +138,8 @@ export const QueryEditor = ({ query, datasource, onChange, onRunQuery }: Props)
onUpdate({ ...query, [name]: newValue });
};
const onFieldChange = (field: string) => (e: ChangeEvent<HTMLInputElement>) => {
const { name, value, type } = e.currentTarget;
const onFieldChange = (field: string) => (e: { target: { name: string; value: string; type: string } }) => {
const { name, value, type } = e.target;
let newValue: any = value;
if (type === 'number') {
+2 -2
View File
@@ -151,8 +151,8 @@ export function runLogsStream(
let timeoutId: any = null;
const pushNextEvent = () => {
data.fields[0].values.add(Date.now());
data.fields[1].values.add(getRandomLine());
data.fields[0].values.add(getRandomLine());
data.fields[1].values.add(Date.now());
subscriber.next({
data: [data],