From cda38a1ca40f8c7c2130dad6b0012db01465196c Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 17 Jan 2023 11:37:14 +0100 Subject: [PATCH] [v9.3.x] Alerting: Fix group select not being filled by selected folder when creating alert from panel (#61604) Alerting: Fix group select not being filled by selected folder when creating alert from panel (#61577) Add fetchRulerRulesIfNotFetchedYet fetching when results are an empty object (cherry picked from commit 04b5e6ed9e71148957b7d8563c3509e1b1722e74) Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com> --- public/app/features/alerting/unified/state/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/alerting/unified/state/actions.ts b/public/app/features/alerting/unified/state/actions.ts index bde885a5b77..7e04d01ab49 100644 --- a/public/app/features/alerting/unified/state/actions.ts +++ b/public/app/features/alerting/unified/state/actions.ts @@ -257,7 +257,8 @@ export function fetchRulerRulesIfNotFetchedYet(rulesSourceName: string): ThunkRe return (dispatch, getStore) => { const { rulerRules } = getStore().unifiedAlerting; const resp = rulerRules[rulesSourceName]; - if (!resp?.result && !(resp && isRulerNotSupportedResponse(resp)) && !resp?.loading) { + const emptyResults = isEmpty(resp?.result); + if (emptyResults && !(resp && isRulerNotSupportedResponse(resp)) && !resp?.loading) { dispatch(fetchRulerRulesAction({ rulesSourceName })); } };