[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 04b5e6ed9e)

Co-authored-by: Sonia Aguilar <33540275+soniaAguilarPeiron@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2023-01-17 11:37:14 +01:00
committed by GitHub
co-authored by Sonia Aguilar
parent fe6088e60e
commit cda38a1ca4
@@ -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 }));
}
};