Skip to content

Commit

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

 ## What does this PR do?
 * It fixes the count on the duplicate modal when duplicating an individual rule.
 
 ## Issue References
Fixes #162035
 
 ## Video/Screenshot Demo
 ##### Steps to reproduce & Fix:
https://www.loom.com/share/931e42c1490d4483958b8f98dc0ba534?sid=07c67df5-b380-41a5-90f1-f64f326a12d9

___
 
 This code was written and reviewed by GitStart Community. Growing future engineers, one PR at a time.
  • Loading branch information
gitstart authored Aug 24, 2023
1 parent 656e783 commit 59f2058
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
Expand Down Expand Up @@ -302,7 +302,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 59f2058

Please sign in to comment.