Alerting: misc ui fixes volume 4 (#34503)

This commit is contained in:
Domas
2021-05-25 10:26:10 +03:00
committed by GitHub
parent 1d3bcb0e90
commit d666defaea
11 changed files with 86 additions and 55 deletions

View File

@@ -66,8 +66,14 @@ export const AlertRuleForm: FC<Props> = ({ existing }) => {
values: {
...defaultValues,
...values,
annotations: values.annotations?.filter(({ key, value }) => !!key && !!value) ?? [],
labels: values.labels?.filter(({ key }) => !!key) ?? [],
annotations:
values.annotations
?.map(({ key, value }) => ({ key: key.trim(), value: value.trim() }))
.filter(({ key, value }) => !!key && !!value) ?? [],
labels:
values.labels
?.map(({ key, value }) => ({ key: key.trim(), value: value.trim() }))
.filter(({ key }) => !!key) ?? [],
},
existing,
redirectOnSave: exitOnSave ? returnTo : undefined,