@@ -15,6 +15,7 @@ import {
1515 useReactTable ,
1616 getCoreRowModel ,
1717 createColumnHelper ,
18+ ColumnFiltersState ,
1819 getFilteredRowModel ,
1920 getPaginationRowModel ,
2021 CellContext ,
@@ -26,7 +27,7 @@ import { useFileContext } from '../context/UsersFiles';
2627import { getSourceNodes } from '../services/GetFiles' ;
2728import { v4 as uuidv4 } from 'uuid' ;
2829import { statusCheck , capitalize } from '../utils/Utils' ;
29- import { SourceNode , CustomFile , FileTableProps , UserCredentials , statusupdate , alertStateType , ColumnFiltersState } from '../types' ;
30+ import { SourceNode , CustomFile , FileTableProps , UserCredentials , statusupdate , alertStateType } from '../types' ;
3031import { useCredentials } from '../context/UserCredentials' ;
3132import { MagnifyingGlassCircleIconSolid } from '@neo4j-ndl/react/icons' ;
3233import CustomAlert from './UI/Alert' ;
@@ -361,14 +362,14 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
361362 item ?. fileSource === 's3 bucket' && localStorage . getItem ( 'accesskey' ) === item ?. awsAccessKeyId
362363 ? item ?. status
363364 : item ?. fileSource === 'local file'
364- ? item ?. status
365- : item ?. status === 'Completed' || item . status === 'Failed'
366- ? item ?. status
367- : item ?. fileSource == 'Wikipedia' ||
368- item ?. fileSource == 'youtube' ||
369- item ?. fileSource == 'gcs bucket'
370- ? item ?. status
371- : 'N/A' ,
365+ ? item ?. status
366+ : item ?. status === 'Completed' || item . status === 'Failed'
367+ ? item ?. status
368+ : item ?. fileSource == 'Wikipedia' ||
369+ item ?. fileSource == 'youtube' ||
370+ item ?. fileSource == 'gcs bucket'
371+ ? item ?. status
372+ : 'N/A' ,
372373 model : item ?. model ?? model ,
373374 id : uuidv4 ( ) ,
374375 source_url : item ?. url != 'None' && item ?. url != '' ? item . url : '' ,
@@ -381,8 +382,8 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
381382 language : item ?. language ?? '' ,
382383 processingProgress :
383384 item ?. processed_chunk != undefined &&
384- item ?. total_chunks != undefined &&
385- ! isNaN ( Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 ) )
385+ item ?. total_chunks != undefined &&
386+ ! isNaN ( Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 ) )
386387 ? Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 )
387388 : undefined ,
388389 // total_pages: item?.total_pages ?? 0,
@@ -577,6 +578,11 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
577578 getFilteredRowModel : getFilteredRowModel ( ) ,
578579 getPaginationRowModel : getPaginationRowModel ( ) ,
579580 onColumnFiltersChange : setColumnFilters ,
581+ // initialState: {
582+ // pagination: {
583+ // pageSize: pageSizeCalculation < 0 ? 9 : pageSizeCalculation,
584+ // },
585+ // },
580586 state : {
581587 columnFilters,
582588 rowSelection,
@@ -622,8 +628,7 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
622628
623629 const handleChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
624630 table . getColumn ( 'status' ) ?. setFilterValue ( e . target . checked ) ;
625- // if (!table.getCanNextPage() || table.getRowCount()) {
626- if ( ! table . getCanNextPage ( ) ) {
631+ if ( ! table . getCanNextPage ( ) || table . getRowCount ( ) ) {
627632 table . setPageIndex ( 0 ) ;
628633 }
629634 } ;
0 commit comments