Skip to content

Commit

Permalink
removed unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CAWilson94 committed Nov 5, 2024
1 parent f5a8eb3 commit a20a24b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { isEmpty, isNumber } from 'lodash/fp';
import React from 'react';
import { css } from '@emotion/css';
import type { FieldSpec } from '@kbn/data-plugin/common';
import { formatRiskScore } from '../../../../../entity_analytics/common';
import { getAgentTypeForAgentIdField } from '../../../../../common/lib/endpoint/utils/get_agent_type_for_agent_id_field';
import {
ALERT_HOST_CRITICALITY,
Expand Down Expand Up @@ -45,12 +46,7 @@ import {
SIGNAL_STATUS_FIELD_NAME,
USER_NAME_FIELD_NAME,
} from './constants';
import {
renderEventModule,
RenderRiskScore,
RenderRuleName,
renderUrl,
} from './formatted_field_helpers';
import { renderEventModule, RenderRuleName, renderUrl } from './formatted_field_helpers';
import { RuleStatus } from './rule_status';
import { HostName } from './host_name';
import { UserName } from './user_name';
Expand Down Expand Up @@ -246,7 +242,11 @@ const FormattedFieldValueComponent: React.FC<{
/>
);
} else if (fieldName === RISK_SCORE) {
return value ? <RenderRiskScore value={value} /> : null;
return value ? (
<span data-test-subj="risk-score-truncate" title={`${value}`}>
{formatRiskScore(Number(value))}
</span>
) : null;
} else if (fieldName === EVENT_MODULE_FIELD_NAME) {
return renderEventModule({
contextId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import type { SyntheticEvent } from 'react';
import React, { useCallback, useMemo, useContext } from 'react';
import styled from 'styled-components';
import { useExpandableFlyoutApi } from '@kbn/expandable-flyout';
import { formatRiskScore } from '../../../../../entity_analytics/common';
import { DefaultDraggable } from '../../../../../common/components/draggables';
import { getEmptyTagValue } from '../../../../../common/components/empty_value';
import { getRuleDetailsUrl } from '../../../../../common/components/link_to/redirect_to_detection_engine';
Expand Down Expand Up @@ -383,16 +382,3 @@ export const renderUrl = ({
getEmptyTagValue()
);
};

interface RenderRiskScoreProps {
value: number | string;
}

export const RenderRiskScore: React.FC<RenderRiskScoreProps> = ({ value }) => {
return (
<span data-test-subj="risk-score-truncate" title={`${value}`}>
{/* Usually is a string */}
{formatRiskScore(Number(value))}
</span>
);
};

0 comments on commit a20a24b

Please sign in to comment.