diff --git a/package.json b/package.json index 5485c9278..c0bc70233 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "0.0.61-beta-3", + "version": "0.0.61-beta-4", "description": "Supporting common component library", "main": "dist/index.js", "scripts": { diff --git a/src/Shared/Components/BulkSelection/BulkSelection.tsx b/src/Shared/Components/BulkSelection/BulkSelection.tsx index 3f180e67f..8f87a51e5 100644 --- a/src/Shared/Components/BulkSelection/BulkSelection.tsx +++ b/src/Shared/Components/BulkSelection/BulkSelection.tsx @@ -9,8 +9,8 @@ import { ReactComponent as ICCheckAll } from '../../../Assets/Icon/ic-check-all. import { ReactComponent as ICClose } from '../../../Assets/Icon/ic-close.svg' const BulkSelection = ({ showPagination }: BulkSelectionProps) => { - const { handleBulkSelection, selectedIdentifiers, isChecked, checkboxValue } = useBulkSelection() - const areOptionsSelected = Object.keys(selectedIdentifiers).length > 0 + const { handleBulkSelection, isChecked, checkboxValue, getSelectedIdentifiersCount } = useBulkSelection() + const areOptionsSelected = getSelectedIdentifiersCount() > 0 const BulkSelectionItems: BulkSelectionDropdownItemsType[] = [ { locator: BulkSelectionEvents.SELECT_ALL_ON_PAGE, diff --git a/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx b/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx index 908ae0e4a..3ed5e6cdb 100644 --- a/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx +++ b/src/Shared/Components/BulkSelection/BulkSelectionProvider.tsx @@ -16,6 +16,8 @@ const BulkSelectionContext = createContext>({ handleBulkSelection: noop, isChecked: false, checkboxValue: CHECKBOX_VALUE.CHECKED, + isBulkSelectionApplied: false, + getSelectedIdentifiersCount: noop, }) export const useBulkSelection = () => { diff --git a/src/Shared/Components/BulkSelection/types.tsx b/src/Shared/Components/BulkSelection/types.tsx index 4bdbd4ac6..2c74e5d63 100644 --- a/src/Shared/Components/BulkSelection/types.tsx +++ b/src/Shared/Components/BulkSelection/types.tsx @@ -26,6 +26,8 @@ export interface GetBulkSelectionCheckboxValuesType { export interface UseBulkSelectionReturnType extends GetBulkSelectionCheckboxValuesType { selectedIdentifiers: T handleBulkSelection: ({ action, data }: HandleBulkSelectionType) => void + isBulkSelectionApplied: boolean + getSelectedIdentifiersCount: () => number } export interface BulkSelectionProps {