fix: don't allow editing rule types for existing rules (#47512)

This commit is contained in:
Gilles De Mey 2022-04-08 15:26:33 +02:00 committed by GitHub
parent b31c7d3654
commit c530100d45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,12 +38,8 @@ export const AlertTypeStep: FC<Props> = ({ editingExistingRule }) => {
return (
<RuleEditorSection stepNo={1} title="Rule type">
<Field
disabled={editingExistingRule}
error={errors.type?.message}
invalid={!!errors.type?.message}
data-testid="alert-type-picker"
>
{!editingExistingRule && (
<Field error={errors.type?.message} invalid={!!errors.type?.message} data-testid="alert-type-picker">
<InputControl
render={({ field: { onChange } }) => (
<RuleTypePicker
@ -59,6 +55,7 @@ export const AlertTypeStep: FC<Props> = ({ editingExistingRule }) => {
}}
/>
</Field>
)}
<Field
className={styles.formInput}