From c530100d45a7235acc773c43970e8a5d99faede7 Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Fri, 8 Apr 2022 15:26:33 +0200 Subject: [PATCH] fix: don't allow editing rule types for existing rules (#47512) --- .../components/rule-editor/AlertTypeStep.tsx | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/public/app/features/alerting/unified/components/rule-editor/AlertTypeStep.tsx b/public/app/features/alerting/unified/components/rule-editor/AlertTypeStep.tsx index aa2179f2265..b06e7e2497c 100644 --- a/public/app/features/alerting/unified/components/rule-editor/AlertTypeStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/AlertTypeStep.tsx @@ -38,27 +38,24 @@ export const AlertTypeStep: FC = ({ editingExistingRule }) => { return ( - - ( - - )} - name="type" - control={control} - rules={{ - required: { value: true, message: 'Please select alert type' }, - }} - /> - + {!editingExistingRule && ( + + ( + + )} + name="type" + control={control} + rules={{ + required: { value: true, message: 'Please select alert type' }, + }} + /> + + )}