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

[Infrastructure UI] Metric charts to show data based on the Hosts table current page items #152186

Closed
crespocarlos opened this issue Feb 27, 2023 · 4 comments · Fixed by #155249
Closed
Assignees
Labels
beta Required for a feature to move to beta Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.8.0

Comments

@crespocarlos
Copy link
Contributor

crespocarlos commented Feb 27, 2023

📓 Summary

We need the Metric charts to show only the data based on the current table page items, which can change depending on the sorting and pagination actions. It should also respect the number of items per page (5,10,20).

💡 Implementation Hints

We could intercept the onTableChange event from the EuiMemoryTable and with page.size, page.index, sort.field , and sort.direction we could manipulate the list of hosts used by the metric charts.

✔️ Acceptance criteria

  • "Rows per page" should allow users to choose to see 5, 10, and 20 items. 20 is the default value
  • The selection should be stored in localStorage
  • Metric charts should show data for the hosts on the table's current page. KPI, Alerts widget and Logs will render all returned hosts.
@botelastic botelastic bot added the needs-team Issues missing a team label label Feb 27, 2023
@crespocarlos crespocarlos added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services Feature:ObsHosts Hosts feature within Observability labels Feb 27, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Feb 27, 2023
@crespocarlos crespocarlos changed the title [Infrastructure UI] Charts, Alerts, and other Hosts View components to show items from the table's current page [Infrastructure UI] Components to show data based on the Hosts table current page items Feb 27, 2023
@tonyghiani
Copy link
Contributor

Regarding the suggested changes, we'll keep the same current behaviour for these components, showing the data related to the whole selection of hosts and not only focusing on the visible hosts on the current table page.

@roshan-elastic roshan-elastic added the beta Required for a feature to move to beta label Mar 13, 2023
@miltonhultgren
Copy link
Contributor

@crespocarlos @tonyghiani Can you update the description with what work needs to be done in this ticket?
Is it only adding the page size selector?

@crespocarlos
Copy link
Contributor Author

@miltonhultgren done. We basically need the Lens metric charts to show the current page hosts, respecting the maximum number of items per page. Let me know if it's clear.

@crespocarlos crespocarlos self-assigned this Apr 17, 2023
@crespocarlos crespocarlos changed the title [Infrastructure UI] Components to show data based on the Hosts table current page items [Infrastructure UI] Metric charts to show data based on the Hosts table current page items Apr 18, 2023
crespocarlos added a commit that referenced this issue Apr 24, 2023
…ms (#155249)

closes [#152186](#152186)

## Summary

This PR makes the metric charts show data for the hosts on the current
page. With this change, the charts will **only** load after the table
has finished loading its data - or after Snapshot API has responded

It also changes the current behavior of the table pagination and
sorting. Instead of relying on the `EuiInMemoryTable` the pagination and
sorting are done manually, and the EuiInMemoryTable has been replaced by
the `EuiBasicTable`.

The loading indicator has also been replaced.

Paginating and sorting:


https://user-images.githubusercontent.com/2767137/233161166-2bd719e1-7259-4ecc-96a7-50493bc6c0a3.mov

Open in lens 


https://user-images.githubusercontent.com/2767137/233161134-621afd76-44b5-42ab-b58c-7f51ef944ac2.mov


### How to test
- Go to Hosts view
- Paginate and sort the table data
- Select a page size and check if the select has been stored in the
localStorage (`hostsView:pageSizeSelection` key)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nikitaindik pushed a commit to nikitaindik/kibana that referenced this issue Apr 25, 2023
…ms (elastic#155249)

closes [elastic#152186](elastic#152186)

## Summary

This PR makes the metric charts show data for the hosts on the current
page. With this change, the charts will **only** load after the table
has finished loading its data - or after Snapshot API has responded

It also changes the current behavior of the table pagination and
sorting. Instead of relying on the `EuiInMemoryTable` the pagination and
sorting are done manually, and the EuiInMemoryTable has been replaced by
the `EuiBasicTable`.

The loading indicator has also been replaced.

Paginating and sorting:


https://user-images.githubusercontent.com/2767137/233161166-2bd719e1-7259-4ecc-96a7-50493bc6c0a3.mov

Open in lens 


https://user-images.githubusercontent.com/2767137/233161134-621afd76-44b5-42ab-b58c-7f51ef944ac2.mov


### How to test
- Go to Hosts view
- Paginate and sort the table data
- Select a page size and check if the select has been stored in the
localStorage (`hostsView:pageSizeSelection` key)

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Required for a feature to move to beta Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.8.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants