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

[Infra UI] Fix page content reload when date picker has relative dates #165462

Conversation

crespocarlos
Copy link
Contributor

@crespocarlos crespocarlos commented Sep 1, 2023

closes #165194

Summary

This PR fixes the problem with the Asset Details not reloading its content when date-picker had relative dates.

flyout

flyout.mov

full-page

full_page.mov

I've also changed all the charts to receive absolute date ranges. If they used relative dates, now will be calculated when each chart starts loading, this could change significantly if there is a delay between loading each individual chart.

How to test

  • Start a local Kibana instance
  • Navigate to Infrastructure > Hosts
  • Open the flyout, change the date picker's end-date to now and submit (do that one more time)
  • Open the full page, change the date picker's end-date to now and submit (do that one more time)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -104,7 +102,6 @@ export const LensWrapper = ({
<div
css={css`
position: relative;
border-radius: ${euiTheme.size.s};
Copy link
Contributor Author

@crespocarlos crespocarlos Sep 1, 2023

Choose a reason for hiding this comment

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

There was a space between the triple dots button and the border

now:
image

then:
image

Copy link
Member

Choose a reason for hiding this comment

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

Nice, thanks for the fix!

@crespocarlos crespocarlos added Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:ObsHosts Hosts feature within Observability v8.11.0 labels Sep 1, 2023
@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos crespocarlos changed the title Fix page content reload when date picker has relative dates [Infra UI] Fix page content reload when date picker has relative dates Sep 4, 2023
@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos crespocarlos marked this pull request as ready for review September 4, 2023 13:57
@crespocarlos crespocarlos requested a review from a team as a code owner September 4, 2023 13:57
@elasticmachine
Copy link
Contributor

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

@jennypavlova jennypavlova self-requested a review September 4, 2023 14:47
Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

Good job! 🙌 The data picker reload with relative dates works as expected!
I left some small comments/suggestions

setEmbeddableLoaded(true);
}
}, [embeddableLoaded]);
const handlOnLoad = useCallback(
Copy link
Member

Choose a reason for hiding this comment

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

Should it be?

Suggested change
const handlOnLoad = useCallback(
const handleOnLoad = useCallback(

Comment on lines 9 to 11
import { TimeRange } from '@kbn/es-query';
import { LensAttributes } from '@kbn/lens-embeddable-utils';
import { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { TimeRange } from '@kbn/es-query';
import { LensAttributes } from '@kbn/lens-embeddable-utils';
import { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public';
import type { TimeRange } from '@kbn/es-query';
import type { LensAttributes } from '@kbn/lens-embeddable-utils';
import type { LensEmbeddableInput, TypedLensByValueInput } from '@kbn/lens-plugin/public';

@@ -104,7 +102,6 @@ export const LensWrapper = ({
<div
css={css`
position: relative;
border-radius: ${euiTheme.size.s};
Copy link
Member

Choose a reason for hiding this comment

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

Nice, thanks for the fix!

@jennypavlova jennypavlova self-requested a review September 5, 2023 09:28
Copy link
Member

@jennypavlova jennypavlova left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thanks for the changes!

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@crespocarlos
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 7, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Observability Tests / serverless common API index_patterns index_patterns/service/lib index_patterns/* error handler "before all" hook in "index_patterns/* error handler"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 1442 1443 +1

Async chunks

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

id before after diff
infra 2.0MB 2.0MB +202.0B

History

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

@crespocarlos crespocarlos merged commit a057a88 into elastic:main Sep 7, 2023
@crespocarlos crespocarlos deleted the 165194-fix-relative-date-range-content-reload branch September 7, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra UI] Asset Details date picker using relative dates not always reloading the content
6 participants