-
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
[OneDiscover][UnifiedDocViewer] Allow filtering by field type #189981
[OneDiscover][UnifiedDocViewer] Allow filtering by field type #189981
Conversation
/ci |
/ci |
/ci |
/ci |
/ci |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
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.
Code changes look good and it works great! Nice improvement 👍
@@ -261,7 +239,7 @@ export const DocViewerTable = ({ | |||
] | |||
); | |||
|
|||
const { pinnedItems, restItems } = Object.keys(flattened) | |||
const { pinnedItems, restItems, allFields } = Object.keys(flattened) |
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.
Nit: unrelated to this PR, but I wonder if we should start memoizing this? It feels like it's expensive to run on each render, especially since this component gets rendered each frame when resizing.
import { | ||
FieldTypeFilter, | ||
type FieldTypeFilterProps, | ||
} from '@kbn/unified-field-list/src/components/field_list_filters/field_type_filter'; |
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.
Can we export this directly from Unified Field List?
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.
We could but that would increase the bundle size and not only in DocViewer but in all consumers of UnifiedFieldList. I would rather keep the current import.
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.
Interesting 🤔 I would have thought tree shaking on the package would take care of that. I'm not a fan of reaching into internal package folders for imports, but I don't want to hold up this PR over it, so I think it's ok to merge as is.
This reverts commit 06e6415.
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @jughosta |
Summary
This PR adds Field type filter to Doc Viewer (same as in UnifiedFieldList as discussed with @MichaelMarcialis).
The selected field types would be persisted in Local Storage under
unifiedDocViewer:selectedFieldTypes
key.Checklist