From 030ab2674300fb044dd915dbf85e8f1f6466a2d5 Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Tue, 10 Sep 2024 10:29:03 -0700 Subject: [PATCH 1/2] feat: remove select all checkbox from org list --- src/components/sectionList/SectionList.tsx | 20 +++++++++++-------- .../list/OrganisationUnitList.tsx | 2 -- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/components/sectionList/SectionList.tsx b/src/components/sectionList/SectionList.tsx index 1abb07e7..d6c7e863 100644 --- a/src/components/sectionList/SectionList.tsx +++ b/src/components/sectionList/SectionList.tsx @@ -16,7 +16,7 @@ import { SelectedColumns } from './types' type SectionListProps = { headerColumns: SelectedColumns - onSelectAll: (checked: boolean) => void + onSelectAll?: (checked: boolean) => void allSelected?: boolean } @@ -31,13 +31,17 @@ export const SectionList = ({ - - onSelectAll(checked) - } - /> + {onSelectAll && ( + + onSelectAll!(checked) + } + /> + )} {headerColumns.length > 0 && ( diff --git a/src/pages/organisationUnits/list/OrganisationUnitList.tsx b/src/pages/organisationUnits/list/OrganisationUnitList.tsx index 7c4ffc9d..3cd6fa5c 100644 --- a/src/pages/organisationUnits/list/OrganisationUnitList.tsx +++ b/src/pages/organisationUnits/list/OrganisationUnitList.tsx @@ -200,12 +200,10 @@ export const OrganisationUnitList = () => { ({ label: h.column.columnDef.header as string, path: h.column.id, }))} - onSelectAll={() => table.toggleAllRowsSelected()} > Date: Wed, 11 Sep 2024 09:23:24 -0700 Subject: [PATCH 2/2] feat: disable ability to autocheck child when parent is selected this is because with multi pages we will never be able to select all the childs --- src/pages/organisationUnits/list/OrganisationUnitList.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/organisationUnits/list/OrganisationUnitList.tsx b/src/pages/organisationUnits/list/OrganisationUnitList.tsx index 3cd6fa5c..20ca5a4d 100644 --- a/src/pages/organisationUnits/list/OrganisationUnitList.tsx +++ b/src/pages/organisationUnits/list/OrganisationUnitList.tsx @@ -192,6 +192,7 @@ export const OrganisationUnitList = () => { state: { expanded, }, + enableSubRowSelection: false, }) return (