From f5b545bf288ba9b327c34531361727ebcea9f961 Mon Sep 17 00:00:00 2001 From: "grafana-delivery-bot[bot]" <132647405+grafana-delivery-bot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:38:41 +0200 Subject: [PATCH] [v10.4.x] Alerting: Fix max_alerts field handling (#86672) Alerting: Fix max_alerts field handling (#86651) Fix max_alerts field parsing (cherry picked from commit 1b930c341db0b8bc46c8793cc2415f67fc4cbfb9) Co-authored-by: Konrad Lalik --- .../unified/utils/cloud-alertmanager-notifier-types.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts index 494e9ef231c..e8100e9aba9 100644 --- a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts +++ b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts @@ -320,7 +320,11 @@ export const cloudNotifierTypes: Array> = [ 'max_alerts', 'Max alerts', 'The maximum number of alerts to include in a single webhook message. Alerts above this threshold are truncated. When leaving this at its default value of 0, all alerts are included.', - { placeholder: '0', validationRule: '(^\\d+$|^$)' } + { + placeholder: '0', + validationRule: '(^\\d+$|^$)', + setValueAs: (value) => (typeof value === 'string' ? parseInt(value, 10) : 0), + } ), httpConfigOption, ],