Skip to content

Commit

Permalink
[Security Solution] update blocklist form copy (#128385)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeypoon authored Mar 23, 2022
1 parent 82d4cd5 commit fe9fb3e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const DETAILS_HEADER = i18n.translate('xpack.securitySolution.blocklists.
export const DETAILS_HEADER_DESCRIPTION = i18n.translate(
'xpack.securitySolution.blocklists.details.header.description',
{
defaultMessage: 'Add a blocklist to prevent selected applications from running on your hosts.',
defaultMessage:
'The blocklist prevents selected applications from running on your hosts by extending the list of processes the Endpoint considers malicious.',
}
);

Expand Down Expand Up @@ -61,6 +62,13 @@ export const VALUE_LABEL = i18n.translate('xpack.securitySolution.blocklists.val
defaultMessage: 'Value',
});

export const VALUE_LABEL_HELPER = i18n.translate(
'xpack.securitySolution.blocklists.value.label.helper',
{
defaultMessage: 'Type or copy & paste one or multiple comma delimited values',
}
);

export const CONDITION_FIELD_TITLE: { [K in ConditionEntryField]: string } = {
[ConditionEntryField.HASH]: i18n.translate('xpack.securitySolution.blocklists.entry.field.hash', {
defaultMessage: 'Hash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ const BLOCKLIST_PAGE_LABELS: ArtifactListPageProps['labels'] = {
defaultMessage: 'Blocklist',
}),
pageAboutInfo: i18n.translate('xpack.securitySolution.blocklist.pageAboutInfo', {
defaultMessage: 'Add a blocklist to block applications or files from running on the endpoint.',
defaultMessage:
'The blocklist prevents selected applications from running on your hosts by extending the list of processes the Endpoint considers malicious.',
}),
pageAddButtonTitle: i18n.translate('xpack.securitySolution.blocklist.pageAddButtonTitle', {
defaultMessage: 'Add blocklist entry',
}),
getShowingCountLabel: (total) =>
i18n.translate('xpack.securitySolution.blocklist.showingTotal', {
defaultMessage: 'Showing {total} {total, plural, one {blocklist} other {blocklists}}',
defaultMessage:
'Showing {total} {total, plural, one {blocklist entry} other {blocklist entries}}',
values: { total },
}),
cardActionEditLabel: i18n.translate('xpack.securitySolution.blocklist.cardActionEditLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import {
EuiTitle,
EuiFlexGroup,
EuiFlexItem,
EuiToolTip,
EuiIcon,
} from '@elastic/eui';
import {
OperatingSystem,
Expand Down Expand Up @@ -49,6 +51,7 @@ import {
SELECT_OS_LABEL,
VALUE_LABEL,
ERRORS,
VALUE_LABEL_HELPER,
} from '../../translations';
import {
EffectedPolicySelect,
Expand Down Expand Up @@ -165,6 +168,18 @@ export const BlockListForm = memo(
return selectableFields;
}, [selectedOs]);

const valueLabel = useMemo(() => {
return (
<div>
<EuiToolTip content={VALUE_LABEL_HELPER}>
<>
{VALUE_LABEL} <EuiIcon color="subdued" type="iInCircle" className="eui-alignTop" />
</>
</EuiToolTip>
</div>
);
}, []);

const validateValues = useCallback((nextItem: ArtifactFormComponentProps['item']) => {
const os = ((nextItem.os_types ?? [])[0] as OperatingSystem) ?? OperatingSystem.WINDOWS;
const {
Expand Down Expand Up @@ -432,7 +447,7 @@ export const BlockListForm = memo(
</EuiFlexGroup>
</EuiFormRow>
<EuiFormRow
label={VALUE_LABEL}
label={valueLabel}
isInvalid={visited.value && !!errorsRef.current.value?.length}
helpText={warningsRef.current.value}
error={errorsRef.current.value}
Expand Down

0 comments on commit fe9fb3e

Please sign in to comment.