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

[Discover] Fix time zone for field popover histogram and remove getTimeZone duplicates #172705

Merged
merged 20 commits into from
Dec 9, 2023

Conversation

jughosta
Copy link
Contributor

@jughosta jughosta commented Dec 6, 2023

Summary

This PR creates a new package @kbn/visualization-utils and moves getTimeZone helper into it. Also the PR removes duplicates of other similar helpers.

And the histogram in the field popover has now the same time zone configuration as the the main hits histogram:

Screenshot 2023-12-06 at 18 46 25

For testing

Change dateFormat:tz in Advanced Settings and check if histograms are rendered accordingly.

@jughosta jughosta self-assigned this Dec 6, 2023
@jughosta jughosta added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Dec 6, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reused this implementation

@jughosta jughosta changed the title [Discover] Remove getTimeZone duplicates and fix fieldStats in Discover [Discover] Remove getTimeZone duplicates and time zone for field popover histogram Dec 6, 2023
@jughosta jughosta changed the title [Discover] Remove getTimeZone duplicates and time zone for field popover histogram [Discover] Remove getTimeZone duplicates and fix time zone for field popover histogram Dec 6, 2023
@jughosta jughosta changed the title [Discover] Remove getTimeZone duplicates and fix time zone for field popover histogram [Discover] Fix time zone for field popover histogram and remove getTimeZone duplicates Dec 6, 2023
@jughosta jughosta marked this pull request as ready for review December 7, 2023 10:57
@jughosta jughosta requested review from a team as code owners December 7, 2023 10:57
@jughosta jughosta requested a review from a team as a code owner December 7, 2023 10:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Thanx Julia for creating this package for us, it will be very helpful in the future. LGTM!

@qn895
Copy link
Member

qn895 commented Dec 7, 2023

LGTM 🎉

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Nice cleanup! 🧹 🧼

Copy link
Contributor

@davismcphee davismcphee left a comment

Choose a reason for hiding this comment

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

Nice cleanup! And fixes the issue too 👍 LGTM, thanks!

});

afterAll(() => {
moment.tz.setDefault(originalTimezone ? originalTimezone.name : '');
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It doesn't look like originalTimezone is ever set.

});

it('returns timezone defined on uiSettings', () => {
const timezone = 'America/Toronto';
Copy link
Contributor

Choose a reason for hiding this comment

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

🇨🇦

@jughosta jughosta enabled auto-merge (squash) December 9, 2023 09:21
@jughosta
Copy link
Contributor Author

jughosta commented Dec 9, 2023

@elasticmachine merge upstream

@jughosta jughosta merged commit 8362b85 into elastic:main Dec 9, 2023
36 checks passed
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 422 424 +2
apm 1539 1541 +2
dataVisualizer 573 575 +2
discover 717 719 +2
eventAnnotationListing 460 462 +2
expressionHeatmap 149 150 +1
lens 1148 1150 +2
logExplorer 644 646 +2
ml 1868 1870 +2
visTypeTimelion 46 47 +1
visTypeTimeseries 378 379 +1
total +19

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/visualization-utils - 1 +1

Async chunks

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

id before after diff
aiops 390.1KB 390.2KB +133.0B
apm 3.7MB 3.7MB +136.0B
dataVisualizer 618.6KB 618.6KB +18.0B
discover 593.6KB 593.8KB +147.0B
lens 1.4MB 1.4MB +148.0B
ml 3.6MB 3.6MB +138.0B
visTypeTimelion 38.8KB 38.8KB +13.0B
total +733.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
visTypeTimeseries 18.5KB 18.5KB -68.0B
Unknown metric groups

API count

id before after diff
@kbn/visualization-utils - 2 +2

History

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

cc @jughosta

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 release_note:fix Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UnifiedFieldsList] Opening fields stats on a date field shows elastic charts warning about locale
8 participants