1
1
import React , { useEffect , useState } from 'react' ;
2
- import { InlineField , Input , Alert , Button } from '@grafana/ui' ;
3
-
4
- import { EditorRow , EditorRows } from '@grafana/plugin-ui' ;
2
+ import { InlineField , Input , Alert , Button , InlineFieldRow } from '@grafana/ui' ;
5
3
import { QueryEditorProps } from '@grafana/data' ;
6
4
import { MongoDataSourceOptions , MongoDBQuery , MongoDBVariableQuery , QueryType } from '../types' ;
7
5
import { QueryEditorRaw } from './QueryEditorRaw' ;
@@ -26,8 +24,8 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
26
24
} , [ query ] ) ;
27
25
28
26
return (
29
- < EditorRows >
30
- < EditorRow >
27
+ < div >
28
+ < InlineFieldRow style = { { justifyContent : 'space-between' } } >
31
29
< InlineField
32
30
label = "Collection"
33
31
tooltip = "Name of MongoDB collection to query"
@@ -43,13 +41,16 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
43
41
> </ Input >
44
42
</ InlineField >
45
43
< Button
46
- onClick = { ( ) => {
47
- onChange ( { queryText : queryText , queryType : QueryType . TABLE , refId : refId , collection : collection } ) ;
48
- } }
44
+ icon = "play"
45
+ variant = "primary"
46
+ size = "sm"
47
+ onClick = { ( ) =>
48
+ onChange ( { queryText : queryText , queryType : QueryType . TABLE , refId : refId , collection : collection } )
49
+ }
49
50
>
50
51
Save and Query
51
52
</ Button >
52
- </ EditorRow >
53
+ </ InlineFieldRow >
53
54
< QueryEditorRaw
54
55
query = { queryText }
55
56
language = "json"
@@ -61,6 +62,6 @@ export const VariableQueryEditor = ({ onChange, query }: VariableQueryEditorProp
61
62
The query result is expected to contain < code > value</ code > field which has elements of type < code > string</ code > { ' ' }
62
63
or < code > number</ code >
63
64
</ Alert >
64
- </ EditorRows >
65
+ </ div >
65
66
) ;
66
67
} ;
0 commit comments