File tree 2 files changed +8
-0
lines changed
users/components/UserTable
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ export default function MemberList(props: Props) {
177
177
178
178
// TODO (SEAN): Make Column filters a trpc query param so we can fetch serverside even if the data is not loaded
179
179
const [ columnFilters , setColumnFilters ] = useState < ColumnFiltersState > ( [ ] ) ;
180
+ const [ rowSelection , setRowSelection ] = useState ( { } ) ;
180
181
181
182
const removeMemberFromCache = ( {
182
183
utils,
@@ -602,12 +603,15 @@ export default function MemberList(props: Props) {
602
603
} ,
603
604
state : {
604
605
columnFilters,
606
+ rowSelection,
605
607
} ,
606
608
onColumnFiltersChange : setColumnFilters ,
609
+ onRowSelectionChange : setRowSelection ,
607
610
getCoreRowModel : getCoreRowModel ( ) ,
608
611
getFilteredRowModel : getFilteredRowModel ( ) ,
609
612
getSortedRowModel : getSortedRowModel ( ) ,
610
613
getFacetedUniqueValues : getFacetedUniqueValues ( ) ,
614
+ getRowId : ( row ) => `${ row . id } ` ,
611
615
} ) ;
612
616
613
617
const fetchMoreOnBottomReached = useFetchMoreOnBottomReached (
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export function UserListTable() {
120
120
const [ state , dispatch ] = useReducer ( reducer , initialState ) ;
121
121
const [ debouncedSearchTerm , setDebouncedSearchTerm ] = useState ( "" ) ;
122
122
const [ isDownloading , setIsDownloading ] = useState ( false ) ;
123
+ const [ rowSelection , setRowSelection ] = useState ( { } ) ;
123
124
124
125
const [ columnFilters , setColumnFilters ] = useState < ColumnFiltersState > ( [ ] ) ;
125
126
@@ -385,12 +386,15 @@ export function UserListTable() {
385
386
} ,
386
387
state : {
387
388
columnFilters,
389
+ rowSelection,
388
390
} ,
389
391
onColumnFiltersChange : setColumnFilters ,
390
392
getCoreRowModel : getCoreRowModel ( ) ,
391
393
// TODO(SEAN): We need to move filter state to the server so we can fetch more data when the filters change if theyre not in client cache
392
394
getFilteredRowModel : getFilteredRowModel ( ) ,
393
395
getSortedRowModel : getSortedRowModel ( ) ,
396
+ onRowSelectionChange : setRowSelection ,
397
+ getRowId : ( row ) => `${ row . id } ` ,
394
398
getFacetedUniqueValues : ( _ , columnId ) => ( ) => {
395
399
if ( facetedTeamValues ) {
396
400
switch ( columnId ) {
You can’t perform that action at this time.
0 commit comments