Skip to content

Commit 4b789c9

Browse files
committed
Add tooltip and summary text
1 parent 762e4c7 commit 4b789c9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

grafana/fire-datasource/src/QueryEditor/QueryOptions.tsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import { useToggle } from 'react-use';
44

55
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';
77
import { Query, SeriesMessage } from '../types';
88
import { Stack } from './Stack';
99

@@ -59,20 +59,30 @@ export function QueryOptions({ query, onQueryChange, app, series }: Props) {
5959
<h6 className={styles.title}>Options</h6>
6060
{!isOpen && (
6161
<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>
6366
</div>
6467
)}
6568
</div>
6669
{isOpen && (
6770
<div className={styles.body}>
68-
<Field label={'Query Type'}>
71+
<EditorField label={'Query Type'}>
6972
<RadioButtonGroup
7073
options={typeOptions}
7174
value={query.queryType}
7275
onChange={(value) => onQueryChange({ ...query, queryType: value })}
7376
/>
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+
>
7686
<MultiSelect
7787
placeholder="Label"
7888
value={query.groupBy}
@@ -85,7 +95,7 @@ export function QueryOptions({ query, onQueryChange, app, series }: Props) {
8595
onQueryChange({ ...query, groupBy: changes });
8696
}}
8797
/>
88-
</Field>
98+
</EditorField>
8999
</div>
90100
)}
91101
</Stack>

0 commit comments

Comments
 (0)