diff --git a/public/app/features/alerting/unified/NotificationPolicies.tsx b/public/app/features/alerting/unified/NotificationPolicies.tsx index d09f48e8fb5..eacc9c37e88 100644 --- a/public/app/features/alerting/unified/NotificationPolicies.tsx +++ b/public/app/features/alerting/unified/NotificationPolicies.tsx @@ -200,7 +200,7 @@ const AmRoutes = () => { updatingTree ); const [deleteModal, openDeleteModal, closeDeleteModal] = useDeletePolicyModal(handleDelete, updatingTree); - const [alertInstancesModal, showAlertGroupsModal] = useAlertGroupsModal(); + const [alertInstancesModal, showAlertGroupsModal] = useAlertGroupsModal(selectedAlertmanager ?? ''); useCleanup((state) => (state.unifiedAlerting.saveAMConfig = initialAsyncRequestState)); diff --git a/public/app/features/alerting/unified/components/notification-policies/Modals.tsx b/public/app/features/alerting/unified/components/notification-policies/Modals.tsx index 08b9b8d3aa4..7c79ea2795b 100644 --- a/public/app/features/alerting/unified/components/notification-policies/Modals.tsx +++ b/public/app/features/alerting/unified/components/notification-policies/Modals.tsx @@ -212,11 +212,9 @@ const useDeletePolicyModal = (handleDelete: (route: RouteWithID) => void, loadin return [modalElement, handleShow, handleDismiss]; }; -const useAlertGroupsModal = (): [ - JSX.Element, - (alertGroups: AlertmanagerGroup[], matchers?: ObjectMatcher[]) => void, - () => void, -] => { +const useAlertGroupsModal = ( + alertManagerSourceName: string +): [JSX.Element, (alertGroups: AlertmanagerGroup[], matchers?: ObjectMatcher[]) => void, () => void] => { const [showModal, setShowModal] = useState(false); const [alertGroups, setAlertGroups] = useState([]); const [matchers, setMatchers] = useState([]); @@ -271,7 +269,7 @@ const useAlertGroupsModal = (): [ />
{alertGroups.map((group, index) => ( - + ))}
@@ -282,7 +280,7 @@ const useAlertGroupsModal = (): [ ), - [alertGroups, handleDismiss, instancesByState, matchers, formatter, showModal] + [alertGroups, handleDismiss, instancesByState, matchers, formatter, showModal, alertManagerSourceName] ); return [modalElement, handleShow, handleDismiss];