[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>
pull/86685/head
grafana-delivery-bot[bot] 1 year ago committed by GitHub
parent cf7c563735
commit 3d3a4b528a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts

@ -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,
],

Loading…
Cancel
Save