diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.tsx index b43bd15ff1871c2..e7d743e12c5c1fe 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/insights.tsx @@ -6,7 +6,9 @@ */ import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiTitle } from '@elastic/eui'; +import { euiStyled } from '@kbn/kibana-react-plugin/common'; +import { ALERT_SUPPRESSION_DOCS_COUNT } from '@kbn/rule-data-utils'; import { find } from 'lodash/fp'; import * as i18n from './translations'; @@ -23,6 +25,13 @@ import { RelatedAlertsBySourceEvent } from './related_alerts_by_source_event'; import { RelatedAlertsBySession } from './related_alerts_by_session'; import { RelatedAlertsUpsell } from './related_alerts_upsell'; +const StyledInsightItem = euiStyled(EuiFlexItem)` + border: 1px solid ${({ theme }) => theme.eui.euiColorLightShade}; + padding: 10px 8px; + border-radius: 6px; + display: inline-flex; +`; + interface Props { browserFields: BrowserFields; eventId: string; @@ -68,6 +77,12 @@ export const Insights = React.memo( ); const hasSourceEventInfo = hasData(sourceEventField); + const alertSuppressionField = find( + { category: 'kibana', field: ALERT_SUPPRESSION_DOCS_COUNT }, + data + ); + const hasAlertSuppressionField = hasData(alertSuppressionField); + const userCasesPermissions = useGetUserCasesPermissions(); const hasCasesReadPermissions = userCasesPermissions.read; @@ -101,6 +116,20 @@ export const Insights = React.memo( + {hasAlertSuppressionField && ( + +
+ + {i18n.SUPPRESSED_ALERTS_COUNT(parseInt(alertSuppressionField.values[0], 10))} + +
+
+ )} + {hasCasesReadPermissions && ( diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts index 270c1eedb62c027..4b2056566ea7970 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/insights/translations.ts @@ -149,3 +149,16 @@ export const INSIGHTS_UPSELL = i18n.translate( defaultMessage: 'Get more insights with a platinum subscription', } ); + +export const SUPPRESSED_ALERTS_COUNT = (count?: number) => + i18n.translate('xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCount', { + defaultMessage: '{count} suppressed {count, plural, =1 {alert} other {alerts}}', + values: { count }, + }); + +export const SUPPRESSED_ALERTS_COUNT_TECHNICAL_PREVIEW = i18n.translate( + 'xpack.securitySolution.alertDetails.overview.insights.suppressedAlertsCountTechnicalPreview', + { + defaultMessage: 'Technical Preview', + } +);