Alerting: Allow clearing namespace and group filter (#104376)

allow clearing namespace and group filter
provisioning/job-errors
Sonia Aguilar 4 weeks ago committed by GitHub
parent 5a50c76f58
commit 9a7cb96eb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      public/app/features/alerting/unified/components/import-to-gma/NamespaceAndGroupFilter.tsx

@ -59,7 +59,7 @@ export const NamespaceAndGroupFilter = ({ rulesSourceName }: Props) => {
{...field}
onChange={(value) => {
setValue('ruleGroup', ''); //reset if namespace changes
onChange(value.value);
onChange(value?.value);
}}
id="namespace-picker"
placeholder={t('alerting.namespace-and-group-filter.select-namespace', 'Select namespace')}
@ -67,6 +67,7 @@ export const NamespaceAndGroupFilter = ({ rulesSourceName }: Props) => {
width={42}
loading={isLoading}
disabled={isLoading || !rulesSourceName}
isClearable
/>
)}
name="namespace"
@ -88,12 +89,13 @@ export const NamespaceAndGroupFilter = ({ rulesSourceName }: Props) => {
options={groupOptions}
width={42}
onChange={(value) => {
setValue('ruleGroup', value.value ?? '');
setValue('ruleGroup', value?.value ?? '');
}}
id="group-picker"
placeholder={t('alerting.namespace-and-group-filter.select-group', 'Select group')}
loading={isLoading}
disabled={isLoading || !namespace || !rulesSourceName}
isClearable
/>
)}
name="ruleGroup"

Loading…
Cancel
Save