diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/FromSection.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/FromSection.tsx index 31cc1b34179..b0c8f42a432 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/FromSection.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/FromSection.tsx @@ -1,5 +1,7 @@ import React from 'react'; +import { AccessoryButton } from '@grafana/experimental'; + import { DEFAULT_POLICY } from '../../../../../types'; import { toSelectableValue } from '../utils/toSelectableValue'; @@ -65,6 +67,17 @@ export const FromSection = ({ onChange(policy, v.value); }} /> + {measurement && ( + { + onChange(policy, undefined); + }} + /> + )} ); }; diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx index 776b6af572e..ae5c5f9cbf3 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx @@ -2,6 +2,7 @@ import { css, cx } from '@emotion/css'; import React, { useMemo } from 'react'; import { GrafanaTheme2, SelectableValue } from '@grafana/data'; +import { AccessoryButton } from '@grafana/experimental'; import { MenuGroup, MenuItem, useTheme2, WithContextMenu } from '@grafana/ui'; import { toSelectableValue } from '../utils/toSelectableValue'; @@ -125,17 +126,27 @@ export const PartListSection = ({ return ( <> {parts.map((part, index) => ( - { - onRemovePart(index); - }} - onChange={(pars) => { - onChange(index, pars); - }} - /> + + { + onRemovePart(index); + }} + onChange={(pars) => { + onChange(index, pars); + }} + /> + { + onRemovePart(index); + }} + /> + ))} diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/TagsSection.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/TagsSection.tsx index a64c27b9e1e..983c2d5fb07 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/TagsSection.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/TagsSection.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { SelectableValue } from '@grafana/data'; +import { AccessoryButton } from '@grafana/experimental'; import { InfluxQueryTag } from '../../../../../types'; import { adjustOperatorIfNeeded, getCondition, getOperator } from '../utils/tagUtils'; @@ -56,7 +57,7 @@ const Tag = ({ tag, isFirst, onRemove, onChange, getTagKeyOptions, getTagValueOp console.error(err); return []; }) - .then((tags) => [{ label: '-- remove filter --', value: undefined }, ...tags.map(toSelectableValue)]); + .then((tags) => tags.map(toSelectableValue)); }; const getTagValueSegmentOptions = () => { @@ -103,6 +104,15 @@ const Tag = ({ tag, isFirst, onRemove, onChange, getTagKeyOptions, getTagValueOp onChange({ ...tag, value, operator: adjustOperatorIfNeeded(operator, value) }); }} /> + { + onRemove(); + }} + /> ); };