Skip to content

Commit

Permalink
[8.9] [Security Solution] Modal says "duplicating 0 rules" when you d…
Browse files Browse the repository at this point in the history
…uplicate an individual rule (#163908) (#164687)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Security Solution] Modal says "duplicating 0 rules" when you
duplicate an individual rule
(#163908)](#163908)

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

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

<!--BACKPORT
[{"author":{"name":"GitStart","email":"[email protected]"},"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 <[email protected]>
  • Loading branch information
banderror and gitstart authored Aug 24, 2023
1 parent 9934478 commit 128fde2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,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 (
<>
Expand Down Expand Up @@ -284,7 +284,7 @@ export const RulesTables = React.memo<RulesTableProps>(({ selectedTab }) => {
<BulkActionDuplicateExceptionsConfirmation
onCancel={cancelRuleDuplication}
onConfirm={confirmRuleDuplication}
rulesCount={numberOfSelectedRules}
rulesCount={rulesCount}
/>
)}
{isBulkEditFlyoutVisible && bulkEditActionType !== undefined && (
Expand Down

0 comments on commit 128fde2

Please sign in to comment.