From 04260d30a71c42ede2c534155e03e7682066149e Mon Sep 17 00:00:00 2001 From: Esteban Beltran Date: Tue, 10 Aug 2021 09:54:08 +0200 Subject: [PATCH] [Security Solution] Display a correct label for memory and behavior protections (#107724) --- .../view/policy_forms/components/protection_switch.tsx | 7 ++++--- .../policy/view/policy_forms/protections/behavior.tsx | 10 +++++++++- .../policy/view/policy_forms/protections/malware.tsx | 10 +++++++++- .../policy/view/policy_forms/protections/memory.tsx | 10 +++++++++- .../view/policy_forms/protections/ransomware.tsx | 10 +++++++++- x-pack/plugins/translations/translations/ja-JP.json | 1 - x-pack/plugins/translations/translations/zh-CN.json | 1 - 7 files changed, 40 insertions(+), 9 deletions(-) diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx index eaa5a66e4e37..85db83bf0ada 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/components/protection_switch.tsx @@ -24,9 +24,11 @@ import { PolicyProtection, MacPolicyProtection, LinuxPolicyProtection } from '.. export const ProtectionSwitch = React.memo( ({ protection, + protectionLabel, osList, }: { protection: PolicyProtection; + protectionLabel?: string; osList: ImmutableArray>; }) => { const policyDetailsConfig = usePolicyDetailsSelector(policyConfig); @@ -93,10 +95,9 @@ export const ProtectionSwitch = React.memo( return ( { const OSes: Immutable = [OS.windows, OS.mac, OS.linux]; const protection = 'behavior_protection'; + const protectionLabel = i18n.translate( + 'xpack.securitySolution.endpoint.policy.protections.behavior', + { + defaultMessage: 'Behaviour protections', + } + ); return ( { })} supportedOss={[OperatingSystem.WINDOWS, OperatingSystem.MAC, OperatingSystem.LINUX]} dataTestSubj="behaviorProtectionsForm" - rightCorner={} + rightCorner={ + + } > 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 6374ba3bc4f5..5056cd2feb10 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 @@ -26,6 +26,12 @@ import { ProtectionSwitch } from '../components/protection_switch'; export const MalwareProtections = React.memo(() => { const OSes: Immutable = [OS.windows, OS.mac, OS.linux]; const protection = 'malware'; + const protectionLabel = i18n.translate( + 'xpack.securitySolution.endpoint.policy.protections.malware', + { + defaultMessage: 'Malware protections', + } + ); const isPlatinumPlus = useLicense().isPlatinumPlus(); return ( @@ -35,7 +41,9 @@ export const MalwareProtections = React.memo(() => { })} supportedOss={[OperatingSystem.WINDOWS, OperatingSystem.MAC, OperatingSystem.LINUX]} dataTestSubj="malwareProtectionsForm" - rightCorner={} + rightCorner={ + + } > {isPlatinumPlus && } diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx index 45d472a00f31..f12449fccbe2 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/memory.tsx @@ -25,6 +25,12 @@ import { ProtectionSwitch } from '../components/protection_switch'; export const MemoryProtection = React.memo(() => { const OSes: Immutable = [OS.windows]; const protection = 'memory_protection'; + const protectionLabel = i18n.translate( + 'xpack.securitySolution.endpoint.policy.protections.memory', + { + defaultMessage: 'Memory protections', + } + ); return ( { })} supportedOss={[OperatingSystem.WINDOWS]} dataTestSubj="memoryProtectionsForm" - rightCorner={} + rightCorner={ + + } > diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx index 70f41015bc25..96635482f4b6 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/ransomware.tsx @@ -25,6 +25,12 @@ import { ProtectionSwitch } from '../components/protection_switch'; export const Ransomware = React.memo(() => { const OSes: Immutable = [OS.windows]; const protection = 'ransomware'; + const protectionLabel = i18n.translate( + 'xpack.securitySolution.endpoint.policy.protections.ransomware', + { + defaultMessage: 'Ransomware protections', + } + ); return ( { })} supportedOss={[OperatingSystem.WINDOWS]} dataTestSubj="ransomwareProtectionsForm" - rightCorner={} + rightCorner={ + + } > diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 8decd2a76b9b..14e1516ba1f1 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -21527,7 +21527,6 @@ "xpack.securitySolution.endpoint.policy.details.platinum": "プラチナ", "xpack.securitySolution.endpoint.policy.details.prevent": "防御", "xpack.securitySolution.endpoint.policy.details.protections": "保護", - "xpack.securitySolution.endpoint.policy.details.protectionsEnabled": "{protectionName}保護は{mode, select, true {有効です} false {無効です}}", "xpack.securitySolution.endpoint.policy.details.ransomware": "ランサムウェア", "xpack.securitySolution.endpoint.policy.details.save": "保存", "xpack.securitySolution.endpoint.policy.details.settings": "設定", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 90e5e37f3d7a..40db95bd4fb7 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -22013,7 +22013,6 @@ "xpack.securitySolution.endpoint.policy.details.platinum": "白金级", "xpack.securitySolution.endpoint.policy.details.prevent": "防御", "xpack.securitySolution.endpoint.policy.details.protections": "防护", - "xpack.securitySolution.endpoint.policy.details.protectionsEnabled": "{protectionName}防护{mode, select, true {已启用} false {已禁用}}", "xpack.securitySolution.endpoint.policy.details.ransomware": "勒索软件", "xpack.securitySolution.endpoint.policy.details.save": "保存", "xpack.securitySolution.endpoint.policy.details.settings": "设置",