Skip to content

Commit

Permalink
Delete host risk card from overview page (#140177)
Browse files Browse the repository at this point in the history
* Delete host risk card from the overview page
  • Loading branch information
machadoum authored Sep 9, 2022
1 parent b3e01c6 commit eb33c82
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 1,004 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,6 @@ export enum BulkActionsDryRunErrCode {
MACHINE_LEARNING_AUTH = 'MACHINE_LEARNING_AUTH',
MACHINE_LEARNING_INDEX_PATTERN = 'MACHINE_LEARNING_INDEX_PATTERN',
}

export const RISKY_HOSTS_DOC_LINK =
'https://www.github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md';

This file was deleted.

15 changes: 0 additions & 15 deletions x-pack/plugins/security_solution/cypress/screens/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,4 @@ export const OVERVIEW_CTI_LINKS_ERROR_INNER_PANEL = '[data-test-subj="cti-inner-
export const OVERVIEW_CTI_TOTAL_EVENT_COUNT = `${OVERVIEW_CTI_LINKS} [data-test-subj="header-panel-subtitle"]`;
export const OVERVIEW_CTI_ENABLE_MODULE_BUTTON = '[data-test-subj="cti-enable-module-button"]';

export const OVERVIEW_RISKY_HOSTS_LINKS = '[data-test-subj="risky-hosts-dashboard-links"]';
export const OVERVIEW_RISKY_HOSTS_LINKS_ERROR_INNER_PANEL =
'[data-test-subj="risky-hosts-inner-panel-danger"]';
export const OVERVIEW_RISKY_HOSTS_LINKS_WARNING_INNER_PANEL =
'[data-test-subj="risky-hosts-inner-panel-warning"]';
export const OVERVIEW_RISKY_HOSTS_VIEW_DASHBOARD_BUTTON =
'[data-test-subj="risky-hosts-view-dashboard-button"]';
export const OVERVIEW_RISKY_HOSTS_IMPORT_DASHBOARD_BUTTON =
'[data-test-subj="create-saved-object-button"]';
export const OVERVIEW_RISKY_HOSTS_DOC_LINK =
'[data-test-subj="risky-hosts-inner-panel-danger-learn-more"]';
export const OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT = `${OVERVIEW_RISKY_HOSTS_LINKS} [data-test-subj="header-panel-subtitle"]`;
export const OVERVIEW_RISKY_HOSTS_ENABLE_MODULE_BUTTON =
'[data-test-subj="disabled-open-in-console-button-with-tooltip"]';

export const OVERVIEW_ALERTS_HISTOGRAM = '[data-test-subj="alerts-histogram-panel"]';
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import React from 'react';
import { EuiLoadingSpinner, EuiPanel, EuiSpacer, EuiLink, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import * as i18n from './translations';
import { RISKY_HOSTS_DOC_LINK } from '../../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';
import { EnrichedDataRow, ThreatSummaryPanelHeader } from './threat_summary_view';
import { RiskScore } from '../../severity/common';
import type { HostRisk } from '../../../../risk_score/containers';
import { RISKY_HOSTS_DOC_LINK } from '../../../../../common/constants';

const HostRiskSummaryComponent: React.FC<{
hostRisk: HostRisk;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ import {
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';

import { RISKY_HOSTS_DOC_LINK } from '../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';

import * as i18n from './translations';
import { useOnOpenCloseHandler } from '../../../helper_hooks';
import { RiskScore } from '../../../common/components/severity/common';
import { RiskSeverity } from '../../../../common/search_strategy';
import { RISKY_HOSTS_DOC_LINK } from '../../../../common/constants';

const tableColumns: Array<EuiBasicTableColumn<TableItem>> = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { HostsKpiHosts } from './hosts';
import { HostsKpiUniqueIps } from './unique_ips';
import type { HostsKpiProps } from './types';
import { CallOutSwitcher } from '../../../common/components/callouts';
import { RISKY_HOSTS_DOC_LINK } from '../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';
import * as i18n from './translations';
import { useHostRiskScore } from '../../../risk_score/containers';
import { RISKY_HOSTS_DOC_LINK } from '../../../../common/constants';

export const HostsKpiComponent = React.memo<HostsKpiProps>(
({ filterQuery, from, indexNames, to, setQuery, skip, updateDateRange }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiSplitPanel, EuiText } from '@elastic/eui';
import { LEARN_MORE } from '../overview_risky_host_links/translations';
import * as i18n from './translations';

const ButtonContainer = styled(EuiFlexGroup)`
padding: ${({ theme }) => theme.eui.euiSizeS};
Expand Down Expand Up @@ -66,7 +66,7 @@ export const InnerLinkPanel = ({
data-test-subj={`${dataTestSubj}-learn-more`}
external
>
{LEARN_MORE}
{i18n.LEARN_MORE}
</EuiLink>
)}
</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { i18n } from '@kbn/i18n';

export const LEARN_MORE = i18n.translate(
'xpack.securitySolution.overview.linkPanelLearnMoreButton',
{
defaultMessage: 'Learn More',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import type { LinkPanelViewProps } from '../link_panel/types';
import { shortenCountIntoString } from '../../../common/utils/shorten_count_into_string';
import { Link } from '../link_panel/link';
import { ID as CTIEventCountQueryId } from '../../containers/overview_cti_links/use_ti_data_sources';
import { LINK_COPY } from '../overview_risky_host_links/translations';

const columns: Array<EuiTableFieldDataColumnType<LinkPanelListItem>> = [
{ name: 'Name', field: 'title', sortable: true, truncateText: true, width: '100%' },
Expand All @@ -34,7 +33,7 @@ const columns: Array<EuiTableFieldDataColumnType<LinkPanelListItem>> = [
field: 'path',
truncateText: true,
width: '80px',
render: (path: string) => <Link path={path} copy={LINK_COPY} />,
render: (path: string) => <Link path={path} copy={i18n.LINK_COPY} />,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ export const OTHER_DATA_SOURCE_TITLE = i18n.translate(
defaultMessage: 'Others',
}
);

export const LINK_COPY = i18n.translate('xpack.securitySolution.overview.ctiLinkSource', {
defaultMessage: 'Source',
});

This file was deleted.

This file was deleted.

Loading

0 comments on commit eb33c82

Please sign in to comment.