diff --git a/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx b/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx index e54d25463f4..291aec0ad02 100644 --- a/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx +++ b/public/app/features/alerting/unified/components/receivers/form/ChannelSubForm.tsx @@ -23,7 +23,8 @@ interface Props { secureFields?: Record; errors?: FieldErrors; onDelete?: () => void; - readOnly?: boolean; + isEditable?: boolean; + isTestable?: boolean; } export function ChannelSubForm({ @@ -36,7 +37,8 @@ export function ChannelSubForm({ errors, secureFields, commonSettingsComponent: CommonSettingsComponent, - readOnly = false, + isEditable = true, + isTestable, }: Props): JSX.Element { const styles = useStyles2(getStyles); const name = (fieldName: string) => `${pathPrefix}${fieldName}`; @@ -89,6 +91,7 @@ export function ChannelSubForm({ const optionalOptions = notifier?.options.filter((o) => !o.required); const contactPointTypeInputId = `contact-point-type-${pathPrefix}`; + return (
@@ -99,7 +102,7 @@ export function ChannelSubForm({ defaultValue={defaultValues.type} render={({ field: { ref, onChange, ...field } }) => ( ({ secureFields={initialItem?.secureFields} errors={errors?.items?.[index] as FieldErrors} commonSettingsComponent={commonSettingsComponent} - readOnly={readOnly} + isEditable={isEditable} + isTestable={isTestable} /> ); })} <> - {!readOnly && ( + {isEditable && ( )}
- {!readOnly && ( + {isEditable && ( <> {loading && (