diff --git a/src/files/domain/models/FilePaginationInfo.ts b/src/files/domain/models/FilePaginationInfo.ts index 1d6b2a3d6..5f0e1ddcc 100644 --- a/src/files/domain/models/FilePaginationInfo.ts +++ b/src/files/domain/models/FilePaginationInfo.ts @@ -2,14 +2,14 @@ export class FilePaginationInfo { constructor( public readonly page: number = 1, public readonly pageSize: number = 10, - public readonly total: number = 0 + public readonly totalFiles: number = 0 ) {} withTotal(total: number): FilePaginationInfo { return new FilePaginationInfo(this.page, this.pageSize, total) } goToPage(page: number): FilePaginationInfo { - return new FilePaginationInfo(page, this.pageSize, this.total) + return new FilePaginationInfo(page, this.pageSize, this.totalFiles) } goToPreviousPage(): FilePaginationInfo { @@ -27,11 +27,11 @@ export class FilePaginationInfo { const newPage = Math.ceil((this.page * oldPageSize) / newPageSize) return newPage > 0 ? newPage : 1 } - return new FilePaginationInfo(getNewPage(this.pageSize, pageSize), pageSize, this.total) + return new FilePaginationInfo(getNewPage(this.pageSize, pageSize), pageSize, this.totalFiles) } get totalPages(): number { - return Math.ceil(this.total / this.pageSize) + return Math.ceil(this.totalFiles / this.pageSize) } get hasPreviousPage(): boolean { diff --git a/src/sections/dataset/dataset-files/files-table/FilesTable.tsx b/src/sections/dataset/dataset-files/files-table/FilesTable.tsx index f34bd92ce..129792f8f 100644 --- a/src/sections/dataset/dataset-files/files-table/FilesTable.tsx +++ b/src/sections/dataset/dataset-files/files-table/FilesTable.tsx @@ -28,7 +28,7 @@ export function FilesTable({ files, isLoading, paginationInfo }: FilesTableProps { setCurrentPageRowSelection(createRowSelection(paginationInfo.pageSize)) - setRowSelection(createRowSelection(paginationInfo.total)) + setRowSelection(createRowSelection(paginationInfo.totalFiles)) } const clearRowSelection = () => { setCurrentPageRowSelection({}) @@ -71,7 +71,7 @@ export function useRowSelection( } } const isAllRowsSelected = () => { - return Object.keys(rowSelection).length === paginationInfo.total + return Object.keys(rowSelection).length === paginationInfo.totalFiles } useEffect(() => {