-
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
[One Discover] Fix document comparison mode and the field statistics tab when using Smart Fields #184172
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
/ci |
/ci |
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
...ages/kbn-unified-field-list/src/containers/unified_field_list_sidebar/field_list_sidebar.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx
Show resolved
Hide resolved
src/plugins/discover/public/application/main/components/layout/discover_documents.tsx
Show resolved
Hide resolved
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
Thanks for reviewing @qn895, I think I've actioned all your feedback 🙏 |
@elasticmachine merge upstream |
packages/kbn-unified-field-list/src/components/fallback_fields/smart_fields_tooltip.tsx
Show resolved
Hide resolved
Tested and field stats change LGTM 🎉 I recommend investigating why the async chunks increase so much (+17.1KB overall and +7.2KB for Discover) to verify if that's normal/expected before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me overall! I left a couple of minor points of feedback, but nothing major. I agree with @qn895 that we should investigate the bundle size increase a bit since at a glance it doesn't feel like it should have increased by as much as it did 🤔
Also for some reason I'm still getting no results when switching to the field statistics tab in Logs Explorer, but I see that it was working for you. Any idea why?
tabs.mp4
...unified-data-table/src/components/compare_documents/hooks/use_comparison_cell_value.test.tsx
Outdated
Show resolved
Hide resolved
.../kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_cell_value.tsx
Outdated
Show resolved
Hide resolved
/** | ||
* An optional prop to provide awareness of additional field groups when paired with the Unified Field List. | ||
*/ | ||
additionalFieldGroups?: AdditionalFieldGroups; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean about the cross cutting concerns. It would be great it we didn't have to pass info like this around so much, but I unfortunately don't have a better suggestion either atm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I couldn't really think of anything without introducing some sort of new package / plugin and that seemed rather heavy. I think by at least having the type source of truth in one place it makes future changes pretty easy.
packages/kbn-unified-field-list/src/components/fallback_fields/smart_fields_tooltip.tsx
Outdated
Show resolved
Hide resolved
packages/kbn-unified-field-list/src/components/fallback_fields/smart_fields_tooltip.tsx
Show resolved
Hide resolved
packages/kbn-unified-field-list/src/components/fallback_fields/smart_fields_tooltip.tsx
Outdated
Show resolved
Hide resolved
.../kbn-unified-data-table/src/components/compare_documents/hooks/use_comparison_cell_value.tsx
Outdated
Show resolved
Hide resolved
@davismcphee I have a theory why and the fix for it. It should be fixed with this PR #180849. I tested this PR with the changes there and verified it works correctly 👍 |
@qn895 @davismcphee Thank you both for looking at this 🙏 I've actioned all of your feedback, and this should be good to go. I'm on PTO next week (and back on the 12th June), I'd love to get this approved and merged on Monday if possible (as I fly on Tuesday). But, if there's any big blockers I can look when I'm back. The only thing I haven't been able to look at in detail is the async chunk size increase, but I'll add a task to #181674 for when I return. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Field stats change LGTM 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Data Discovery changes LGTM 👍 The bundle size increase isn't too significant, so we can definitely follow up on that later to avoid blocking this PR. Thanks for the great work on this, and enjoy your PTO!
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @Kerry350 |
Summary
This addresses the bugs listed in #181674 (#181621 and #178970).
Smart Fields are compound fields, as such there is no "real" backing field for them. In these scenarios where we can't use them directly we fall back to the
fallbackFields
configured for them.@amyjtechwriter please could you check the copy. I think
derived from...
would have sounded better, but it felt at odds with the scenario where you might specifically pick a field that is also a fallback field for a smart field.Reviewer notes
There were quite a lot of cross cutting concerns here between the
unified-field-list
,unified-data-table
, core Discover code,discover-utils
, and thedata_vizualizer
plugin for the field statistics table. Where I'd have liked to potentially put more things in the discover-utils it wasn't possible due to circular project references.I've not added any functional tests for now as we'd be adding them to the Observability Logs Explorer which is going to be deprecated in due course. This ties in with part three of [Discover] Smart Fields #181674.
A
renderFieldName
prop has been added to the field statistics table, this seemed to be the least intrusive way forward rather than a new / comprehensive cell rendering change (similar to the external cell renderers).I've used the original
fallbackFields
configurations but the virtual column components actually render a bit extra. Am I missing anything with regards to potentially extending thefallbackFields
definitions?Screenshots