mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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') {
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user