Skip to content

Commit

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

Fixes #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]>
  • Loading branch information
pra2107tham and jlind23 authored Jul 11, 2024
1 parent 7950fb8 commit 1f7fdfd
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 1f7fdfd

Please sign in to comment.