[8.10] [Security Solution] Modal says "duplicating 0 rules" when you duplicate an individual rule (#163908) (#164686)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Security Solution] Modal says "duplicating 0 rules" when you
duplicate an individual rule
(#163908)](https://github.com/elastic/kibana/pull/163908)

<!--- Backport version: 8.9.8 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"GitStart","email":"1501599+gitstart@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-08-24T07:13:17Z","message":"[Security
Solution] Modal says \"duplicating 0 rules\" when you duplicate an
individual rule (#163908)\n\n ## What does this PR do?\r\n * It fixes
the count on the duplicate modal when duplicating an individual
rule.\r\n \r\n ## Issue References\r\nFixes #162035\r\n \r\n ##
Video/Screenshot Demo\r\n ##### Steps to reproduce &
Fix:\r\nhttps://www.loom.com/share/931e42c1490d4483958b8f98dc0ba534?sid=07c67df5-b380-41a5-90f1-f64f326a12d9\r\n\r\n___\r\n
\r\n This code was written and reviewed by GitStart Community. Growing
future engineers, one PR at a
time.","sha":"59f20582605d5dcb489b6534b027ec19475e7136","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","💝community","Team:Detections
and Resp","Team: SecuritySolution","Feature:Rule
Management","Team:Detection Rule
Management","v8.10.0","v8.9.2"],"number":163908,"url":"https://github.com/elastic/kibana/pull/163908","mergeCommit":{"message":"[Security
Solution] Modal says \"duplicating 0 rules\" when you duplicate an
individual rule (#163908)\n\n ## What does this PR do?\r\n * It fixes
the count on the duplicate modal when duplicating an individual
rule.\r\n \r\n ## Issue References\r\nFixes #162035\r\n \r\n ##
Video/Screenshot Demo\r\n ##### Steps to reproduce &
Fix:\r\nhttps://www.loom.com/share/931e42c1490d4483958b8f98dc0ba534?sid=07c67df5-b380-41a5-90f1-f64f326a12d9\r\n\r\n___\r\n
\r\n This code was written and reviewed by GitStart Community. Growing
future engineers, one PR at a
time.","sha":"59f20582605d5dcb489b6534b027ec19475e7136"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: GitStart <1501599+gitstart@users.noreply.github.com>
This commit is contained in:
Georgii Gorbachev 2023-08-24 16:12:33 +02:00 committed by GitHub
parent 0e988a60f2
commit 93d4f66c37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -249,7 +249,7 @@ export const RulesTables = React.memo<RulesTableProps>(({ selectedTab }) => {
const shouldShowLinearProgress = (isFetched && isRefetching) || isUpgradingSecurityPackages;
const shouldShowLoadingOverlay = (!isFetched && isRefetching) || isPreflightInProgress;
const numberOfSelectedRules = isAllSelected ? pagination.total : selectedRuleIds?.length ?? 1;
const rulesCount = Math.max(isAllSelected ? pagination.total : selectedRuleIds?.length ?? 0, 1);
return (
<>
@ -302,7 +302,7 @@ export const RulesTables = React.memo<RulesTableProps>(({ selectedTab }) => {
<BulkActionDuplicateExceptionsConfirmation
onCancel={cancelRuleDuplication}
onConfirm={confirmRuleDuplication}
rulesCount={numberOfSelectedRules}
rulesCount={rulesCount}
/>
)}
{isBulkEditFlyoutVisible && bulkEditActionType !== undefined && (