-
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
[Infrastructure UI] Use same no data messaging on hosts view #142063
[Infrastructure UI] Use same no data messaging on hosts view #142063
Conversation
@elasticmachine merge upstream |
…ssaging-on-hosts-view
…ssaging-on-hosts-view
Testing this with metricbeat this didn't work. No actual request is sent when clicking "Check for new data" because the LensComponent is no longer mounted the first time there no data so the Lens callback To test with metricbeat try https://www.elastic.co/guide/en/beats/metricbeat/master/metricbeat-installation-configuration.html or happy to pair on that. |
…hosts-view' of https://github.com/jennypavlova/kibana into 141273-infrastructure-ui-use-same-no-data-messaging-on-hosts-view
…ssaging-on-hosts-view
@neptunian Thank you for checking that! I saw the issue you mentioned. You are right that we should render the lens table in order to set the state so what I tried is to keep the component and visually hide it when there is no data. Probably it is not the best approach here, I just tried to make sure that the request is sent after click. |
Nice! This works. Instead of rendering the components and hiding them, though, I think it'd be better if we did not render them at all because there is going to be a lot of components on this page. Using local state or a custom hook, we could track the loading state of the table instead and render something like this:
The loading would be set to false in the LensComponent and true when the query is initiated such as in |
Good point, thanks! I added the change and now it works for me. Please let me know if it works for you. Another thing I noticed is that on the infrastructure page when I change the search term/filter the result changes from no data to existing result and here I need to click on refresh (I think it was like that before those changes, not 100% sure) So that's still a difference between the buttons now that the refresh button will also apply the filters and if there is no filter change it will refresh. The no data page button won't apply the filters it will behave more like the light blue refresh (which I think is correct in this case) |
@elasticmachine merge upstream |
…ssaging-on-hosts-view
This works! 🚀 That seems like correct behaviour to me if I understand you correctly. The teal button state is unapplied changes so the "check for new data" would not apply the time range selected if you haven't applied them yet by clicking "refresh". I think that's fine. |
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
…ssaging-on-hosts-view
…ssaging-on-hosts-view
…ssaging-on-hosts-view
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…#142063) * [WIP] Implement No Data message * Implement refetch * Render lens component and hide when there is no data * Add onLoading hook and conditional rendering Co-authored-by: Kibana Machine <[email protected]>
…#142063) * [WIP] Implement No Data message * Implement refetch * Render lens component and hide when there is no data * Add onLoading hook and conditional rendering Co-authored-by: Kibana Machine <[email protected]>
Closes #141273
Summary
This PR adds a No Data message similar to the Infrastructure page
Testing locally
onRefetch
works