Selection & toolbar
Row selection, selected_ids, and ActionsOfSelection
Bulk actions and bulk-eligible row actions share the same selection model in tableColumns slice.
When selection is enabled
File: ./ApiTables/core/TableBody.tsx
RDT selectableRows is true when:
bulkActions.length > 0, or- Any structure row action has
applicableAsBulkAction: true
Checkbox column uses ./ApiTables/general-components/Checkbox.tsx as RDT adapter.
Selection state
| Field | Updated by |
|---|---|
selectedRows | RDT onSelectedRowsChange → _setSelectedRows |
selectedIds | Derived ids for API payloads |
Clearing selection
Every data fetch in useTableFetcher:
dispatch(_setSelectedRows([]));
dispatch(_setToggledClearRow(!toggledClearRows));toggledClearRows flip forces clearSelectedRows={!toggledClearRows} on RDT to reset internal selection UI.
Two toolbars
TableBulkActions (dropdown)
Structure bulk actions — always uses selected_ids + appliedFilters in POST unless modal flow opens first.
ActionsOfSelection (below toolbar)
When selectedRows.length > 0:
- Renders intersected row actions from
selectedRowActions - Same
RowActionsElementsas row menu withisBulk={true} - Only actions common to all selected rows with
applicableAsBulkAction
Commented code once rendered separate bulk toolbar buttons; live UI uses row-action components for selection.
Row action intersection algorithm
File: ./ApiTables/table-utils/utils.tsx — getIntersectedRowActions
Takes array of row.actions objects from selected rows; returns action keys present in every row with matching action_key.
Confirmation rules for selection actions
ActionsOfSelection may open modal when action has:
- Extra
payload_keysbeyondfilters/selected_ids, or need_confirmation
Bulk dropdown uses separate rules for create_withdrawal_bulk etc.
UX: selected count
ApiTablesComponent shows count above table when selectedRows.length > 0.