@@ -15,7 +15,6 @@ import {
1515 useReactTable ,
1616 getCoreRowModel ,
1717 createColumnHelper ,
18- ColumnFiltersState ,
1918 getFilteredRowModel ,
2019 getPaginationRowModel ,
2120 CellContext ,
@@ -27,7 +26,7 @@ import { useFileContext } from '../context/UsersFiles';
2726import { getSourceNodes } from '../services/GetFiles' ;
2827import { v4 as uuidv4 } from 'uuid' ;
2928import { statusCheck , capitalize } from '../utils/Utils' ;
30- import { SourceNode , CustomFile , FileTableProps , UserCredentials , statusupdate , alertStateType } from '../types' ;
29+ import { SourceNode , CustomFile , FileTableProps , UserCredentials , statusupdate , alertStateType , ColumnFiltersState } from '../types' ;
3130import { useCredentials } from '../context/UserCredentials' ;
3231import { MagnifyingGlassCircleIconSolid } from '@neo4j-ndl/react/icons' ;
3332import CustomAlert from './UI/Alert' ;
@@ -362,14 +361,14 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
362361 item ?. fileSource === 's3 bucket' && localStorage . getItem ( 'accesskey' ) === item ?. awsAccessKeyId
363362 ? item ?. status
364363 : item ?. fileSource === 'local file'
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' ,
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' ,
373372 model : item ?. model ?? model ,
374373 id : uuidv4 ( ) ,
375374 source_url : item ?. url != 'None' && item ?. url != '' ? item . url : '' ,
@@ -382,8 +381,8 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
382381 language : item ?. language ?? '' ,
383382 processingProgress :
384383 item ?. processed_chunk != undefined &&
385- item ?. total_chunks != undefined &&
386- ! isNaN ( Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 ) )
384+ item ?. total_chunks != undefined &&
385+ ! isNaN ( Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 ) )
387386 ? Math . floor ( ( item ?. processed_chunk / item ?. total_chunks ) * 100 )
388387 : undefined ,
389388 // total_pages: item?.total_pages ?? 0,
@@ -578,11 +577,6 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
578577 getFilteredRowModel : getFilteredRowModel ( ) ,
579578 getPaginationRowModel : getPaginationRowModel ( ) ,
580579 onColumnFiltersChange : setColumnFilters ,
581- // initialState: {
582- // pagination: {
583- // pageSize: pageSizeCalculation < 0 ? 9 : pageSizeCalculation,
584- // },
585- // },
586580 state : {
587581 columnFilters,
588582 rowSelection,
@@ -628,7 +622,8 @@ const FileTable: React.FC<FileTableProps> = ({ isExpanded, connectionStatus, set
628622
629623 const handleChange = ( e : React . ChangeEvent < HTMLInputElement > ) => {
630624 table . getColumn ( 'status' ) ?. setFilterValue ( e . target . checked ) ;
631- if ( ! table . getCanNextPage ( ) || table . getRowCount ( ) ) {
625+ // if (!table.getCanNextPage() || table.getRowCount()) {
626+ if ( ! table . getCanNextPage ( ) ) {
632627 table . setPageIndex ( 0 ) ;
633628 }
634629 } ;
0 commit comments