Skip to content

Commit b24742c

Browse files
committed
Remove duplicated type in favor of common one
1 parent e45c128 commit b24742c

File tree

3 files changed

+8
-8
lines changed
  • x-pack/plugins/security_solution/public/detections

3 files changed

+8
-8
lines changed

x-pack/plugins/security_solution/public/detections/components/rules/step_about_rule/data.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import styled from 'styled-components';
88
import { EuiHealth } from '@elastic/eui';
99
import euiLightVars from '@elastic/eui/dist/eui_theme_light.json';
1010
import React from 'react';
11-
import { SeverityValue } from '../../../pages/detection_engine/rules/types';
11+
12+
import { Severity } from '../../../../../common/detection_engine/schemas/common/schemas';
1213
import * as I18n from './translations';
1314

1415
export interface SeverityOptionItem {
15-
value: SeverityValue;
16+
value: Severity;
1617
inputDisplay: React.ReactElement;
1718
}
1819

@@ -43,7 +44,7 @@ export const severityOptions: SeverityOptionItem[] = [
4344
},
4445
];
4546

46-
export const defaultRiskScoreBySeverity: Record<SeverityValue, number> = {
47+
export const defaultRiskScoreBySeverity: Record<Severity, number> = {
4748
low: 21,
4849
medium: 47,
4950
high: 73,

x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/helpers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import {
2323
IMitreEnterpriseAttack,
2424
ScheduleStepRule,
2525
ActionsStepRule,
26-
SeverityValue,
2726
} from './types';
2827
import {
2928
SeverityMapping,
3029
Type,
30+
Severity,
3131
} from '../../../../../common/detection_engine/schemas/common/schemas';
3232
import { severityOptions } from '../../../components/rules/step_about_rule/data';
3333

@@ -151,7 +151,7 @@ export const getAboutStepsData = (rule: Rule, detailsView: boolean): AboutStepRu
151151
note: note!,
152152
references,
153153
severity: {
154-
value: severity as SeverityValue,
154+
value: severity as Severity,
155155
mapping: fillEmptySeverityMappings(severityMapping),
156156
isMappingChecked: severityMapping.length > 0,
157157
},

x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/types.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
SortOrder,
2121
TimestampOverride,
2222
Type,
23+
Severity,
2324
} from '../../../../../common/detection_engine/schemas/common/schemas';
2425
import { List } from '../../../../../common/detection_engine/schemas/types';
2526

@@ -103,10 +104,8 @@ export interface AboutStepRuleDetails {
103104
description: string;
104105
}
105106

106-
export type SeverityValue = 'low' | 'medium' | 'high' | 'critical';
107-
108107
export interface AboutStepSeverity {
109-
value: SeverityValue;
108+
value: Severity;
110109
mapping: SeverityMapping;
111110
isMappingChecked: boolean;
112111
}

0 commit comments

Comments
 (0)