mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki: Fix input history (#57344)
This commit is contained in:
parent
7ecbc98b3e
commit
3d7439d97d
@ -18,7 +18,7 @@ type Props = LokiQueryEditorProps & {
|
||||
};
|
||||
|
||||
export const LokiAnnotationsQueryEditor = memo(function LokiAnnotationQueryEditor(props: Props) {
|
||||
const { annotation, onAnnotationChange } = props;
|
||||
const { annotation, onAnnotationChange, history } = props;
|
||||
|
||||
// this should never happen, but we want to keep typescript happy
|
||||
if (annotation === undefined || onAnnotationChange === undefined) {
|
||||
@ -56,7 +56,7 @@ export const LokiAnnotationsQueryEditor = memo(function LokiAnnotationQueryEdito
|
||||
onChange={onChangeQuery}
|
||||
onRunQuery={() => {}}
|
||||
onBlur={() => {}}
|
||||
history={[]}
|
||||
history={history}
|
||||
ExtraFieldElement={
|
||||
<LokiOptionFields
|
||||
lineLimitValue={queryWithRefId?.maxLines?.toString() || ''}
|
||||
|
@ -4,7 +4,7 @@ import { LokiQueryField } from './LokiQueryField';
|
||||
import { LokiQueryEditorProps } from './types';
|
||||
|
||||
export function LokiQueryEditorForAlerting(props: LokiQueryEditorProps) {
|
||||
const { query, data, datasource, onChange, onRunQuery } = props;
|
||||
const { query, data, datasource, onChange, onRunQuery, history } = props;
|
||||
|
||||
return (
|
||||
<LokiQueryField
|
||||
@ -13,7 +13,7 @@ export function LokiQueryEditorForAlerting(props: LokiQueryEditorProps) {
|
||||
onChange={onChange}
|
||||
onRunQuery={onRunQuery}
|
||||
onBlur={onRunQuery}
|
||||
history={[]}
|
||||
history={history}
|
||||
data={data}
|
||||
placeholder="Enter a Loki query"
|
||||
data-testid={testIds.editor}
|
||||
|
@ -14,7 +14,17 @@ type Props = LokiQueryEditorProps & {
|
||||
showExplain: boolean;
|
||||
};
|
||||
|
||||
export function LokiQueryCodeEditor({ query, datasource, range, onRunQuery, onChange, data, app, showExplain }: Props) {
|
||||
export function LokiQueryCodeEditor({
|
||||
query,
|
||||
datasource,
|
||||
range,
|
||||
onRunQuery,
|
||||
onChange,
|
||||
data,
|
||||
app,
|
||||
showExplain,
|
||||
history,
|
||||
}: Props) {
|
||||
const styles = useStyles2(getStyles);
|
||||
|
||||
// the inner QueryField works like this when a blur event happens:
|
||||
@ -35,7 +45,7 @@ export function LokiQueryCodeEditor({ query, datasource, range, onRunQuery, onCh
|
||||
onRunQuery={onRunQuery}
|
||||
onChange={onChange}
|
||||
onBlur={onBlur}
|
||||
history={[]}
|
||||
history={history}
|
||||
data={data}
|
||||
app={app}
|
||||
data-testid={testIds.editor}
|
||||
|
Loading…
Reference in New Issue
Block a user