Alerting: Allow clearing namespace and group filter (#104376)
allow clearing namespace and group filter
This commit is contained in:
+4
-2
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user