From a44ac0ed633897860167132acdcf8754c4570800 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Mon, 22 May 2023 11:43:12 +0200 Subject: [PATCH] Alerting: Add additional contact points for external AM (#67920) --- .../notification-policies/Policy.tsx | 1 + .../receivers/form/fields/OptionField.tsx | 2 + .../cloud-alertmanager-notifier-types.ts | 162 +++++++++++++++++- .../plugins/datasource/alertmanager/consts.ts | 4 + public/app/types/alerting.ts | 12 +- 5 files changed, 176 insertions(+), 5 deletions(-) diff --git a/public/app/features/alerting/unified/components/notification-policies/Policy.tsx b/public/app/features/alerting/unified/components/notification-policies/Policy.tsx index 6fbeba09612..094a80a1ba1 100644 --- a/public/app/features/alerting/unified/components/notification-policies/Policy.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/Policy.tsx @@ -464,6 +464,7 @@ const INTEGRATION_ICONS: Record = { telegram: 'telegram-alt', }; +// @TODO make this work for cloud AMs too const ContactPointsHoverDetails: FC = ({ alertManagerSourceName, contactPoint, diff --git a/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx b/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx index 88bafbda80f..7c2f05c34bd 100644 --- a/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/fields/OptionField.tsx @@ -115,6 +115,7 @@ const OptionInput: FC = ({ {...register(name, { required: determineRequired(option, getValues, pathIndex), validate: (v) => (option.validationRule !== '' ? validateOption(v, option.validationRule) : true), + setValueAs: option.setValueAs, })} placeholder={option.placeholder} /> @@ -127,6 +128,7 @@ const OptionInput: FC = ({