Skip to content

Commit

Permalink
UI fixes for Rules
Browse files Browse the repository at this point in the history
  • Loading branch information
madirey committed Nov 4, 2021
1 parent ebd0ed4 commit dd0758f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Detection rules, threshold', () => {
waitForAlertsIndexToBeCreated();
});

it.skip('Creates and activates a new threshold rule', () => {
it('Creates and activates a new threshold rule', () => {
goToManageAlertsDetectionRules();
waitForRulesTableToBeLoaded();
goToCreateNewRule();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const RuleSchema = t.intersection([
enabled: t.boolean,
false_positives: t.array(t.string),
from: t.string,
id: t.string,
uuid: t.string,
interval: t.string,
immutable: t.boolean,
name: t.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ interface AlertHit {
_index: string;
_source: {
'@timestamp': string;
signal: {
rule: Rule;
kibana: {
alert: {
rule: Rule;
};
};
};
}
Expand Down Expand Up @@ -77,7 +79,7 @@ export const useRuleWithFallback = (ruleId: string): UseRuleWithFallback => {
}, [addError, error]);

const rule = useMemo<Rule | undefined>(() => {
const result = isExistingRule ? ruleData : alertsData?.hits.hits[0]?._source.signal.rule;
const result = isExistingRule ? ruleData : alertsData?.hits.hits[0]?._source.kibana.alert.rule;
if (result) {
return transformInput(result);
}
Expand Down

0 comments on commit dd0758f

Please sign in to comment.