Monaco: add suggestions for template variables (#25921)

* now with suggestions

* using suggestions API

* using variable suggestions

* using variable suggestions

* show variables

* minor cleanup

* add @alpha warning

* Do not produce data variables if panel does not support queries

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Ryan McKinley
2020-07-01 00:36:34 -07:00
committed by GitHub
parent df72344d3c
commit bbd24cd93a
10 changed files with 279 additions and 39 deletions

View File

@ -1,9 +1,7 @@
import React from 'react';
import { useAsyncDependency } from '../../utils/useAsyncDependency';
import { ErrorWithStack, LoadingPlaceholder } from '..';
import { CodeEditorProps } from './CodeEditor';
export type CodeEditorChangeHandler = (value: string) => void;
import { CodeEditorProps } from './types';
export const CodeEditor: React.FC<CodeEditorProps> = props => {
const { loading, error, dependency } = useAsyncDependency(
@ -11,7 +9,7 @@ export const CodeEditor: React.FC<CodeEditorProps> = props => {
);
if (loading) {
return <LoadingPlaceholder text={'Loading...'} />;
return <LoadingPlaceholder text={''} />;
}
if (error) {