Skip to content

Commit

Permalink
Remove duplicated type in favor of common one
Browse files Browse the repository at this point in the history
  • Loading branch information
rylnd committed Sep 4, 2020
1 parent e45c128 commit b24742c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import styled from 'styled-components';
import { EuiHealth } from '@elastic/eui';
import euiLightVars from '@elastic/eui/dist/eui_theme_light.json';
import React from 'react';
import { SeverityValue } from '../../../pages/detection_engine/rules/types';

import { Severity } from '../../../../../common/detection_engine/schemas/common/schemas';
import * as I18n from './translations';

export interface SeverityOptionItem {
value: SeverityValue;
value: Severity;
inputDisplay: React.ReactElement;
}

Expand Down Expand Up @@ -43,7 +44,7 @@ export const severityOptions: SeverityOptionItem[] = [
},
];

export const defaultRiskScoreBySeverity: Record<SeverityValue, number> = {
export const defaultRiskScoreBySeverity: Record<Severity, number> = {
low: 21,
medium: 47,
high: 73,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import {
IMitreEnterpriseAttack,
ScheduleStepRule,
ActionsStepRule,
SeverityValue,
} from './types';
import {
SeverityMapping,
Type,
Severity,
} from '../../../../../common/detection_engine/schemas/common/schemas';
import { severityOptions } from '../../../components/rules/step_about_rule/data';

Expand Down Expand Up @@ -151,7 +151,7 @@ export const getAboutStepsData = (rule: Rule, detailsView: boolean): AboutStepRu
note: note!,
references,
severity: {
value: severity as SeverityValue,
value: severity as Severity,
mapping: fillEmptySeverityMappings(severityMapping),
isMappingChecked: severityMapping.length > 0,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
SortOrder,
TimestampOverride,
Type,
Severity,
} from '../../../../../common/detection_engine/schemas/common/schemas';
import { List } from '../../../../../common/detection_engine/schemas/types';

Expand Down Expand Up @@ -103,10 +104,8 @@ export interface AboutStepRuleDetails {
description: string;
}

export type SeverityValue = 'low' | 'medium' | 'high' | 'critical';

export interface AboutStepSeverity {
value: SeverityValue;
value: Severity;
mapping: SeverityMapping;
isMappingChecked: boolean;
}
Expand Down

0 comments on commit b24742c

Please sign in to comment.