Skip to content
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

Merged
merged 2 commits into from
Mar 7, 2022

Conversation

machadoum
Copy link
Member

@machadoum machadoum commented Mar 1, 2022

Issues: #126563 #126333

Summary

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

Checklist

Delete any items that are not applicable to this PR.

@machadoum machadoum force-pushed the siem-explore-issue-126563 branch from 023a3cd to de92229 Compare March 3, 2022 10:32
@machadoum machadoum self-assigned this Mar 3, 2022
@machadoum machadoum added bug Fixes for quality problems that affect the customer experience auto-backport Deprecated - use backport:version if exact versions are needed v8.1.1 v8.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team Team:Threat Hunting:Explore release_note:fix release_note:skip Skip the PR/issue when compiling release notes and removed release_note:fix labels Mar 3, 2022
@machadoum machadoum marked this pull request as ready for review March 3, 2022 10:38
@machadoum machadoum requested review from a team as code owners March 3, 2022 10:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@machadoum machadoum removed the v8.0.0 label Mar 3, 2022
@@ -23,6 +23,131 @@
}
}

{
Copy link
Member Author

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 && (
Copy link
Contributor

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?

Copy link
Contributor

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 :)

Copy link
Member Author

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.

Copy link
Contributor

@jamster10 jamster10 left a 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

@machadoum machadoum force-pushed the siem-explore-issue-126563 branch 2 times, most recently from 793fd7c to 3851e89 Compare March 4, 2022 09:51
@machadoum
Copy link
Member Author

@elasticmachine merge upstream

1 similar comment
@machadoum
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* Fix changing items per page doesn't work
* Fix next page button enabled when the table is empty
@machadoum machadoum force-pushed the siem-explore-issue-126563 branch from a8cb359 to e98197e Compare March 7, 2022 13:11
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 4.7MB 4.7MB +23.0B

History

  • 💚 Build #27923 succeeded a8cb359622388a5eab3c65922e8253952755aa81
  • 💚 Build #27709 succeeded 79946ea7ad3bb8e03d31f9468287b269c68d600e
  • 💔 Build #27617 failed 3851e8900386cc5498cc1cb0bee15dff1821dd64
  • 💔 Build #27397 failed 793fd7ce7d9f3fa0b71369b09eec8e7ea4ca9179
  • 💔 Build #27322 failed de922290aad59abb745aead41ced463ee8315db6
  • 💛 Build #26858 was flaky 023a3cd850bb40fddc09849295b805639f89941c

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @machadoum

@machadoum machadoum merged commit 73f7ac4 into elastic:main Mar 7, 2022
kibanamachine pushed a commit that referenced this pull request Mar 7, 2022
…tab (#126609)

* 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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 7, 2022
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants