mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
Alerting: Fix contact points url field validation (#74510)
This commit is contained in:
parent
a6aa8f46d1
commit
8b00d7d7af
@ -20,6 +20,7 @@ import {
|
||||
updateConfigWithReceiver,
|
||||
} from '../../../utils/receiver-form';
|
||||
import { ProvisionedResource, ProvisioningAlert } from '../../Provisioning';
|
||||
import { ReceiverTypes } from '../grafanaAppReceivers/onCall/onCall';
|
||||
import { useOnCallIntegration } from '../grafanaAppReceivers/onCall/useOnCallIntegration';
|
||||
|
||||
import { GrafanaCommonChannelSettings } from './GrafanaCommonChannelSettings';
|
||||
@ -167,7 +168,7 @@ export const GrafanaReceiverForm = ({ existing, alertManagerSourceName, config }
|
||||
defaultItem={{ ...defaultChannelValues }}
|
||||
takenReceiverNames={takenReceiverNames}
|
||||
commonSettingsComponent={GrafanaCommonChannelSettings}
|
||||
customValidators={onCallFormValidators}
|
||||
customValidators={{ [ReceiverTypes.OnCall]: onCallFormValidators }}
|
||||
/>
|
||||
<TestContactPointModal
|
||||
onDismiss={() => setTestChannelValues(undefined)}
|
||||
|
@ -34,7 +34,7 @@ interface Props<R extends ChannelValues> {
|
||||
initialValues?: ReceiverFormValues<R>;
|
||||
isEditable: boolean;
|
||||
isTestable?: boolean;
|
||||
customValidators?: React.ComponentProps<typeof ChannelSubForm>['customValidators'];
|
||||
customValidators?: Record<string, React.ComponentProps<typeof ChannelSubForm>['customValidators']>;
|
||||
}
|
||||
|
||||
export function ReceiverForm<R extends ChannelValues>({
|
||||
@ -167,7 +167,7 @@ export function ReceiverForm<R extends ChannelValues>({
|
||||
commonSettingsComponent={commonSettingsComponent}
|
||||
isEditable={isEditable}
|
||||
isTestable={isTestable}
|
||||
customValidators={customValidators}
|
||||
customValidators={customValidators ? customValidators[field.type] : undefined}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
Loading…
Reference in New Issue
Block a user