-
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
[UnifiedDocViewer] Remove usage of KibanaContextProvider #167202
[UnifiedDocViewer] Remove usage of KibanaContextProvider #167202
Conversation
…lson/kibana into unified-doc-viewer/remove-context
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 LGTM, and quickly tested in Discover and the doc viewer is working as expected 👍
src/plugins/unified_doc_viewer/public/hooks/use_doc_viewer_services.ts
Outdated
Show resolved
Hide resolved
Pinging @elastic/uptime (Team:uptime) |
@elasticmachine merge upstream |
const { data: hit } = useFetcher<Promise<DataTableRecord | undefined>>(async () => { | ||
if (!dataView?.id || !isFlyoutVisible) return; | ||
const response = await data.search | ||
.search({ | ||
params: { | ||
index: SYNTHETICS_INDEX_PATTERN, | ||
body: { | ||
query: { | ||
ids: { | ||
values: [ping.docId], | ||
}, | ||
}, | ||
fields: ['*'], | ||
_source: false, | ||
}, | ||
}, | ||
}) | ||
.toPromise(); | ||
const docs = response?.rawResponse?.hits?.hits ?? []; | ||
if (docs.length > 0) { | ||
return buildDataTableRecord(docs[0], dataView); | ||
} | ||
}, [data, dataView, ping.docId, isFlyoutVisible]); | ||
const [, hit] = useEsDocSearch({ id: ping.docId, index: SYNTHETICS_INDEX_PATTERN, dataView }); |
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.
💯
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.
Synthetics Changes LGTM !!
…lson/kibana into unified-doc-viewer/remove-context
…lson/kibana into unified-doc-viewer/remove-context
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @lukasolson |
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.
Looks good but I don't see why the review we need to review it as I couldn't find any code we own, approving to unblock.
Summary
Removes usages of
KibanaContextProvider
to simplify the API of theUnifiedDocViewer
component. Instead, necessary services are accessed from the plugin itself (viagetUnifiedDocViewerServices
). Removes theuseUnifiedDocViewerServices
hook since it's no longer needed.Resolves #168380
Checklist