mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: make alert state indicator in panel header work with Grafana 8 alerts (#38713)
This commit is contained in:
@@ -130,7 +130,7 @@ export const AlertTypeStep: FC<Props> = ({ editingExistingRule }) => {
|
||||
)}
|
||||
</div>
|
||||
{(ruleFormType === RuleFormType.cloudRecording || ruleFormType === RuleFormType.cloudAlerting) &&
|
||||
dataSourceName && <GroupAndNamespaceFields dataSourceName={dataSourceName} />}
|
||||
dataSourceName && <GroupAndNamespaceFields rulesSourceName={dataSourceName} />}
|
||||
|
||||
{ruleFormType === RuleFormType.grafana && (
|
||||
<Field
|
||||
|
||||
@@ -10,10 +10,10 @@ import { Field, InputControl, useStyles2 } from '@grafana/ui';
|
||||
import { css } from '@emotion/css';
|
||||
|
||||
interface Props {
|
||||
dataSourceName: string;
|
||||
rulesSourceName: string;
|
||||
}
|
||||
|
||||
export const GroupAndNamespaceFields: FC<Props> = ({ dataSourceName }) => {
|
||||
export const GroupAndNamespaceFields: FC<Props> = ({ rulesSourceName }) => {
|
||||
const {
|
||||
control,
|
||||
watch,
|
||||
@@ -28,10 +28,10 @@ export const GroupAndNamespaceFields: FC<Props> = ({ dataSourceName }) => {
|
||||
const rulerRequests = useUnifiedAlertingSelector((state) => state.rulerRules);
|
||||
const dispatch = useDispatch();
|
||||
useEffect(() => {
|
||||
dispatch(fetchRulerRulesAction(dataSourceName));
|
||||
}, [dataSourceName, dispatch]);
|
||||
dispatch(fetchRulerRulesAction({ rulesSourceName }));
|
||||
}, [rulesSourceName, dispatch]);
|
||||
|
||||
const rulesConfig = rulerRequests[dataSourceName]?.result;
|
||||
const rulesConfig = rulerRequests[rulesSourceName]?.result;
|
||||
|
||||
const namespace = watch('namespace');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user