diff --git a/public/app/features/alerting/unified/components/alert-groups/MatcherFilter.tsx b/public/app/features/alerting/unified/components/alert-groups/MatcherFilter.tsx index e28f34f8be1..3abd20de39f 100644 --- a/public/app/features/alerting/unified/components/alert-groups/MatcherFilter.tsx +++ b/public/app/features/alerting/unified/components/alert-groups/MatcherFilter.tsx @@ -2,6 +2,7 @@ import React, { FormEvent } from 'react'; import { Label, Tooltip, Input, Icon, useStyles2 } from '@grafana/ui'; import { GrafanaTheme2 } from '@grafana/data'; import { css } from '@emotion/css'; +import { Stack } from '@grafana/experimental'; interface Props { className?: string; @@ -20,17 +21,19 @@ export const MatcherFilter = ({ className, onFilterChange, defaultQueryString, q return (
- } - > - - - Search by label + + Search by label + + Filter alerts using label querying, ex: +
{`{severity="critical", instance=~"cluster-us-.+"}`}
+ + } + > + +
+
{ const searchIcon = ; return (
-
- + { onChange={handleDataSourceChange} onClear={clearDataSource} /> -
+
-
-
- } - > - - - Search by label - + + + Search by label + + Filter rules and alerts using label querying, ex: + {`{severity="critical", instance=~"cluster-us-.+"}`} +
+ } + > + + + + + } + > { placeholder="Search" data-testid="search-query-input" /> -
+
@@ -169,12 +175,8 @@ const getStyles = (theme: GrafanaTheme) => { container: css` display: flex; flex-direction: column; - border-bottom: 1px solid ${theme.colors.border1}; padding-bottom: ${theme.spacing.sm}; - - & > div { - margin-bottom: ${theme.spacing.sm}; - } + margin-bottom: ${theme.spacing.sm}; `, inputWidth: css` width: 340px; @@ -191,11 +193,7 @@ const getStyles = (theme: GrafanaTheme) => { justify-content: space-between; `, rowChild: css` - margin-right: ${theme.spacing.sm}; - margin-top: ${theme.spacing.sm}; - `, - tooltip: css` - margin: 0 ${theme.spacing.xs}; + margin: 0 ${theme.spacing.sm} 0 0; `, clearButton: css` margin-top: ${theme.spacing.sm}; diff --git a/public/app/features/alerting/unified/components/silences/SilencesFilter.tsx b/public/app/features/alerting/unified/components/silences/SilencesFilter.tsx index c6d77d194d9..377a06bc63d 100644 --- a/public/app/features/alerting/unified/components/silences/SilencesFilter.tsx +++ b/public/app/features/alerting/unified/components/silences/SilencesFilter.tsx @@ -7,6 +7,7 @@ import { getSilenceFiltersFromUrlParams } from '../../utils/misc'; import { SilenceState } from 'app/plugins/datasource/alertmanager/types'; import { parseMatchers } from '../../utils/alertmanager'; import { debounce, uniqueId } from 'lodash'; +import { Stack } from '@grafana/experimental'; const stateOptions: SelectableValue[] = Object.entries(SilenceState).map(([key, value]) => ({ label: key, @@ -45,19 +46,21 @@ export const SilencesFilter = () => { - - Filter silences by matchers using a comma separated list of matchers, ie: -
{`severity=critical, instance=~cluster-us-.+`}
-
- } - > - - {' '} - Search by matchers - +
+ } + > + + + + } invalid={inputInvalid} error={inputInvalid ? 'Query must use valid matcher syntax' : null} @@ -72,11 +75,9 @@ export const SilencesFilter = () => { data-testid="search-query-input" /> - -
- + -
+ {(queryString || silenceState) && (