From 44d028fdf871292e74948ac8cd6650d1418e0929 Mon Sep 17 00:00:00 2001 From: Kevin Logan <56395104+kevinlog@users.noreply.github.com> Date: Mon, 3 Oct 2022 17:53:07 -0400 Subject: [PATCH] [Security Solution] Trusted Apps about text updated to add new docs link (#142467) --- packages/kbn-doc-links/src/get_doc_links.ts | 1 + packages/kbn-doc-links/src/types.ts | 1 + .../artifact_list_page/artifact_list_page.tsx | 23 ++++++++++- .../components/no_data_empty_state.tsx | 16 +++++++- .../view/components/artifacts_docs_link.tsx | 40 +++++++++++++++++++ .../trusted_apps/view/components/form.tsx | 11 ++++- .../pages/trusted_apps/view/translations.ts | 2 +- .../trusted_apps/view/trusted_apps_list.tsx | 6 ++- 8 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/artifacts_docs_link.tsx diff --git a/packages/kbn-doc-links/src/get_doc_links.ts b/packages/kbn-doc-links/src/get_doc_links.ts index 3a0b89c1f0d1b..8ef5a68a3f98c 100644 --- a/packages/kbn-doc-links/src/get_doc_links.ts +++ b/packages/kbn-doc-links/src/get_doc_links.ts @@ -363,6 +363,7 @@ export const getDocLinks = ({ kibanaBranch }: GetDocLinkOptions): DocLinks => { eventFilters: `${SECURITY_SOLUTION_DOCS}event-filters.html`, blocklist: `${SECURITY_SOLUTION_DOCS}blocklist.html`, threatIntelInt: `${SECURITY_SOLUTION_DOCS}es-threat-intel-integrations.html`, + endpointArtifacts: `${SECURITY_SOLUTION_DOCS}endpoint-artifacts.html`, policyResponseTroubleshooting: { full_disk_access: `${SECURITY_SOLUTION_DOCS}deploy-elastic-endpoint.html#enable-fda-endpoint`, macos_system_ext: `${SECURITY_SOLUTION_DOCS}deploy-elastic-endpoint.html#system-extension-endpoint`, diff --git a/packages/kbn-doc-links/src/types.ts b/packages/kbn-doc-links/src/types.ts index 7cd785ee194fa..aed1b552bdb30 100644 --- a/packages/kbn-doc-links/src/types.ts +++ b/packages/kbn-doc-links/src/types.ts @@ -265,6 +265,7 @@ export interface DocLinks { readonly trustedApps: string; readonly eventFilters: string; readonly blocklist: string; + readonly endpointArtifacts: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx index 0586034d15550..344dbd6cd8349 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/artifact_list_page.tsx @@ -74,6 +74,7 @@ export interface ArtifactListPageProps { allowCardEditAction?: boolean; allowCardDeleteAction?: boolean; allowCardCreateAction?: boolean; + secondaryPageInfo?: React.ReactNode; } export const ArtifactListPage = memo( @@ -82,6 +83,7 @@ export const ArtifactListPage = memo( ArtifactFormComponent, searchableFields = DEFAULT_EXCEPTION_LIST_ITEM_SEARCHABLE_FIELDS, labels: _labels = {}, + secondaryPageInfo, onFormSubmit, flyoutSize, 'data-test-subj': dataTestSubj, @@ -240,6 +242,24 @@ export const ArtifactListPage = memo( setSelectedItemForEdit(undefined); }, []); + const description = useMemo(() => { + const subtitleText = labels.pageAboutInfo ? ( + {labels.pageAboutInfo} + ) : undefined; + const detailedPageInfoElement = secondaryPageInfo ? ( + <> + + {secondaryPageInfo} + + ) : undefined; + return ( + <> + {subtitleText} + {detailedPageInfoElement} + + ); + }, [labels.pageAboutInfo, secondaryPageInfo]); + if (isPageInitializing) { return ; } @@ -249,7 +269,7 @@ export const ArtifactListPage = memo( headerBackComponent={backButtonHeaderComponent} hideHeader={!doesDataExist} title={labels.pageTitle} - subtitle={labels.pageAboutInfo} + subtitle={description} actions={ allowCardCreateAction && ( ( primaryButtonLabel={labels.emptyStatePrimaryButtonLabel} backComponent={backButtonEmptyComponent} data-test-subj={getTestId('emptyState')} + secondaryAboutInfo={secondaryPageInfo} /> ) : ( <> diff --git a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx index e2dfd992f0e80..87fb9414b894a 100644 --- a/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx +++ b/x-pack/plugins/security_solution/public/management/components/artifact_list_page/components/no_data_empty_state.tsx @@ -7,7 +7,7 @@ import React, { memo } from 'react'; import styled, { css } from 'styled-components'; -import { EuiButton, EuiEmptyPrompt } from '@elastic/eui'; +import { EuiButton, EuiEmptyPrompt, EuiSpacer } from '@elastic/eui'; import { ManagementEmptyStateWrapper } from '../../management_empty_state_wrapper'; import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; @@ -25,6 +25,7 @@ export const NoDataEmptyState = memo<{ /** Should the Add button be disabled */ isAddDisabled?: boolean; backComponent?: React.ReactNode; + secondaryAboutInfo?: React.ReactNode; 'data-test-subj'?: string; }>( ({ @@ -35,6 +36,7 @@ export const NoDataEmptyState = memo<{ titleLabel, aboutInfo, primaryButtonLabel, + secondaryAboutInfo, }) => { const getTestId = useTestIdGenerator(dataTestSubj); @@ -44,7 +46,17 @@ export const NoDataEmptyState = memo<{ data-test-subj={dataTestSubj} iconType="plusInCircle" title={

{titleLabel}

} - body={
{aboutInfo}
} + body={ +
+ {aboutInfo} + {secondaryAboutInfo ? ( + <> + + {secondaryAboutInfo} + + ) : undefined} +
+ } actions={[ { + const { + docLinks: { + links: { securitySolution }, + }, + } = useKibana().services; + + return ( + <> + + + + + + + ); +}); + +TrustedAppsArtifactsDocsLink.displayName = 'TrustedAppsArtifactsDocsLink'; diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx index 333e0da92cceb..90e1dcc1c0c89 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/form.tsx @@ -71,6 +71,7 @@ import { } from '../../../../../../common/endpoint/service/artifacts/constants'; import type { ArtifactFormComponentProps } from '../../../../components/artifact_list_page'; import { isGlobalPolicyEffected } from '../../../../components/effected_policy_select/utils'; +import { TrustedAppsArtifactsDocsLink } from './artifacts_docs_link'; interface FieldValidationState { /** If this fields state is invalid. Drives display of errors on the UI */ @@ -419,7 +420,15 @@ export const TrustedAppsForm = memo( {mode === 'create' && ( -

{DETAILS_HEADER_DESCRIPTION}

+

+ {DETAILS_HEADER_DESCRIPTION} + { + <> + + + + } +

)} diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts index c19b3c78d0f8c..02ada2533f9b8 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/translations.ts @@ -25,7 +25,7 @@ export const DETAILS_HEADER_DESCRIPTION = i18n.translate( 'xpack.securitySolution.trustedApps.details.header.description', { defaultMessage: - 'Trusted applications improve performance or alleviate conflicts with other applications running on your hosts.', + 'Add a trusted application to improve performance or alleviate conflicts with other applications running on your hosts. Trusted applications may still generate alerts in some cases.', } ); diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx index acb4c4ae13bce..33912a5b795c4 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/trusted_apps_list.tsx @@ -17,6 +17,7 @@ import { ArtifactListPage } from '../../../components/artifact_list_page'; import { TrustedAppsApiClient } from '../service'; import { TrustedAppsForm } from './components/form'; import { SEARCHABLE_FIELDS } from '../constants'; +import { TrustedAppsArtifactsDocsLink } from './components/artifacts_docs_link'; const TRUSTED_APPS_PAGE_LABELS: ArtifactListPageProps['labels'] = { pageTitle: i18n.translate('xpack.securitySolution.trustedApps.pageTitle', { @@ -24,7 +25,7 @@ const TRUSTED_APPS_PAGE_LABELS: ArtifactListPageProps['labels'] = { }), pageAboutInfo: i18n.translate('xpack.securitySolution.trustedApps.pageAboutInfo', { defaultMessage: - 'Trusted applications improve performance or alleviate conflicts with other applications running on your hosts.', + 'Add a trusted application to improve performance or alleviate conflicts with other applications running on your hosts. Trusted applications may still generate alerts in some cases.', }), pageAddButtonTitle: i18n.translate('xpack.securitySolution.trustedApps.pageAddButtonTitle', { defaultMessage: 'Add trusted application', @@ -92,7 +93,7 @@ const TRUSTED_APPS_PAGE_LABELS: ArtifactListPageProps['labels'] = { }), emptyStateInfo: i18n.translate('xpack.securitySolution.trustedApps.emptyStateInfo', { defaultMessage: - 'Add a trusted application to improve performance or alleviate conflicts with other applications running on your hosts.', + 'Add a trusted application to improve performance or alleviate conflicts with other applications running on your hosts. Trusted applications may still generate alerts in some cases.', }), emptyStatePrimaryButtonLabel: i18n.translate( 'xpack.securitySolution.trustedApps.emptyStatePrimaryButtonLabel', @@ -117,6 +118,7 @@ export const TrustedAppsList = memo(() => { labels={TRUSTED_APPS_PAGE_LABELS} data-test-subj="trustedAppsListPage" searchableFields={SEARCHABLE_FIELDS} + secondaryPageInfo={} /> ); });