Skip to content

Commit

Permalink
[Security Solutions] Update cell actions copy (#209436)
Browse files Browse the repository at this point in the history
## Summary

This is a part 2 following #206340
to standardize actions in the alerts kpi visualizations.

This PR updates the following copies:
- Changed `Filter In` to `Filter for`: to stay consistent with Lens and
Discover
<img width="1070" alt="image"
src="https://github.com/user-attachments/assets/3341279f-7e8f-4470-9476-86809840ff55"
/>

- Updated letter cases by following copy guidelines
  - `Filter Out` -> `Filter out` 
  - `Copy to Clipboard` -> `Copy to clipboard`
  - `Investigate in timeline` -> `Investigate in Timeline`
  - `Add to timeline` -> `Add to Timeline`


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
christineweng authored Feb 10, 2025
1 parent 3ba912f commit d2c5132
Show file tree
Hide file tree
Showing 30 changed files with 44 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Default createCopyToClipboardActionFactory', () => {
});

it('should return display name', () => {
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to Clipboard');
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to clipboard');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ACTION_INCOMPATIBLE_VALUE_WARNING } from '../translations';

const ICON = 'copyClipboard';
const COPY_TO_CLIPBOARD = i18n.translate('cellActions.actions.copyToClipboard.displayName', {
defaultMessage: 'Copy to Clipboard',
defaultMessage: 'Copy to clipboard',
});
const COPY_TO_CLIPBOARD_SUCCESS = i18n.translate(
'cellActions.actions.copyToClipboard.successMessage',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('createFilterInActionFactory', () => {
});

it('should return display name', () => {
expect(filterInAction.getDisplayName(context)).toEqual('Filter In');
expect(filterInAction.getDisplayName(context)).toEqual('Filter for');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { DefaultActionsSupportedValue } from '../types';

const ICON = 'plusInCircle';
const FILTER_IN = i18n.translate('cellActions.actions.filterIn', {
defaultMessage: 'Filter In',
defaultMessage: 'Filter for',
});

export const createFilterInActionFactory = createCellActionFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('createFilterOutAction', () => {
});

it('should return display name', () => {
expect(filterOutAction.getDisplayName(context)).toEqual('Filter Out');
expect(filterOutAction.getDisplayName(context)).toEqual('Filter out');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { DefaultActionsSupportedValue } from '../types';

const ICON = 'minusInCircle';
const FILTER_OUT = i18n.translate('cellActions.actions.filterOut', {
defaultMessage: 'Filter Out',
defaultMessage: 'Filter out',
});

export const createFilterOutActionFactory = createCellActionFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44134,7 +44134,6 @@
"xpack.threatIntelligence.paywall.title": "Toujours plus avec Security !",
"xpack.threatIntelligence.paywall.trial": "Démarrer un essai gratuit",
"xpack.threatIntelligence.paywall.upgrade": "Mettre à niveau",
"xpack.threatIntelligence.queryBar.filterIn": "Inclure",
"xpack.threatIntelligence.queryBar.filterOut": "Exclure",
"xpack.threatIntelligence.timeline.addToTimeline": "Ajouter à la chronologie",
"xpack.threatIntelligence.timeline.investigateInTimelineButtonIcon": "Investiguer dans la chronologie",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43988,7 +43988,6 @@
"xpack.threatIntelligence.paywall.title": "Securityではさまざまなことが可能です!",
"xpack.threatIntelligence.paywall.trial": "無料トライアルをはじめる",
"xpack.threatIntelligence.paywall.upgrade": "アップグレード",
"xpack.threatIntelligence.queryBar.filterIn": "フィルタリング",
"xpack.threatIntelligence.queryBar.filterOut": "除外",
"xpack.threatIntelligence.timeline.addToTimeline": "タイムラインに追加",
"xpack.threatIntelligence.timeline.investigateInTimelineButtonIcon": "タイムラインで調査",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43333,7 +43333,6 @@
"xpack.threatIntelligence.paywall.title": "Security 让您事半功倍!",
"xpack.threatIntelligence.paywall.trial": "开始免费试用",
"xpack.threatIntelligence.paywall.upgrade": "升级",
"xpack.threatIntelligence.queryBar.filterIn": "筛选",
"xpack.threatIntelligence.queryBar.filterOut": "筛除",
"xpack.threatIntelligence.timeline.addToTimeline": "添加到时间线",
"xpack.threatIntelligence.timeline.investigateInTimelineButtonIcon": "在时间线中调查",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const checkActionItemsInResults = ({
cy.contains('View in Discover').should(discover ? 'exist' : 'not.exist');
cy.contains('View in Lens').should(lens ? 'exist' : 'not.exist');
cy.contains('Add to Case').should(cases ? 'exist' : 'not.exist');
cy.contains('Add to timeline investigation').should(timeline ? 'exist' : 'not.exist');
cy.contains('Add to Timeline investigation').should(timeline ? 'exist' : 'not.exist');
};

export const takeOsqueryActionWithParams = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ describe('add to timeline', () => {
children: i18n.ADDED_TO_TIMELINE_OR_TEMPLATE_MESSAGE(providerA.name, true),
};
const wrapper = render(<AddSuccessMessage {...message} />);
expect(wrapper.container.textContent).toBe('Added a to timeline');
expect(wrapper.container.textContent).toBe('Added a to Timeline');
});

test('Add success is called with "template" if timeline type is template', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createFilter, getAdditionalScreenReaderOnlyContext } from '../utils';
import { HoverActionComponentProps, FilterValueFnArgs } from './types';

export const FILTER_FOR_VALUE = i18n.translate('xpack.timelines.hoverActions.filterIn', {
defaultMessage: 'Filter In',
defaultMessage: 'Filter for',
});
export const FILTER_FOR_VALUE_KEYBOARD_SHORTCUT = 'f';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { createFilter, getAdditionalScreenReaderOnlyContext } from '../utils';
import { HoverActionComponentProps, FilterValueFnArgs } from './types';

export const FILTER_OUT_VALUE = i18n.translate('xpack.timelines.hoverActions.filterOut', {
defaultMessage: 'Filter Out',
defaultMessage: 'Filter out',
});

export const FILTER_OUT_VALUE_KEYBOARD_SHORTCUT = 'o';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
import { i18n } from '@kbn/i18n';

export const ADD_TO_TIMELINE = i18n.translate('xpack.timelines.hoverActions.addToTimeline', {
defaultMessage: 'Add to timeline investigation',
defaultMessage: 'Add to Timeline investigation',
});

export const ADDED_TO_TIMELINE_OR_TEMPLATE_MESSAGE = (fieldOrValue: string, isTimeline: boolean) =>
i18n.translate('xpack.timelines.hoverActions.addToTimeline.addedFieldMessage', {
values: { fieldOrValue, isTimeline },
defaultMessage: `Added {fieldOrValue} to {isTimeline, select, true {timeline} other {template}}`,
defaultMessage: `Added {fieldOrValue} to {isTimeline, select, true {Timeline} other {template}}`,
});

export const COPY_TO_CLIPBOARD = i18n.translate(
'xpack.timelines.dragAndDrop.copyToClipboardTooltip',
{
defaultMessage: 'Copy to Clipboard',
defaultMessage: 'Copy to clipboard',
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('createAddToTimelineCellAction', () => {
});

it('should return display name', () => {
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to timeline');
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to Timeline');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('createAddToNewTimelineCellAction', () => {
});

it('should return display name', () => {
expect(addToTimelineAction.getDisplayName(context)).toEqual('Investigate in timeline');
expect(addToTimelineAction.getDisplayName(context)).toEqual('Investigate in Timeline');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export const ADD_TO_TIMELINE_ICON = 'timeline';
export const ADD_TO_TIMELINE = i18n.translate(
'xpack.securitySolution.actions.cellValue.addToTimeline.displayName',
{
defaultMessage: 'Add to timeline',
defaultMessage: 'Add to Timeline',
}
);
export const INVESTIGATE_IN_TIMELINE = i18n.translate(
'xpack.securitySolution.actions.cellValue.addToNewTimeline.displayName',
{
defaultMessage: 'Investigate in timeline',
defaultMessage: 'Investigate in Timeline',
}
);

Expand All @@ -42,15 +42,15 @@ export const ALERTS_COUNT = (entity: string, description: string) =>
export const ADD_TO_TIMELINE_SUCCESS_TITLE = (value: string) =>
i18n.translate('xpack.securitySolution.actions.addToTimeline.addedFieldMessage', {
values: { fieldOrValue: value },
defaultMessage: `Added {fieldOrValue} to timeline`,
defaultMessage: `Added {fieldOrValue} to Timeline`,
});

export const ADD_TO_TIMELINE_FAILED_TITLE = i18n.translate(
'xpack.securitySolution.actions.cellValue.addToTimeline.warningTitle',
{ defaultMessage: 'Unable to add to timeline' }
{ defaultMessage: 'Unable to add to Timeline' }
);

export const ADD_TO_TIMELINE_FAILED_TEXT = i18n.translate(
'xpack.securitySolution.actions.cellValue.addToTimeline.warningMessage',
{ defaultMessage: 'Filter received is empty or cannot be added to timeline' }
{ defaultMessage: 'Filter received is empty or cannot be added to Timeline' }
);
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('createAddToTimelineDiscoverCellActionFactory', () => {
});

it('should return display name', () => {
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to timeline');
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to Timeline');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('createAddToTimelineLensAction', () => {
});

it('should return display name', () => {
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to timeline');
expect(addToTimelineAction.getDisplayName(context)).toEqual('Add to Timeline');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('createCopyToClipboardCellActionFactory', () => {
});

it('should return display name', () => {
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to Clipboard');
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to clipboard');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const COPY_TO_CLIPBOARD_ICON = 'copyClipboard';
export const COPY_TO_CLIPBOARD = i18n.translate(
'xpack.securitySolution.actions.cellValue.copyToClipboard.displayName',
{
defaultMessage: 'Copy to Clipboard',
defaultMessage: 'Copy to clipboard',
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('createCopyToClipboardDiscoverCellActionFactory', () => {
});

it('should return display name', () => {
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to Clipboard');
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to clipboard');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('createCopyToClipboardLensAction', () => {
});

it('should return display name', () => {
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to Clipboard');
expect(copyToClipboardAction.getDisplayName(context)).toEqual('Copy to clipboard');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('createFilterInCellActionFactory', () => {
} as SecurityCellActionExecutionContext;

it('should return display name', () => {
expect(filterInAction.getDisplayName(context)).toEqual('Filter In');
expect(filterInAction.getDisplayName(context)).toEqual('Filter for');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('createFilterOutCellActionFactory', () => {
} as SecurityCellActionExecutionContext;

it('should return display name', () => {
expect(filterOutAction.getDisplayName(context)).toEqual('Filter Out');
expect(filterOutAction.getDisplayName(context)).toEqual('Filter out');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('createFilterInDiscoverCellActionFactory', () => {
} as SecurityCellActionExecutionContext;

it('should return display name', () => {
expect(filterInAction.getDisplayName(context)).toEqual('Filter In');
expect(filterInAction.getDisplayName(context)).toEqual('Filter for');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('createFilterOutDiscoverCellActionFactory', () => {
} as SecurityCellActionExecutionContext;

it('should return display name', () => {
expect(filterOutAction.getDisplayName(context)).toEqual('Filter Out');
expect(filterOutAction.getDisplayName(context)).toEqual('Filter out');
});

it('should return icon type', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { useFilterInOut } from '../hooks/use_filter_in_out';
import { FilterIn } from '../utils/filter';
import { Indicator } from '../../../../common/types/indicator';
import { FILTER_IN_TITLE } from './translations';
import { FILTER_FOR_TITLE } from './translations';

const ICON_TYPE = 'plusInCircle';

Expand Down Expand Up @@ -60,9 +60,9 @@ export const FilterInButtonIcon: VFC<FilterInProps> = ({
}

return (
<EuiToolTip content={FILTER_IN_TITLE}>
<EuiToolTip content={FILTER_FOR_TITLE}>
<EuiButtonIcon
aria-label={FILTER_IN_TITLE}
aria-label={FILTER_FOR_TITLE}
iconType={ICON_TYPE}
iconSize="s"
size="xs"
Expand Down Expand Up @@ -92,16 +92,16 @@ export const FilterInButtonEmpty: VFC<FilterInProps> = ({
}

return (
<EuiToolTip content={FILTER_IN_TITLE}>
<EuiToolTip content={FILTER_FOR_TITLE}>
<EuiButtonEmpty
aria-label={FILTER_IN_TITLE}
aria-label={FILTER_FOR_TITLE}
iconType={ICON_TYPE}
iconSize="s"
color="primary"
onClick={filterFn}
data-test-subj={dataTestSub}
>
{FILTER_IN_TITLE}
{FILTER_FOR_TITLE}
</EuiButtonEmpty>
</EuiToolTip>
);
Expand Down Expand Up @@ -132,7 +132,7 @@ export const FilterInContextMenu: VFC<FilterInProps> = ({
onClick={filterFn}
data-test-subj={dataTestSub}
>
{FILTER_IN_TITLE}
{FILTER_FOR_TITLE}
</EuiContextMenuItem>
);
};
Expand All @@ -156,10 +156,10 @@ export const FilterInCellAction: VFC<FilterInCellActionProps> = ({
}

return (
<EuiToolTip content={FILTER_IN_TITLE}>
<EuiToolTip content={FILTER_FOR_TITLE}>
<EuiFlexItem data-test-subj={dataTestSub}>
<Component aria-label={FILTER_IN_TITLE} iconType={ICON_TYPE} onClick={filterFn}>
{FILTER_IN_TITLE}
<Component aria-label={FILTER_FOR_TITLE} iconType={ICON_TYPE} onClick={filterFn}>
{FILTER_FOR_TITLE}
</Component>
</EuiFlexItem>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import { i18n } from '@kbn/i18n';

export const FILTER_IN_TITLE = i18n.translate('xpack.threatIntelligence.queryBar.filterIn', {
defaultMessage: 'Filter In',
export const FILTER_FOR_TITLE = i18n.translate('xpack.threatIntelligence.queryBar.filterFor', {
defaultMessage: 'Filter for',
});

export const FILTER_OUT_TITLE = i18n.translate('xpack.threatIntelligence.queryBar.filterOut', {
defaultMessage: 'Filter Out',
defaultMessage: 'Filter out',
});
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ describe('KPI visualizations in Alerts Page', { tags: ['@ess', '@serverless'] },
clickAlertsHistogramLegend();
clickAlertsHistogramLegendAddToTimeline(ruleConfigs.name);

cy.get(TOASTER).should('have.text', `Added ${ruleConfigs.name} to timeline`);
cy.get(TOASTER).should('have.text', `Added ${ruleConfigs.name} to Timeline`);
});
});
});

0 comments on commit d2c5132

Please sign in to comment.