Skip to content

Commit

Permalink
[Security Solution][Endpoint][Admin] Malware Protections Notify User …
Browse files Browse the repository at this point in the history
…Version (#81415)
  • Loading branch information
parkiino committed Oct 27, 2020
1 parent 4267321 commit b5818ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
EuiRadio,
EuiSwitch,
EuiTitle,
EuiText,
EuiSpacer,
htmlIdGenerator,
EuiCallOut,
Expand All @@ -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;
Expand Down Expand Up @@ -83,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 (
<EuiText color="subdued" size="xs">
<i>
<FormattedMessage
id="xpack.securitySolution.endpoint.policyDetails.supportedVersion"
defaultMessage="Agent version {version}"
values={{ version }}
/>
</i>
</EuiText>
);
};

/** The Malware Protections form for policy details
* which will configure for all relevant OSes.
*/
Expand Down Expand Up @@ -189,14 +210,15 @@ export const MalwareProtections = React.memo(() => {
/>
</h6>
</EuiTitle>
<SupportedVersionNotice optionName="malware" />
<EuiSpacer size="s" />
<EuiCheckbox
id="xpack.securitySolution.endpoint.policyDetail.malware.userNotification"
onChange={handleUserNotificationCheckbox}
checked={userNotificationSelected}
label={i18n.translate(
'xpack.securitySolution.endpoint.policyDetail.malware.userNotification',
{ defaultMessage: 'User Notification' }
)}
label={i18n.translate('xpack.securitySolution.endpoint.policyDetail.malware.notifyUser', {
defaultMessage: 'Notify User',
})}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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.
*/

const popupVersions: Array<[string, string]> = [['malware', '7.11+']];

export const popupVersionsMap: ReadonlyMap<string, string> = new Map<string, string>(popupVersions);

0 comments on commit b5818ec

Please sign in to comment.