mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prometheus: monaco: handle in-dashboard and in-explore use cases (#40922)
* prometheus: monaco: handle in-dashboard and in-explore use cases * refactor is-explore handling * improved comment * removed unnecessary comment * reordered props * simplify code * refactor: better prop-name * fixed test snapshot
This commit is contained in:
@@ -19,10 +19,10 @@ import { LanguageMap, languages as prismLanguages } from 'prismjs';
|
||||
import { PromQuery, PromOptions } from '../types';
|
||||
import { roundMsToMin } from '../language_utils';
|
||||
import { CancelablePromise, makePromiseCancelable } from 'app/core/utils/CancelablePromise';
|
||||
import { QueryEditorProps, QueryHint, isDataFrame, toLegacyResponseData, TimeRange } from '@grafana/data';
|
||||
import { QueryEditorProps, QueryHint, isDataFrame, toLegacyResponseData, TimeRange, CoreApp } from '@grafana/data';
|
||||
import { PrometheusDatasource } from '../datasource';
|
||||
import { PrometheusMetricsBrowser } from './PrometheusMetricsBrowser';
|
||||
import { MonacoQueryFieldLazy } from './monaco-query-field/MonacoQueryFieldLazy';
|
||||
import { MonacoQueryFieldWrapper } from './monaco-query-field/MonacoQueryFieldWrapper';
|
||||
import { LocalStorageValueProvider } from 'app/core/components/LocalStorageValueProvider';
|
||||
|
||||
export const RECORDING_RULES_GROUP = '__recording_rules__';
|
||||
@@ -298,7 +298,8 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
|
||||
<div className="gf-form gf-form--grow flex-shrink-1 min-width-15">
|
||||
{isMonacoEditorEnabled ? (
|
||||
<MonacoQueryFieldLazy
|
||||
<MonacoQueryFieldWrapper
|
||||
runQueryOnBlur={this.props.app !== CoreApp.Explore}
|
||||
languageProvider={languageProvider}
|
||||
history={history}
|
||||
onChange={this.onChangeQuery}
|
||||
|
||||
Reference in New Issue
Block a user