From 2230480a11a38b16e1119bd81552f29b53410dc1 Mon Sep 17 00:00:00 2001 From: kmalyjur <78563507+kmalyjur@users.noreply.github.com> Date: Tue, 30 Jun 2026 16:37:37 -0400 Subject: [PATCH] Fixes #39475 - Hide count in SelectAllCheckbox when unavailable --- .../PF4/TableIndexPage/Table/SelectAllCheckbox/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/SelectAllCheckbox/index.js b/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/SelectAllCheckbox/index.js index c8de478f90..9963d1ec7a 100644 --- a/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/SelectAllCheckbox/index.js +++ b/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/Table/SelectAllCheckbox/index.js @@ -124,7 +124,9 @@ const SelectAllCheckbox = ({ isDisabled={totalCount === 0 || areAllRowsSelected} onClick={handleSelectAll} > - {`${__('Select all')} (${totalCount})`} + {totalCount != null + ? `${__('Select all')} (${totalCount})` + : __('Select all')} ); } @@ -166,7 +168,7 @@ SelectAllCheckbox.propTypes = { selectDefault: PropTypes.func, selectedDefaultCount: PropTypes.number, pageRowCount: PropTypes.number, - totalCount: PropTypes.number, + totalCount: PropTypes.number, // null when count not yet available areAllRowsOnPageSelected: PropTypes.bool.isRequired, areAllRowsSelected: PropTypes.bool.isRequired, }; @@ -175,7 +177,7 @@ SelectAllCheckbox.defaultProps = { selectAll: noop, selectDefault: null, pageRowCount: 0, - totalCount: 0, + totalCount: null, selectedDefaultCount: 0, };