[v11.0.x] Alerting: Fix max_alerts field handling (#86673)

Alerting: Fix max_alerts field handling (#86651)

Fix max_alerts field parsing

(cherry picked from commit 1b930c341d)

Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com>
This commit is contained in:
grafana-delivery-bot[bot]
2024-04-22 13:38:20 +02:00
committed by GitHub
co-authored by Konrad Lalik
parent cf7c563735
commit 3d3a4b528a
@@ -320,7 +320,11 @@ export const cloudNotifierTypes: Array<NotifierDTO<CloudNotifierType>> = [
'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,
],