Skip to content

Commit 7ff2e12

Browse files
[9.2] [SecuritySolution] Update dashboard selection count (#241326) (#241688)
# Backport This will backport the following commits from `main` to `9.2`: - [[SecuritySolution] Update dashboard selection count (#241326)](#241326) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Angela Chuang","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-11-03T18:43:20Z","message":"[SecuritySolution] Update dashboard selection count (#241326)\n\n## Summary\n\nFixes https://github.com/elastic/kibana/issues/240407\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"5ef9b2ce2e487a00c7e08ee7834f8b67048b52b2","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Threat Hunting","backport:version","v9.3.0","v9.2.1"],"title":"[SecuritySolution] Update dashboard selection count","number":241326,"url":"https://github.com/elastic/kibana/pull/241326","mergeCommit":{"message":"[SecuritySolution] Update dashboard selection count (#241326)\n\n## Summary\n\nFixes https://github.com/elastic/kibana/issues/240407\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"5ef9b2ce2e487a00c7e08ee7834f8b67048b52b2"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241326","number":241326,"mergeCommit":{"message":"[SecuritySolution] Update dashboard selection count (#241326)\n\n## Summary\n\nFixes https://github.com/elastic/kibana/issues/240407\n\n### Checklist\n\n\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>","sha":"5ef9b2ce2e487a00c7e08ee7834f8b67048b52b2"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Angela Chuang <[email protected]>
1 parent c9f2b0f commit 7ff2e12

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/components/bulk_actions/install_translated.test.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import React from 'react';
99
import { render, fireEvent } from '@testing-library/react';
1010
import { InstallTranslatedButton } from './install_translated';
1111
import { getDashboardMigrationDashboardMock } from '../../../../../common/siem_migrations/model/__mocks__';
12+
import type { BulkActionsItem } from './types';
1213

1314
describe('InstallTranslatedButton', () => {
1415
const mockInstallTranslatedItems = jest.fn();
@@ -29,6 +30,20 @@ describe('InstallTranslatedButton', () => {
2930
});
3031

3132
it('renders the button with correct text when items are selected', () => {
33+
const additionalItem = {
34+
...getDashboardMigrationDashboardMock(),
35+
id: 'EfDKfJkBBI4hy8QbQ_BC',
36+
migration_id: '9bcd7ea8-f617-4dc4-ab4a-da323c0a18b3',
37+
translation_result: 'full',
38+
} as BulkActionsItem;
39+
const selectedItems: BulkActionsItem[] = [getDashboardMigrationDashboardMock(), additionalItem];
40+
const { getByText } = render(
41+
<InstallTranslatedButton {...defaultProps} selectedItems={selectedItems} />
42+
);
43+
expect(getByText('Install selected (2)')).toBeInTheDocument();
44+
});
45+
46+
it('renders the button with correct text when partially translated items are selected', () => {
3247
const selectedItems = [getDashboardMigrationDashboardMock()];
3348
const { getByText } = render(
3449
<InstallTranslatedButton {...defaultProps} selectedItems={selectedItems} />

x-pack/solutions/security/plugins/security_solution/public/siem_migrations/common/components/bulk_actions/install_translated.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export const InstallTranslatedButton = memo(
3232
const numberOfSelectedItems = selectedItems.length;
3333
const installTranslatedItemsSelected = useMemo(
3434
() =>
35-
selectedItems.filter((item) => item.translation_result === MigrationTranslationResult.FULL)
36-
.length,
35+
selectedItems.filter(
36+
(item) =>
37+
item.translation_result === MigrationTranslationResult.FULL ||
38+
item.translation_result === MigrationTranslationResult.PARTIAL
39+
).length,
3740
[selectedItems]
3841
);
3942
const isSelected = installTranslatedItemsSelected > 0;

0 commit comments

Comments
 (0)