mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix(useFilters): pageSize was a hardcoded constant, never read from the URL, with no setter — the DataTable/RuleEngineListFooter page-size dropdown silently did nothing on every page using the filter bar, including the already-shipped ContractRequestsPage pilot. Added a `size` URL param (mirrors `page`), `setPageSize`, and wired `tableProps().onPaginationChange` to route page-size vs page-index changes to the right setter instead of only ever calling setPage(). feat(clientFilter): applyClientFilters — the Family-B bridge the plan called for. Generalizes ListControls'/useListControls' one hardcoded search box + one date range to every FilterDef, matched against `row[def.key]`. Reuses matchesDayRange/toDayString from hooks/useListControls.ts (imported, not duplicated) so the inclusive- range/timezone-safe semantics stay defined in exactly one place. Lets a page ship the full pill-bar UI immediately and flip to server-side filtering later by deleting one function call — no endpoint changes required up front. Migrated to the filter bar (mechanical, pattern established by ContractRequestsPage): - WarehouseInvoicesPage, LoadedInventoryPage, TrucksOnSitePage — Family B (ListControls/useListControls → FilterBar + applyClientFilters) - CustomersPage — Family A (useState bag → useFilters), no filter pills needed here (search + sort only), the SegmentedControl "view" stays page-level tab state (like ContractStatusTabs), not a filter pill — it now resets the page via controls.setPage(1) on change, the same hazard useFilters already guards its own filters against