mirror of
https://github.com/grafana/grafana.git
synced 2025-01-02 12:17:01 -06:00
Alerting: Fix silencing from policy instances (#90417)
Fix silencing from policy instances
This commit is contained in:
parent
aabb4286e3
commit
73336362a8
@ -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));
|
||||
|
||||
|
@ -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<AlertmanagerGroup[]>([]);
|
||||
const [matchers, setMatchers] = useState<ObjectMatcher[]>([]);
|
||||
@ -271,7 +269,7 @@ const useAlertGroupsModal = (): [
|
||||
/>
|
||||
<div>
|
||||
{alertGroups.map((group, index) => (
|
||||
<AlertGroup key={index} alertManagerSourceName={''} group={group} />
|
||||
<AlertGroup key={index} alertManagerSourceName={alertManagerSourceName} group={group} />
|
||||
))}
|
||||
</div>
|
||||
</Stack>
|
||||
@ -282,7 +280,7 @@ const useAlertGroupsModal = (): [
|
||||
</Modal.ButtonRow>
|
||||
</Modal>
|
||||
),
|
||||
[alertGroups, handleDismiss, instancesByState, matchers, formatter, showModal]
|
||||
[alertGroups, handleDismiss, instancesByState, matchers, formatter, showModal, alertManagerSourceName]
|
||||
);
|
||||
|
||||
return [modalElement, handleShow, handleDismiss];
|
||||
|
Loading…
Reference in New Issue
Block a user