From 955cbd6281d5175c988ad5b7ed261ed59d281f33 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Thu, 24 Aug 2023 08:13:17 +0100 Subject: [PATCH] [Security Solution] Modal says "duplicating 0 rules" when you duplicate 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. (cherry picked from commit 59f20582605d5dcb489b6534b027ec19475e7136) --- .../components/rules_table/rules_tables.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx index bae55018ec778..9876f662ccb6e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/rules_tables.tsx @@ -242,7 +242,7 @@ export const RulesTables = React.memo(({ 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 ( <> @@ -284,7 +284,7 @@ export const RulesTables = React.memo(({ selectedTab }) => { )} {isBulkEditFlyoutVisible && bulkEditActionType !== undefined && (