From b067b98f408abe36719b7f7d2fcd5c0f354376d0 Mon Sep 17 00:00:00 2001 From: kevinlog Date: Thu, 14 Oct 2021 10:02:10 -0400 Subject: [PATCH 1/9] [Security Solution] Make new Add Data page more fine grained --- .../app/home/template_wrapper/index.tsx | 29 +++++++---- .../use_show_pages_with_empty_view.test.tsx | 51 +++++++++++++++++++ .../use_show_pages_with_empty_view.tsx | 41 +++++++++++++++ .../public/hosts/pages/details/index.tsx | 2 - .../public/hosts/pages/hosts.tsx | 2 - .../public/network/pages/details/index.tsx | 2 - .../public/network/pages/network.tsx | 1 - .../public/timelines/pages/timelines_page.tsx | 1 - 8 files changed, 110 insertions(+), 19 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx create mode 100644 x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx index b152ccd546170..125047f6105c4 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx @@ -24,9 +24,9 @@ import { import { useShowTimeline } from '../../../common/utils/timeline/use_show_timeline'; import { gutterTimeline } from '../../../common/lib/helpers'; import { useSourcererScope } from '../../../common/containers/sourcerer'; -import { OverviewEmpty } from '../../../overview/components/overview_empty'; -import { ENDPOINT_METADATA_INDEX } from '../../../../common/constants'; -import { useFetchIndex } from '../../../common/containers/source'; +import { useRouteSpy } from '../../../common/utils/route/use_route_spy'; +import { useShowPagesWithEmptyView } from '../../../common/utils/empty_view/use_show_pages_with_empty_view'; +import { SecurityPageName } from '../../../app/types'; /* eslint-disable react/display-name */ @@ -77,16 +77,24 @@ export const SecuritySolutionTemplateWrapper: React.FC getTimelineShowStatus(state, TimelineId.active) ); - const endpointMetadataIndex = useMemo(() => { - return [ENDPOINT_METADATA_INDEX]; - }, []); - const [, { indexExists: metadataIndexExists }] = useFetchIndex(endpointMetadataIndex, true); const { indicesExist } = useSourcererScope(); - const securityIndicesExist = indicesExist || metadataIndexExists; + const [{ pageName }] = useRouteSpy(); + const [showEmptyState] = useShowPagesWithEmptyView(); + + // Used to detect if we're on a top level page that is empty and set page background color to match the subdued Empty State + const isPageNameWithEmptyView = (currentName: string) => { + const pageNamesWithEmptyView: string[] = [ + SecurityPageName.hosts, + SecurityPageName.network, + SecurityPageName.timelines, + SecurityPageName.overview, + ]; + return pageNamesWithEmptyView.includes(currentName); + }; // StyledKibanaPageTemplate is a styled EuiPageTemplate. Security solution currently passes the header and page content as the children of StyledKibanaPageTemplate, as opposed to using the pageHeader prop, which may account for any style discrepancies, such as the bottom border not extending the full width of the page, between EuiPageTemplate and the security solution pages. - return securityIndicesExist ? ( + return ( {children} - ) : ( - ); }); diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx new file mode 100644 index 0000000000000..e0f42565a686f --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx @@ -0,0 +1,51 @@ +/* + * 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 { renderHook, act } from '@testing-library/react-hooks'; +import { useShowPagesWithEmptyView } from './use_show_pages_with_empty_view'; + +jest.mock('../route/use_route_spy', () => ({ + useRouteSpy: jest + .fn() + .mockImplementationOnce(() => [{ pageName: 'hosts' }]) + .mockImplementationOnce(() => [{ pageName: 'rules' }]) + .mockImplementationOnce(() => [{ pageName: 'network' }]), +})); +jest.mock('../../../common/containers/sourcerer', () => ({ + useSourcererScope: jest + .fn() + .mockImplementationOnce(() => [{ indicesExist: false }]) + .mockImplementationOnce(() => [{ indicesExist: false }]) + .mockImplementationOnce(() => [{ indicesExist: true }]), +})); + +describe('use show pages with empty view', () => { + it('shows empty view when on an elligible page and indices do not exist', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); + await waitForNextUpdate(); + const emptyResult = result.current; + expect(emptyResult).toEqual([true]); + }); + }); + it('does not show empty view when on an inelligible page and indices do not exist', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); + await waitForNextUpdate(); + const emptyResult = result.current; + expect(emptyResult).toEqual([false]); + }); + }); + it('shows empty view when on an elligible page and indices do exist', async () => { + await act(async () => { + const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); + await waitForNextUpdate(); + const emptyResult = result.current; + expect(emptyResult).toEqual([true]); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx new file mode 100644 index 0000000000000..5a782a53aced9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx @@ -0,0 +1,41 @@ +/* + * 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 { useState, useEffect } from 'react'; +import { useRouteSpy } from '../route/use_route_spy'; +import { SecurityPageName } from '../../../app/types'; +import { useSourcererScope } from '../../../common/containers/sourcerer'; + +export const useShowPagesWithEmptyView = () => { + const [{ pageName }] = useRouteSpy(); + const { indicesExist } = useSourcererScope(); + + // Used to detect if we're on a top level page that is empty and set page background color to match the subdued Empty State + const isPageNameWithEmptyView = (currentName: string) => { + const pageNamesWithEmptyView: string[] = [ + SecurityPageName.hosts, + SecurityPageName.network, + SecurityPageName.timelines, + SecurityPageName.overview, + ]; + return pageNamesWithEmptyView.includes(currentName); + }; + + const [showEmptyState, setShowEmptyState] = useState( + isPageNameWithEmptyView(pageName) && !indicesExist + ); + + useEffect(() => { + if (isPageNameWithEmptyView(pageName) && !indicesExist) { + setShowEmptyState(true); + } else { + setShowEmptyState(false); + } + }, [pageName, indicesExist]); + + return [showEmptyState]; +}; diff --git a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx index 627f5e5aef507..9bf046f40edb4 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/details/index.tsx @@ -219,8 +219,6 @@ const HostDetailsComponent: React.FC = ({ detailName, hostDeta ) : ( - - )} diff --git a/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx b/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx index f647819798ab7..8e6a635624bfe 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx @@ -216,8 +216,6 @@ const HostsComponent = () => { ) : ( - - )} diff --git a/x-pack/plugins/security_solution/public/network/pages/details/index.tsx b/x-pack/plugins/security_solution/public/network/pages/details/index.tsx index a3f953fc24fe2..5aee4022a7f30 100644 --- a/x-pack/plugins/security_solution/public/network/pages/details/index.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/details/index.tsx @@ -302,8 +302,6 @@ const NetworkDetailsComponent: React.FC = () => { ) : ( - - )} diff --git a/x-pack/plugins/security_solution/public/network/pages/network.tsx b/x-pack/plugins/security_solution/public/network/pages/network.tsx index 928570417c524..fe8a9a93f97c7 100644 --- a/x-pack/plugins/security_solution/public/network/pages/network.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/network.tsx @@ -221,7 +221,6 @@ const NetworkComponent = React.memo( ) : ( - )} diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx index 728153f47abd7..f79d513380349 100644 --- a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx +++ b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx @@ -93,7 +93,6 @@ export const TimelinesPageComponent: React.FC = () => { ) : ( - )} From cf6d00a65010ec006a1eec1e266c6c8f0a44ead0 Mon Sep 17 00:00:00 2001 From: kevinlog Date: Thu, 14 Oct 2021 10:17:41 -0400 Subject: [PATCH 2/9] remove unused code --- .../public/app/home/template_wrapper/index.tsx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx index 125047f6105c4..811e0a3df882a 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx @@ -23,10 +23,7 @@ import { } from './bottom_bar'; import { useShowTimeline } from '../../../common/utils/timeline/use_show_timeline'; import { gutterTimeline } from '../../../common/lib/helpers'; -import { useSourcererScope } from '../../../common/containers/sourcerer'; -import { useRouteSpy } from '../../../common/utils/route/use_route_spy'; import { useShowPagesWithEmptyView } from '../../../common/utils/empty_view/use_show_pages_with_empty_view'; -import { SecurityPageName } from '../../../app/types'; /* eslint-disable react/display-name */ @@ -77,21 +74,8 @@ export const SecuritySolutionTemplateWrapper: React.FC getTimelineShowStatus(state, TimelineId.active) ); - const { indicesExist } = useSourcererScope(); - const [{ pageName }] = useRouteSpy(); const [showEmptyState] = useShowPagesWithEmptyView(); - // Used to detect if we're on a top level page that is empty and set page background color to match the subdued Empty State - const isPageNameWithEmptyView = (currentName: string) => { - const pageNamesWithEmptyView: string[] = [ - SecurityPageName.hosts, - SecurityPageName.network, - SecurityPageName.timelines, - SecurityPageName.overview, - ]; - return pageNamesWithEmptyView.includes(currentName); - }; - // StyledKibanaPageTemplate is a styled EuiPageTemplate. Security solution currently passes the header and page content as the children of StyledKibanaPageTemplate, as opposed to using the pageHeader prop, which may account for any style discrepancies, such as the bottom border not extending the full width of the page, between EuiPageTemplate and the security solution pages. return ( From ebeaae0a87afdf9e39b84f0be85a7ecd99f5a345 Mon Sep 17 00:00:00 2001 From: kevinlog Date: Thu, 14 Oct 2021 15:22:50 -0400 Subject: [PATCH 3/9] pr comments --- .../public/app/home/template_wrapper/index.tsx | 2 +- .../empty_view/use_show_pages_with_empty_view.test.tsx | 6 +++--- .../utils/empty_view/use_show_pages_with_empty_view.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx index 811e0a3df882a..f112f69d97e66 100644 --- a/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx +++ b/x-pack/plugins/security_solution/public/app/home/template_wrapper/index.tsx @@ -74,7 +74,7 @@ export const SecuritySolutionTemplateWrapper: React.FC getTimelineShowStatus(state, TimelineId.active) ); - const [showEmptyState] = useShowPagesWithEmptyView(); + const showEmptyState = useShowPagesWithEmptyView(); // StyledKibanaPageTemplate is a styled EuiPageTemplate. Security solution currently passes the header and page content as the children of StyledKibanaPageTemplate, as opposed to using the pageHeader prop, which may account for any style discrepancies, such as the bottom border not extending the full width of the page, between EuiPageTemplate and the security solution pages. diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx index e0f42565a686f..981f7e9e876ea 100644 --- a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.test.tsx @@ -29,7 +29,7 @@ describe('use show pages with empty view', () => { const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); await waitForNextUpdate(); const emptyResult = result.current; - expect(emptyResult).toEqual([true]); + expect(emptyResult).toEqual(true); }); }); it('does not show empty view when on an inelligible page and indices do not exist', async () => { @@ -37,7 +37,7 @@ describe('use show pages with empty view', () => { const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); await waitForNextUpdate(); const emptyResult = result.current; - expect(emptyResult).toEqual([false]); + expect(emptyResult).toEqual(false); }); }); it('shows empty view when on an elligible page and indices do exist', async () => { @@ -45,7 +45,7 @@ describe('use show pages with empty view', () => { const { result, waitForNextUpdate } = renderHook(() => useShowPagesWithEmptyView()); await waitForNextUpdate(); const emptyResult = result.current; - expect(emptyResult).toEqual([true]); + expect(emptyResult).toEqual(true); }); }); }); diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx index 5a782a53aced9..bf5e2d8815d5a 100644 --- a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx @@ -37,5 +37,5 @@ export const useShowPagesWithEmptyView = () => { } }, [pageName, indicesExist]); - return [showEmptyState]; + return showEmptyState; }; From 422c5389b093eb1cc363300a0b57ed61d942f4ea Mon Sep 17 00:00:00 2001 From: kevinlog Date: Fri, 15 Oct 2021 16:47:57 -0400 Subject: [PATCH 4/9] pr comments --- .../empty_view/use_show_pages_with_empty_view.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx index bf5e2d8815d5a..e7fb6ac88ac82 100644 --- a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx @@ -25,17 +25,17 @@ export const useShowPagesWithEmptyView = () => { return pageNamesWithEmptyView.includes(currentName); }; - const [showEmptyState, setShowEmptyState] = useState( - isPageNameWithEmptyView(pageName) && !indicesExist - ); + const shouldShowEmptyState = isPageNameWithEmptyView(pageName) && !indicesExist; + + const [showEmptyState, setShowEmptyState] = useState(shouldShowEmptyState); useEffect(() => { - if (isPageNameWithEmptyView(pageName) && !indicesExist) { + if (shouldShowEmptyState) { setShowEmptyState(true); } else { setShowEmptyState(false); } - }, [pageName, indicesExist]); + }, [shouldShowEmptyState]); return showEmptyState; }; From 09691886e7ec2cdbe273788465c0fded5b357a47 Mon Sep 17 00:00:00 2001 From: kevinlog Date: Fri, 15 Oct 2021 16:50:17 -0400 Subject: [PATCH 5/9] pr comments --- .../use_show_pages_with_empty_view.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx index e7fb6ac88ac82..10cc4be10a61b 100644 --- a/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx +++ b/x-pack/plugins/security_solution/public/common/utils/empty_view/use_show_pages_with_empty_view.tsx @@ -10,21 +10,21 @@ import { useRouteSpy } from '../route/use_route_spy'; import { SecurityPageName } from '../../../app/types'; import { useSourcererScope } from '../../../common/containers/sourcerer'; +// Used to detect if we're on a top level page that is empty and set page background color to match the subdued Empty State +const isPageNameWithEmptyView = (currentName: string) => { + const pageNamesWithEmptyView: string[] = [ + SecurityPageName.hosts, + SecurityPageName.network, + SecurityPageName.timelines, + SecurityPageName.overview, + ]; + return pageNamesWithEmptyView.includes(currentName); +}; + export const useShowPagesWithEmptyView = () => { const [{ pageName }] = useRouteSpy(); const { indicesExist } = useSourcererScope(); - // Used to detect if we're on a top level page that is empty and set page background color to match the subdued Empty State - const isPageNameWithEmptyView = (currentName: string) => { - const pageNamesWithEmptyView: string[] = [ - SecurityPageName.hosts, - SecurityPageName.network, - SecurityPageName.timelines, - SecurityPageName.overview, - ]; - return pageNamesWithEmptyView.includes(currentName); - }; - const shouldShowEmptyState = isPageNameWithEmptyView(pageName) && !indicesExist; const [showEmptyState, setShowEmptyState] = useState(shouldShowEmptyState); From bb9964958fc23e8e2e3a103a7074201e391e7edc Mon Sep 17 00:00:00 2001 From: cchaos Date: Mon, 18 Oct 2021 15:28:35 -0400 Subject: [PATCH 6/9] Fixed nested page templates in favor of using the lower level NoDataPage --- .../no_data_page/no_data_page.tsx | 7 ++-- .../app/home/template_wrapper/index.tsx | 34 ++++++++++++------- .../components/overview_empty/index.tsx | 12 +++---- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx index 56eb0f34617d6..01661dbb4dcd5 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx +++ b/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx @@ -17,9 +17,11 @@ import { EuiText, EuiTextColor, EuiLink, + CommonProps, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; +import classNames from 'classnames'; import { KibanaPageTemplateProps } from '../page_template'; import { ElasticAgentCard, ElasticBeatsCard, NoDataCard } from './no_data_card'; @@ -59,7 +61,7 @@ export type NoDataPageActions = Partial & { export type NoDataPageActionsProps = Record; -export interface NoDataPageProps { +export interface NoDataPageProps extends CommonProps { /** * Single name for the current solution, used to auto-generate the title, logo, description, and button label */ @@ -90,6 +92,7 @@ export const NoDataPage: FunctionComponent = ({ actions, docsLink, pageTitle, + ...rest }) => { // Convert obj data into an iterable array const entries = Object.entries(actions); @@ -133,7 +136,7 @@ export const NoDataPage: FunctionComponent = ({ }, [actions, sortedData, actionsKeys]); return ( -
+
- - - {children} - + {showEmptyState ? ( + children + ) : ( + <> + + + {children} + + + )} ); }); diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx index bc76333943191..ab86de3ef48f8 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx @@ -14,7 +14,7 @@ import { SOLUTION_NAME } from '../../../../public/common/translations'; import { useUserPrivileges } from '../../../common/components/user_privileges'; import { - KibanaPageTemplate, + NoDataPage, NoDataPageActionsProps, } from '../../../../../../../src/plugins/kibana_react/public'; @@ -50,13 +50,11 @@ const OverviewEmptyComponent: React.FC = () => { ); return ( - ); }; From bb2ac37af4bb01cf01fa0337d21759064db760ac Mon Sep 17 00:00:00 2001 From: cchaos Date: Tue, 19 Oct 2021 04:57:25 -0400 Subject: [PATCH 7/9] Add `category` back in for integration URL and snap --- .../__snapshots__/no_data_page.test.tsx.snap | 102 ++++++++++++++++++ .../components/overview_empty/index.tsx | 1 + 2 files changed, 103 insertions(+) diff --git a/src/plugins/kibana_react/public/page_template/no_data_page/__snapshots__/no_data_page.test.tsx.snap b/src/plugins/kibana_react/public/page_template/no_data_page/__snapshots__/no_data_page.test.tsx.snap index 8842a3c9f5842..0554e64c5ecb6 100644 --- a/src/plugins/kibana_react/public/page_template/no_data_page/__snapshots__/no_data_page.test.tsx.snap +++ b/src/plugins/kibana_react/public/page_template/no_data_page/__snapshots__/no_data_page.test.tsx.snap @@ -3,6 +3,108 @@ exports[`NoDataPage render 1`] = `
{ const { docLinks } = useKibana().services; const agentAction: NoDataPageActionsProps = { + category: 'security', elasticAgent: { title: i18n.translate('xpack.securitySolution.pages.emptyPage.beatsCard.title', { defaultMessage: 'Add a Security integration', From e3b79fc31d09d8620165ea568946a054fadc89ac Mon Sep 17 00:00:00 2001 From: cchaos Date: Tue, 19 Oct 2021 05:01:20 -0400 Subject: [PATCH 8/9] Fix category placement --- .../public/overview/components/overview_empty/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx index 4971e2a7c8e80..023d010ec9a9b 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.tsx @@ -19,8 +19,8 @@ const OverviewEmptyComponent: React.FC = () => { const { docLinks } = useKibana().services; const agentAction: NoDataPageActionsProps = { - category: 'security', elasticAgent: { + category: 'security', title: i18n.translate('xpack.securitySolution.pages.emptyPage.beatsCard.title', { defaultMessage: 'Add a Security integration', }), From ae3b524e294c843c58e6ae2bdb000b24d1c6ae48 Mon Sep 17 00:00:00 2001 From: kevinlog Date: Tue, 19 Oct 2021 07:33:49 -0400 Subject: [PATCH 9/9] fix test --- .../public/overview/components/overview_empty/index.test.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.test.tsx index e009f01bb3f0d..36ecc3371c056 100644 --- a/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.test.tsx +++ b/x-pack/plugins/security_solution/public/overview/components/overview_empty/index.test.tsx @@ -44,6 +44,7 @@ describe('OverviewEmpty', () => { it('render with correct actions ', () => { expect(wrapper.find('[data-test-subj="empty-page"]').prop('actions')).toEqual({ elasticAgent: { + category: 'security', description: 'Use Elastic Agent to collect security events and protect your endpoints from threats.', title: 'Add a Security integration', @@ -64,6 +65,7 @@ describe('OverviewEmpty', () => { it('render with correct actions ', () => { expect(wrapper.find('[data-test-subj="empty-page"]').prop('actions')).toEqual({ elasticAgent: { + category: 'security', description: 'Use Elastic Agent to collect security events and protect your endpoints from threats.', title: 'Add a Security integration',