Merge pull request #8240 from lorsatti/fix/jenkins-pagination

Fix Jenkins table pagination
This commit is contained in:
Fredrik Adelöw
2021-11-25 07:10:24 +01:00
committed by GitHub
2 changed files with 10 additions and 1 deletions
@@ -205,6 +205,10 @@ export const CITableView = ({
onChangePageSize,
total,
}: Props) => {
const projectsInPage = projects?.slice(
page * pageSize,
Math.min(projects.length, (page + 1) * pageSize),
);
return (
<Table
isLoading={loading}
@@ -219,7 +223,7 @@ export const CITableView = ({
onClick: () => retry(),
},
]}
data={projects ?? []}
data={projectsInPage ?? []}
onPageChange={onChangePage}
onRowsPerPageChange={onChangePageSize}
title={