mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Set mimir implementation in jsonData by default when creating a new a… (#85513)
Set mimir implementation in jsonData by default when creating a new alert manager data source
This commit is contained in:
parent
b4dc79401b
commit
034931f9e1
@ -1,5 +1,5 @@
|
|||||||
import { produce } from 'immer';
|
import { produce } from 'immer';
|
||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import { SIGV4ConnectionConfig } from '@grafana/aws-sdk';
|
import { SIGV4ConnectionConfig } from '@grafana/aws-sdk';
|
||||||
@ -33,6 +33,17 @@ const IMPL_OPTIONS: Array<SelectableValue<AlertManagerImplementation>> = [
|
|||||||
export const ConfigEditor = (props: Props) => {
|
export const ConfigEditor = (props: Props) => {
|
||||||
const { options, onOptionsChange } = props;
|
const { options, onOptionsChange } = props;
|
||||||
|
|
||||||
|
// As we default to Mimir, we need to make sure the implementation is set from the start
|
||||||
|
useEffect(() => {
|
||||||
|
if (!options.jsonData.implementation) {
|
||||||
|
onOptionsChange(
|
||||||
|
produce(options, (draft) => {
|
||||||
|
draft.jsonData.implementation = AlertManagerImplementation.mimir;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [options, onOptionsChange]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h3 className="page-heading">Alertmanager</h3>
|
<h3 className="page-heading">Alertmanager</h3>
|
||||||
|
Loading…
Reference in New Issue
Block a user