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
This commit is contained in:
Sven Grossmann
2023-02-24 14:13:56 +01:00
committed by GitHub
parent 6e39b7403d
commit b3c0e7e977
2 changed files with 5 additions and 5 deletions

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') {

View File

@@ -151,8 +151,8 @@ export function runLogsStream(
let timeoutId: ReturnType<typeof setTimeout>;
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],