diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx index 63cf3b314556b..7575bb5385018 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/components/notify_user_option.tsx @@ -18,6 +18,7 @@ import { EuiText, EuiTextArea, } from '@elastic/eui'; +import { PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION } from '../protection_notice_supported_endpoint_version'; import { useTestIdGenerator } from '../../../../../hooks/use_test_id_generator'; import { getEmptyValue } from '../../../../../../common/components/empty_value'; import { useLicense } from '../../../../../../common/hooks/use_license'; @@ -264,12 +265,9 @@ export const SupportedVersionForProtectionNotice = React.memo( 'data-test-subj'?: string; }) => { const version = useMemo(() => { - return { - malware: '7.11+', - ransomware: '7.12+', - memory_protection: '7.15+', - behavior_protection: '7.15+', - }[protection]; + return PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION[ + protection as keyof typeof PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION + ]; }, [protection]); if (!version) { diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts index b84c32fbeee97..8daff2a2456ec 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/index.ts @@ -6,3 +6,4 @@ */ export { PolicySettingsForm } from './policy_settings_form'; +export { PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION } from './protection_notice_supported_endpoint_version'; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts new file mode 100644 index 0000000000000..5e518cb6215a6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version.ts @@ -0,0 +1,13 @@ +/* + * 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. + */ + +export const PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION = Object.freeze({ + malware: '7.11+', + ransomware: '7.12+', + memory_protection: '7.15+', + behavior_protection: '7.15+', +}); diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/policy_details.ts b/x-pack/test/security_solution_endpoint/apps/integrations/policy_details.ts index d01f869e285e9..0c1c2fdab3955 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/policy_details.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/policy_details.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data'; -import { popupVersionsMap } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions'; +import { PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_settings_form'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PolicyTestResourceInfo } from '../../services/endpoint_policy'; @@ -108,7 +108,10 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ); expect(await supportedVersionElement.getVisibleText()).to.equal( - 'Agent version ' + popupVersionsMap.get(protection) + 'Agent version ' + + PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION[ + protection as keyof typeof PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION + ] ); });