@@ -3,7 +3,7 @@ import React from 'react';
3
3
import { useToggle } from 'react-use' ;
4
4
5
5
import { CoreApp , GrafanaTheme2 , SelectableValue } from '@grafana/data' ;
6
- import { Icon , useStyles2 , RadioButtonGroup , Field , MultiSelect } from '@grafana/ui' ;
6
+ import { Icon , useStyles2 , RadioButtonGroup , Field , MultiSelect , EditorField } from '@grafana/ui' ;
7
7
import { Query , SeriesMessage } from '../types' ;
8
8
import { Stack } from './Stack' ;
9
9
@@ -59,20 +59,30 @@ export function QueryOptions({ query, onQueryChange, app, series }: Props) {
59
59
< h6 className = { styles . title } > Options</ h6 >
60
60
{ ! isOpen && (
61
61
< div className = { styles . description } >
62
- < span > Type: { query . queryType } </ span >
62
+ < span >
63
+ Type: { query . queryType }
64
+ { query . groupBy ?. length ? `, Group by: ${ query . groupBy . join ( ', ' ) } ` : '' }
65
+ </ span >
63
66
</ div >
64
67
) }
65
68
</ div >
66
69
{ isOpen && (
67
70
< div className = { styles . body } >
68
- < Field label = { 'Query Type' } >
71
+ < EditorField label = { 'Query Type' } >
69
72
< RadioButtonGroup
70
73
options = { typeOptions }
71
74
value = { query . queryType }
72
75
onChange = { ( value ) => onQueryChange ( { ...query , queryType : value } ) }
73
76
/>
74
- </ Field >
75
- < Field label = { 'Group by' } >
77
+ </ EditorField >
78
+ < EditorField
79
+ label = { 'Group by' }
80
+ tooltip = {
81
+ < >
82
+ Used to group the metric result by a specific label or set of labels. Does not apply to profile query.
83
+ </ >
84
+ }
85
+ >
76
86
< MultiSelect
77
87
placeholder = "Label"
78
88
value = { query . groupBy }
@@ -85,7 +95,7 @@ export function QueryOptions({ query, onQueryChange, app, series }: Props) {
85
95
onQueryChange ( { ...query , groupBy : changes } ) ;
86
96
} }
87
97
/>
88
- </ Field >
98
+ </ EditorField >
89
99
</ div >
90
100
) }
91
101
</ Stack >
0 commit comments