Skip to content

Commit fa2e20a

Browse files
committed
Fix alert edit page
1 parent 1eed783 commit fa2e20a

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/QueryAndExpressionsStep.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ import { RuleEditorSection } from '../RuleEditorSection';
3939
import { errorFromCurrentCondition, errorFromPreviewData, findRenamedDataQueryReferences, refIdExists } from '../util';
4040

4141
import { CloudDataSourceSelector } from './CloudDataSourceSelector';
42-
// LOGZ.IO CHANGE :: DEV-46521 remove rule type switch
43-
// import { SmartAlertTypeDetector } from './SmartAlertTypeDetector';
42+
import { SmartAlertTypeDetector } from './SmartAlertTypeDetector';
4443
import { DESCRIPTIONS } from './descriptions';
4544
import {
4645
addExpressions,
@@ -372,12 +371,6 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P
372371
condition,
373372
]);
374373

375-
// LOGZ.IO CHANGE :: DEV-46521 remove rule type switch. need this useless call
376-
// in order to mitigate the not-in-use error
377-
useEffect(() => {
378-
onClickSwitch();
379-
}, [onClickSwitch]);
380-
381374
const { sectionTitle, helpLabel, helpContent, helpLink } = DESCRIPTIONS[type ?? RuleFormType.grafana];
382375

383376
return (
@@ -438,14 +431,12 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P
438431
}}
439432
/>
440433
</Field>
441-
{/*
442-
// LOGZ.IO CHANGE :: DEV-46521 remove rule type switch
443434
<SmartAlertTypeDetector
444435
editingExistingRule={editingExistingRule}
445436
queries={queries}
446437
rulesSourcesWithRuler={rulesSourcesWithRuler}
447438
onClickSwitch={onClickSwitch}
448-
/> */}
439+
/>
449440
</Stack>
450441
)}
451442

@@ -477,14 +468,18 @@ export const QueryAndExpressionsStep = ({ editingExistingRule, onDataChange }: P
477468
Add query
478469
</Button>
479470
</Tooltip>
480-
{/*
481-
// LOGZ.IO CHANGE :: DEV-46521 remove rule type switch
482471
<SmartAlertTypeDetector
483472
editingExistingRule={editingExistingRule}
484473
rulesSourcesWithRuler={rulesSourcesWithRuler}
485474
queries={queries}
486475
onClickSwitch={onClickSwitch}
487-
/> */}
476+
/>
477+
<SmartAlertTypeDetector
478+
editingExistingRule={editingExistingRule}
479+
rulesSourcesWithRuler={rulesSourcesWithRuler}
480+
queries={queries}
481+
onClickSwitch={onClickSwitch}
482+
/>
488483
{/* Expression Queries */}
489484
<Stack direction="column" gap={0}>
490485
<Text element="h5">Expressions</Text>

public/app/features/alerting/unified/components/rule-editor/query-and-alert-condition/SmartAlertTypeDetector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export function SmartAlertTypeDetector({
9393
// if we can't switch to data-source managed, disable it
9494
// TODO figure out how to show a popover to the user to indicate _why_ it's disabled
9595
const disabledOptions = canSwitch ? [] : [RuleFormType.cloudAlerting];
96+
97+
return null;
9698

9799
return (
98100
<Stack direction="column" gap={1} alignItems="flex-start">

0 commit comments

Comments
 (0)