[Security Solution][Exceptions] - Fix bulk rule duplicate, exception modal rule count (#152403)

## Summary

When user selects to bulk duplicate, a modal pops up asking them how
they want to proceed with any rule exceptions. The rule count in this
modal is wrong when all rules are selected. Updated so that now the
count in the modal matches the actual selected count.
This commit is contained in:
Yara Tercero 2023-03-01 13:34:52 -08:00 committed by GitHub
parent df2869a5fe
commit 957c0d43c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,6 +231,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;
return (
<>
@ -275,7 +276,7 @@ export const RulesTables = React.memo<RulesTableProps>(({ selectedTab }) => {
<BulkActionDuplicateExceptionsConfirmation
onCancel={cancelRuleDuplication}
onConfirm={confirmRuleDuplication}
rulesCount={selectedRuleIds?.length ? selectedRuleIds?.length : 1}
rulesCount={numberOfSelectedRules}
/>
)}
{isBulkEditFlyoutVisible && bulkEditActionType !== undefined && (