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 43579acbcc7..aa5e9afa9f1 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 @@ -37,7 +37,7 @@ import { isExpressionQueryInAlert, } from '../../../rule-editor/formProcessing'; import { RuleFormType, RuleFormValues } from '../../../types/rule-form'; -import { getDefaultOrFirstCompatibleDataSource } from '../../../utils/datasource'; +import { GRAFANA_RULES_SOURCE_NAME, getDefaultOrFirstCompatibleDataSource } from '../../../utils/datasource'; import { PromOrLokiQuery, isPromOrLokiQuery } from '../../../utils/rule-form'; import { isCloudAlertingRuleByType, @@ -422,7 +422,7 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange, mod const typeInForm = getValues('type'); if (typeInForm === RuleFormType.cloudAlerting) { setValue('type', RuleFormType.grafana); - setValue('dataSourceName', null); // set data source name back to "null" + setValue('dataSourceName', GRAFANA_RULES_SOURCE_NAME); prevExpressions.length > 0 && restoreExpressionsInQueries(); prevCondition && setValue('condition', prevCondition);