-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(() => { | |
/> | ||
</h6> | ||
</EuiTitle> | ||
<EuiText color="subdued" size="xs"> | ||
<i>{`Endpoint versions ${popupVersionsMap.get('malware')}`}</i> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this copy should refer to What are your thoughts @bfishel @caitlinbetz There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needs to be i18n'd (I think maybe you had this in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah okie that makes sense |
||
</EuiText> | ||
<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', | ||
})} | ||
/> | ||
</> | ||
); | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should just have this file be the place we store all of the version information for protections. We'd eventually add Ransomware and Register as AV. So we could rename this to just be @paul-tavares @efreeti let me know your thoughts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed @kevinlog 👍 |
||||||
|
||||||
const popupVersions: Array<[string, string]> = [ | ||||||
[ | ||||||
'malware', | ||||||
i18n.translate('xpack.securitySolution.endpoint.policyDetails.popup.version.7.11', { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see the need to i18n this if all we are going to store the version. |
||||||
defaultMessage: '7.11+', | ||||||
}), | ||||||
], | ||||||
]; | ||||||
|
||||||
export const popupVersionsMap = new Map<string, string>(popupVersions); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add typing so that
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question longer term would be: should we add this block of JSX manually to every new policy field or have it abstracted behind a component that will determine whether it should be shown or not just by the near existance of that prop name in the "field-to-version" map file.
Here is what I mean:
We could use a component like this:
using it:
And if we ever removed this options from the translation map file, then the text in the UI would just "magically" go way :)
Just an idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh that sounds like a noice idea. i can do that