-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Graph] Paginate through index patterns #120972
Conversation
@elasticmachine merge upstream |
Pinging @elastic/kibana-graph (Feature:Graph) |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
@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, looks stylish.
.then((response) => { | ||
perPage = response.perPage; | ||
total = response.total; | ||
page = response.page; |
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.
so this function is starting let with page = 1
, which is requesting the first page, then you assign the value page = response.page;
which is I think also the first page, since it was requested. It seems to me that in the case when there is a bigger total number than 1000, it would trigger makeRequest
forever, since page is not incremented?
Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
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.
Tested a-la-carte
in Chrome, by setting perPage to 1, works as expected 👍
perPage = response.perPage; | ||
total = response.total; |
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.
Nit: shouldn't be necessary to set perPage
since it shouldn't change, which means it could be a const
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* [Graph] Paginate through index patterns * Extract logic into a generator function * Fix failing unit test * Fix page initialization * Update x-pack/plugins/graph/public/helpers/use_workspace_loader.ts Co-authored-by: Matthias Wilhelm <ankertal@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
* [Graph] Paginate through index patterns * Extract logic into a generator function * Fix failing unit test * Fix page initialization * Update x-pack/plugins/graph/public/helpers/use_workspace_loader.ts Co-authored-by: Matthias Wilhelm <ankertal@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Matthias Wilhelm <ankertal@gmail.com>
Summary
Addresses: #93770
While in the original issue refers to pagination on the server side, we were tagged in that issue, although Graph was making a large request for index patterns on the client side. Since saved object client already supports pagination, this PR breaks one big request into paginated smaller requests.
Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)- [ ] This was checked for cross-browser compatibilityRisk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers