Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove select all checkbox from org list #414

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/components/sectionList/SectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { SelectedColumns } from './types'

type SectionListProps = {
headerColumns: SelectedColumns
onSelectAll: (checked: boolean) => void
onSelectAll?: (checked: boolean) => void
allSelected?: boolean
}

Expand All @@ -31,13 +31,17 @@ export const SectionList = ({
<TableHead>
<DataTableRow>
<DataTableColumnHeader width={'48px'}>
<Checkbox
dataTest="section-list-selectall"
checked={allSelected}
onChange={({ checked }: CheckBoxOnChangeObject) =>
onSelectAll(checked)
}
/>
{onSelectAll && (
<Checkbox
dataTest="section-list-selectall"
checked={allSelected}
onChange={({
checked,
}: CheckBoxOnChangeObject) =>
onSelectAll!(checked)
}
/>
)}
</DataTableColumnHeader>
{headerColumns.length > 0 && (
<HeaderColumns headerColumns={headerColumns} />
Expand Down
3 changes: 1 addition & 2 deletions src/pages/organisationUnits/list/OrganisationUnitList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export const OrganisationUnitList = () => {
state: {
expanded,
},
enableSubRowSelection: false,
})

return (
Expand All @@ -200,12 +201,10 @@ export const OrganisationUnitList = () => {
<IdentifiableFilter />
<ToolbarNormal />
<SectionList
allSelected={table.getIsAllRowsSelected()}
headerColumns={table.getHeaderGroups()[0].headers.map((h) => ({
label: h.column.columnDef.header as string,
path: h.column.id,
}))}
onSelectAll={() => table.toggleAllRowsSelected()}
>
<OrganisationUnitListMessage
isFiltering={isFiltering}
Expand Down
Loading