-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Pagination is not working correctly for host by risk under hosts tab #126609
Conversation
023a3cd
to
de92229
Compare
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
@@ -23,6 +23,131 @@ | |||
} | |||
} | |||
|
|||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add more items for testing the pagination.
activePage={myActivePage} | ||
onPageClick={goToPage} | ||
/> | ||
{totalCount > 0 && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we check pageCount > 1
here? I mean, is there any point in showing the pagination if there is only one page? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I said nothing, I checked this is the common behavior everywhere :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, hehehe. Just for context:
This bug was happening in most tables. When pageCount
is zero EuiPagination
shows the next page button 🤷
It is explained on the documentation:
https://elastic.github.io/eui/#/navigation/pagination
If the total number of pages cannot be accurately determined, you can pass 0 as the pageCount. This will remove the button numbers and rely solely on the arrow icon buttons for navigation. Without a total page count, the last page button will pass back -1 for the activePage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just Sergi's change about pagenumber > 1 before merge
793fd7c
to
3851e89
Compare
@elasticmachine merge upstream |
1 similar comment
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
x-pack/plugins/security_solution/cypress/integration/hosts/host_risk_tab.spec.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/cypress/integration/hosts/host_risk_tab.spec.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/cypress/integration/hosts/host_risk_tab.spec.ts
Outdated
Show resolved
Hide resolved
* Fix changing items per page doesn't work * Fix next page button enabled when the table is empty
a8cb359
to
e98197e
Compare
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @machadoum |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…tab (#126609) (#127044) * Fix Pagination is not working correctly for host by risk under hosts tab * Fix changing items per page doesn't work * Fix next page button enabled when the table is empty (cherry picked from commit 73f7ac4) Co-authored-by: Pablo Machado <[email protected]>
Issues: #126563 #126333
Summary
Fix Pagination is not working correctly for host by risk under hosts tab
Checklist
Delete any items that are not applicable to this PR.