mirror of
https://github.com/grafana/grafana.git
synced 2025-09-26 21:33:44 +08:00

* Adding simplified version of query editor based on app flag. * cleaned up the absolute time range. * changing placeholder text. * updated snapshot. * added some tests. * adding loki query editor tests. * updating snapshots.
26 lines
626 B
TypeScript
26 lines
626 B
TypeScript
import React from 'react';
|
|
import { LokiQueryField } from './LokiQueryField';
|
|
import { LokiQueryEditorProps } from './types';
|
|
|
|
export function LokiQueryEditorForAlerting(props: LokiQueryEditorProps) {
|
|
const { query, data, datasource, onChange, onRunQuery } = props;
|
|
|
|
return (
|
|
<LokiQueryField
|
|
datasource={datasource}
|
|
query={query}
|
|
onChange={onChange}
|
|
onRunQuery={onRunQuery}
|
|
onBlur={onRunQuery}
|
|
history={[]}
|
|
data={data}
|
|
placeholder="Enter a Loki query"
|
|
data-testid={testIds.editor}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export const testIds = {
|
|
editor: 'loki-editor-cloud-alerting',
|
|
};
|