From dd0758f4c7f59d2151c03903347113ded9d0137b Mon Sep 17 00:00:00 2001 From: Madison Caldwell Date: Thu, 4 Nov 2021 13:33:18 -0400 Subject: [PATCH] UI fixes for Rules --- .../integration/detection_rules/threshold_rule.spec.ts | 2 +- .../detections/containers/detection_engine/rules/types.ts | 2 +- .../detection_engine/rules/use_rule_with_fallback.tsx | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts b/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts index 4c76fdcb18ca7..7bfc9631f7269 100644 --- a/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts +++ b/x-pack/plugins/security_solution/cypress/integration/detection_rules/threshold_rule.spec.ts @@ -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(); diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts index bd287b4647048..77f5b3cb16701 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/types.ts @@ -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, diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx index da56275280f65..c3fd463d4548d 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/use_rule_with_fallback.tsx @@ -28,8 +28,10 @@ interface AlertHit { _index: string; _source: { '@timestamp': string; - signal: { - rule: Rule; + kibana: { + alert: { + rule: Rule; + }; }; }; } @@ -77,7 +79,7 @@ export const useRuleWithFallback = (ruleId: string): UseRuleWithFallback => { }, [addError, error]); const rule = useMemo(() => { - 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); }