mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* add new monaco callback to update onBlurRef with current value on monaco editor change. * don't overload onBlur, create new onChange tracker that doesn't initiate queries, just updates values * Update public/app/plugins/datasource/prometheus/components/monaco-query-field/MonacoQueryField.tsx Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
20 lines
686 B
TypeScript
20 lines
686 B
TypeScript
import { HistoryItem } from '@grafana/data';
|
|
|
|
import type PromQlLanguageProvider from '../../language_provider';
|
|
import { PromQuery } from '../../types';
|
|
|
|
// we need to store this in a separate file,
|
|
// because we have an async-wrapper around,
|
|
// the react-component, and it needs the same
|
|
// props as the sync-component.
|
|
export type Props = {
|
|
initialValue: string;
|
|
languageProvider: PromQlLanguageProvider;
|
|
history: Array<HistoryItem<PromQuery>>;
|
|
placeholder: string;
|
|
onRunQuery: (value: string) => void;
|
|
onBlur: (value: string) => void;
|
|
// onChange will never initiate a query, it just denotes that a query value has been changed
|
|
onChange: (value: string) => void;
|
|
};
|