From d17f05ae06fa1921df10646c01bce6211072f452 Mon Sep 17 00:00:00 2001 From: Candace Park Date: Wed, 21 Oct 2020 16:07:52 -0700 Subject: [PATCH 1/3] malware protections notify user versioning --- .../view/policy_forms/protections/malware.tsx | 13 +++++++++---- .../protections/popup_options_to_versions.ts | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions.ts diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx index 1da832fb081ef..07ba9480165af 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx @@ -11,6 +11,7 @@ import { EuiRadio, EuiSwitch, EuiTitle, + EuiText, EuiSpacer, htmlIdGenerator, EuiCallOut, @@ -28,6 +29,7 @@ import { policyConfig } from '../../../store/policy_details/selectors'; import { usePolicyDetailsSelector } from '../../policy_hooks'; import { clone } from '../../../models/policy_details_config'; import { LinkToApp } from '../../../../../../common/components/endpoint/link_to_app'; +import { popupVersionsMap } from './popup_options_to_versions'; const ProtectionRadioGroup = styled.div` display: flex; @@ -189,14 +191,17 @@ export const MalwareProtections = React.memo(() => { /> + + {`Endpoint versions ${popupVersionsMap.get('malware')}`} + + ); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions.ts b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions.ts new file mode 100644 index 0000000000000..58f8e75a5403b --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { i18n } from '@kbn/i18n'; + +const popupVersions: Array<[string, string]> = [ + [ + 'malware', + i18n.translate('xpack.securitySolution.endpoint.policyDetails.popup.version.7.11', { + defaultMessage: '7.11+', + }), + ], +]; + +export const popupVersionsMap = new Map(popupVersions); From 9644f138c6febd494b9307c45f3437c925a7a8be Mon Sep 17 00:00:00 2001 From: Candace Park Date: Mon, 26 Oct 2020 11:34:18 -0400 Subject: [PATCH 2/3] new component for popup version --- .../view/policy_forms/protections/malware.tsx | 23 ++++++++++++++++--- .../protections/popup_options_to_versions.ts | 13 ++--------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx index 07ba9480165af..b666aaa13e6b8 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx @@ -85,6 +85,25 @@ const ProtectionRadio = React.memo(({ id, label }: { id: ProtectionModes; label: ProtectionRadio.displayName = 'ProtectionRadio'; +const SupportedVersionNotice = ({ optionName }: { optionName: string }) => { + const version = popupVersionsMap.get(optionName); + if (!version) { + return null; + } + + return ( + + + + + + ); +}; + /** The Malware Protections form for policy details * which will configure for all relevant OSes. */ @@ -191,9 +210,7 @@ export const MalwareProtections = React.memo(() => { /> - - {`Endpoint versions ${popupVersionsMap.get('malware')}`} - + = [['malware', '7.11+']]; -const popupVersions: Array<[string, string]> = [ - [ - 'malware', - i18n.translate('xpack.securitySolution.endpoint.policyDetails.popup.version.7.11', { - defaultMessage: '7.11+', - }), - ], -]; - -export const popupVersionsMap = new Map(popupVersions); +export const popupVersionsMap: ReadonlyMap = new Map(popupVersions); From ce30cdca14013fc4230cc67a3fd048c90cee294d Mon Sep 17 00:00:00 2001 From: Candace Park Date: Mon, 26 Oct 2020 15:13:20 -0400 Subject: [PATCH 3/3] change endpoint to agent text --- .../pages/policy/view/policy_forms/protections/malware.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx index b666aaa13e6b8..6773ed6541927 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/malware.tsx @@ -96,7 +96,7 @@ const SupportedVersionNotice = ({ optionName }: { optionName: string }) => {