Compare commits

..

2 Commits

Author SHA1 Message Date
6ea5f2848a Add filter and sort persistence to Users component
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- Introduced new props to the Users component to enable saving and using filters and sorting in both session and URL.
- This enhancement improves user experience by maintaining filter and sort states across sessions, aligning with recent updates across other dashboard components.
2026-08-01 14:45:49 +01:00
1efebeeda6 Refactor ObjectTable component for improved readability and styling consistency
- Simplified the loadPage function call by consolidating parameters into a single line, enhancing code clarity.
- Updated the Splitter component's className to include 'large', ensuring consistent styling across the dashboard components.
2026-08-01 14:44:56 +01:00
2 changed files with 11 additions and 6 deletions

View File

@ -67,6 +67,15 @@ const Users = () => {
visibleColumns={columnVisibility}
cards={viewMode === 'cards'}
showFilterSidebar={showFilterSidebar}
expandHeight={true}
saveFilterInSession={true}
saveFilterInUrl={true}
useFilterInSession={true}
useFilterInUrl={true}
saveSortInSession={true}
saveSortInUrl={true}
useSortInSession={true}
useSortInUrl={true}
/>
</Flex>
)

View File

@ -823,11 +823,7 @@ const ObjectTable = forwardRef(
setTableSorter(sorter)
}
loadPage(
initialPage,
activeFilter,
sorter.field ? sorter : null
)
loadPage(initialPage, activeFilter, sorter.field ? sorter : null)
}, [getPersistedFilter, getPersistedSorter, initialPage, loadPage])
useImperativeHandle(ref, () => ({
@ -1281,7 +1277,7 @@ const ObjectTable = forwardRef(
style={{ flex: 1, minWidth: 0, minHeight: 0 }}
>
<Splitter
className={'farmcontrol-splitter'}
className={'farmcontrol-splitter large'}
onResize={measureCardColSpan}
onResizeEnd={measureCardColSpan}
>