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] Decouple Field Statistics tab from Discover fields sidebar by refactoring how availableFields are used #140367

Closed
Tracked by #135678
jughosta opened this issue Sep 9, 2022 · 1 comment · Fixed by #187265
Labels
8.8 candidate Feature:Discover Discover Application impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort refactoring Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.

Comments

@jughosta
Copy link
Contributor

jughosta commented Sep 9, 2022

Original comment #135678 (comment):

I think one of the next steps could be, create a hook in Discover that could fetch the existing fields, and use it in field statistics table, remove the logic of the observable that we populate in the sidebar to use in the Field Statistic tab. feels this would be a good start for the field statistics work later on (that we should discuss separately)

Update:
Currently we use a BehaviorSubject availableFields$ that's initialized in use_saved_search.ts, updated in discover_sidebar_responsive, and subscribed to changes in field_stats_table.tsx.

Initialization:

const availableFields$: AvailableFields$ = useBehaviorSubject(initialState) as AvailableFields$;

Updated with the actual list:

Consumed in FieldStatisticsTable:

This should be refactored to use useExistingFieldsFetcher in FieldStatisticsTable got get the available fields like it is done in #144412. The code in use_saved_search.ts can be removed discover_sidebar_responsive

https://github.com/elastic/kibana/blob/3e8d652dfbf46bfe647e5bfab56e23ac4ffe0ee4/src/plugins/discover/public/application/main/components/sidebar/discover_sidebar_responsive.tsx#LL188C56-L188C80

@jughosta jughosta added loe:medium Medium Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. labels Sep 9, 2022
@elasticmachine
Copy link
Contributor

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

@kertal kertal added Feature:Discover Discover Application refactoring labels Sep 9, 2022
@davismcphee davismcphee added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.8 candidate Feature:Discover Discover Application impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:medium Medium Level of Effort refactoring Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants