Skip to content
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 @@ -53,6 +53,19 @@ describe('ProcessTreeAlertsFiltersFilter component', () => {
expect(filterCountStatus).toBeTruthy();
});

it('should show pluralise correctly', async () => {
renderResult = mockedContext.render(
<ProcessTreeAlertsFilter {...props} totalAlertsCount={1} filteredAlertsCount={1} />
);

const filterCountStatus = renderResult.queryByTestId(
'sessionView:sessionViewAlertDetailsFilterStatus'
);

expect(filterCountStatus).toHaveTextContent('Showing 1 alert');
expect(filterCountStatus).toBeTruthy();
});

it('should call onAlertEventCategorySelected with alert category when filter item is clicked ', () => {
const mockAlertEventCategorySelectedEvent = jest.fn();
renderResult = mockedContext.render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,10 @@ export const ProcessTreeAlertsFilter = ({
{totalAlertsCount === filteredAlertsCount && (
<FormattedMessage
id="xpack.sessionView.alertTotalCountStatusLabel"
defaultMessage="Showing {count} alerts"
defaultMessage="{count, plural, one {Showing <bold>#</bold> alert} other {Showing <bold>#</bold> alerts}}"
values={{
count: <strong>{totalAlertsCount}</strong>,
count: totalAlertsCount,
bold: (str: string) => <strong>{str}</strong>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before and after image for that could be nice

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a quick way to have session view data in my local env, but check the unit test, it should cover it, at least the text is there. The markup should work as well, taken straight from the docs https://formatjs.io/docs/react-intl/components#rich-text-formatting. But if we have a quick way to have the session view in local, happy to test it manually

}}
/>
)}
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -41491,7 +41491,6 @@
"xpack.sessionView.alertFilteredCountStatusLabel": " Affichage de {count} alertes",
"xpack.sessionView.alerts": "Alertes",
"xpack.sessionView.alertsLoadMoreButton": "Charger plus d'alertes",
"xpack.sessionView.alertTotalCountStatusLabel": "Affichage de {count} alertes",
"xpack.sessionView.backToInvestigatedAlert": "Retour à l'alerte examinée",
"xpack.sessionView.blockedBadge": "Bloqué",
"xpack.sessionView.childProcesses": "Processus enfants",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -41475,7 +41475,6 @@
"xpack.sessionView.alertFilteredCountStatusLabel": " {count}件のアラートを表示しています",
"xpack.sessionView.alerts": "アラート",
"xpack.sessionView.alertsLoadMoreButton": "その他のアラートを読み込む",
"xpack.sessionView.alertTotalCountStatusLabel": "{count}件のアラートを表示しています",
"xpack.sessionView.backToInvestigatedAlert": "調査されたアラートに戻る",
"xpack.sessionView.blockedBadge": "ブロック",
"xpack.sessionView.childProcesses": "子プロセス",
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -41518,7 +41518,6 @@
"xpack.sessionView.alertFilteredCountStatusLabel": " 正在显示 {count} 个告警",
"xpack.sessionView.alerts": "告警",
"xpack.sessionView.alertsLoadMoreButton": "加载更多告警",
"xpack.sessionView.alertTotalCountStatusLabel": "正在显示 {count} 个告警",
"xpack.sessionView.backToInvestigatedAlert": "返回到已调查告警",
"xpack.sessionView.blockedBadge": "已阻止",
"xpack.sessionView.childProcesses": "子进程",
Expand Down