From 1b930c341db0b8bc46c8793cc2415f67fc4cbfb9 Mon Sep 17 00:00:00 2001 From: Konrad Lalik Date: Mon, 22 Apr 2024 12:25:04 +0200 Subject: [PATCH] Alerting: Fix max_alerts field handling (#86651) Fix max_alerts field parsing --- .../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, ],