Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Endpoint][Admin] Malware Protections Notify User Version #81415

Merged
merged 4 commits into from
Oct 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);