diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx index b99fcac732a..f68296b6fbb 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx @@ -320,7 +320,7 @@ export const AlertRuleForm = ({ existing, prefill, isManualRestore }: Props) => {/* Step 1 */} {/* Step 2 */} - + {/* Step 3-4-5 */} {showDataSourceDependantStep && ( <> diff --git a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx index 8b867293622..32e4fd72f13 100644 --- a/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/alert-rule-form/ModifyExportRuleForm.tsx @@ -100,7 +100,7 @@ export function ModifyExportRuleForm({ ruleForm, alertUid }: ModifyExportRuleFor {/* Step 1 */} {/* Step 2 */} - + {/* Step 3-4-5 */} diff --git a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx index 20d3359a03e..b32219a4fb6 100644 --- a/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx @@ -77,9 +77,15 @@ import { useAlertQueryRunner } from './useAlertQueryRunner'; interface Props { editingExistingRule: boolean; onDataChange: (error: string) => void; + /** + * The mode of the rule editor. + * - 'edit' standard rule editor mode + * - 'draft' non-saveable form mode used for exporting to provisioning formats + */ + mode: 'edit' | 'draft'; } -export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: Props) => { +export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange, mode }: Props) => { const { setValue, getValues, @@ -515,12 +521,14 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P }} /> - + {mode === 'edit' && ( + + )} )} @@ -555,7 +563,7 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P )} {/* We only show Switch for Grafana managed alerts */} - {isGrafanaAlertingType && !simplifiedQueryStep && ( + {isGrafanaAlertingType && !simplifiedQueryStep && mode === 'edit' && (