Skip to content

Commit

Permalink
[Fleet][Cloud] Enrollment token table may show an empty last page ela…
Browse files Browse the repository at this point in the history
…stic#167663 (elastic#188049)

Fixes elastic#167663

## Summary

Fixes the creation of extra empty page at pagination of 5 rows

### Video

https://github.com/elastic/kibana/assets/140709379/cdac6a22-f239-4b70-b40c-93fc727418a6

Co-authored-by: Julien Lind <[email protected]>
(cherry picked from commit 1f7fdfd)
  • Loading branch information
pra2107tham committed Jul 11, 2024
1 parent 2dc9f66 commit 865fe92
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => {
const agentPolicy = agentPoliciesById[enrollmentKey.policy_id];
return !agentPolicy?.is_managed;
}) || [];
const filteredTotal = rowItems.length;

const columns = [
{
Expand Down Expand Up @@ -294,7 +295,7 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => {
pagination={{
pageIndex: pagination.currentPage - 1,
pageSize: pagination.pageSize,
totalItemCount: total,
totalItemCount: filteredTotal,
pageSizeOptions,
}}
onChange={({ page }: { page: { index: number; size: number } }) => {
Expand Down

0 comments on commit 865fe92

Please sign in to comment.