mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Update dashboard loki query editor (#37541)
This commit is contained in:
parent
cc7c54be0e
commit
a0f94866b4
@ -8,7 +8,7 @@ import { LokiOptionFields } from './LokiOptionFields';
|
||||
import { LokiQueryEditorProps } from './types';
|
||||
|
||||
export function LokiQueryEditor(props: LokiQueryEditorProps) {
|
||||
const { query, data, datasource, onChange, onRunQuery } = props;
|
||||
const { query, data, datasource, onChange, onRunQuery, range } = props;
|
||||
|
||||
const onLegendChange = (e: React.SyntheticEvent<HTMLInputElement>) => {
|
||||
const nextQuery = { ...query, legendFormat: e.currentTarget.value };
|
||||
@ -47,6 +47,7 @@ export function LokiQueryEditor(props: LokiQueryEditorProps) {
|
||||
history={[]}
|
||||
data={data}
|
||||
data-testid={testIds.editor}
|
||||
range={range}
|
||||
ExtraFieldElement={
|
||||
<>
|
||||
<LokiOptionFields
|
||||
|
@ -56,6 +56,12 @@ exports[`Render LokiQueryEditor with legend should render 1`] = `
|
||||
"refId": "A",
|
||||
}
|
||||
}
|
||||
range={
|
||||
Object {
|
||||
"from": "2020-01-01T00:00:00.000Z",
|
||||
"to": "2020-01-02T00:00:00.000Z",
|
||||
}
|
||||
}
|
||||
/>
|
||||
`;
|
||||
|
||||
@ -115,5 +121,11 @@ exports[`Render LokiQueryEditor with legend should update timerange 1`] = `
|
||||
"refId": "A",
|
||||
}
|
||||
}
|
||||
range={
|
||||
Object {
|
||||
"from": "2019-01-01T00:00:00.000Z",
|
||||
"to": "2020-01-02T00:00:00.000Z",
|
||||
}
|
||||
}
|
||||
/>
|
||||
`;
|
||||
|
Loading…
Reference in New Issue
Block a user