-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[dashboard] Migrate Dashboard internal components to DashboardApi #193220
Conversation
/ci |
/ci |
Pinging @elastic/kibana-presentation (Team:Presentation) |
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 review - I believe isEmbeddedExternally
is component state and not explicit input. This is technically a bug since it cannot currently be set, so after that is fixed + a quick sanity test locally, I can approve :)
const { originatingPath, originatingApp } = useMemo(() => { | ||
const appContext = dashboardApi.getAppContext(); | ||
return { | ||
originatingApp: appContext?.currentAppId, | ||
originatingPath: appContext?.getCurrentPath?.() ?? '', | ||
}; | ||
}, [dashboardApi]); |
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.
Nice 👍
src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx
Outdated
Show resolved
Hide resolved
src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx
Outdated
Show resolved
Hide resolved
…shboard_container.tsx Co-authored-by: Hannah Mudge <[email protected]>
…shboard_container.tsx Co-authored-by: Hannah Mudge <[email protected]>
Thanks for catching this. It is indeed part of component state. I have committed the suggested changes that resolve this. |
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.
LGTM 👍
@elasticmachine merge upstream |
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.
See #193611 👍
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.
Thanks for fixing the controls issue 👍 Tested, and it works great now
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: |
…astic#193220) PR replaces `useDashboardContainer` with `useDashboardApi`. `useDashboardApi` returns `DashboardApi` instead of `DashboardContainer`. After this PR, all react context's in dashboard return `DashboardApi` and thus all components are now prepared for the migration from DashboardContainer to DashboardApi. --------- Co-authored-by: Hannah Mudge <[email protected]> Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit 92da176)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…pi (#193220) (#193739) # Backport This will backport the following commits from `main` to `8.x`: - [[dashboard] Migrate Dashboard internal components to DashboardApi (#193220)](#193220) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T15:21:37Z","message":"[dashboard] Migrate Dashboard internal components to DashboardApi (#193220)\n\nPR replaces `useDashboardContainer` with `useDashboardApi`.\r\n`useDashboardApi` returns `DashboardApi` instead of\r\n`DashboardContainer`.\r\n\r\nAfter this PR, all react context's in dashboard return `DashboardApi`\r\nand thus all components are now prepared for the migration from\r\nDashboardContainer to DashboardApi.\r\n\r\n---------\r\n\r\nCo-authored-by: Hannah Mudge <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"92da1767f3bab00f5b7abca16daec06e2314302b","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","v9.0.0","project:embeddableRebuild","v8.16.0","backport:version"],"title":"[dashboard] Migrate Dashboard internal components to DashboardApi","number":193220,"url":"https://github.com/elastic/kibana/pull/193220","mergeCommit":{"message":"[dashboard] Migrate Dashboard internal components to DashboardApi (#193220)\n\nPR replaces `useDashboardContainer` with `useDashboardApi`.\r\n`useDashboardApi` returns `DashboardApi` instead of\r\n`DashboardContainer`.\r\n\r\nAfter this PR, all react context's in dashboard return `DashboardApi`\r\nand thus all components are now prepared for the migration from\r\nDashboardContainer to DashboardApi.\r\n\r\n---------\r\n\r\nCo-authored-by: Hannah Mudge <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"92da1767f3bab00f5b7abca16daec06e2314302b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193220","number":193220,"mergeCommit":{"message":"[dashboard] Migrate Dashboard internal components to DashboardApi (#193220)\n\nPR replaces `useDashboardContainer` with `useDashboardApi`.\r\n`useDashboardApi` returns `DashboardApi` instead of\r\n`DashboardContainer`.\r\n\r\nAfter this PR, all react context's in dashboard return `DashboardApi`\r\nand thus all components are now prepared for the migration from\r\nDashboardContainer to DashboardApi.\r\n\r\n---------\r\n\r\nCo-authored-by: Hannah Mudge <[email protected]>\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"92da1767f3bab00f5b7abca16daec06e2314302b"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
PR replaces
useDashboardContainer
withuseDashboardApi
.useDashboardApi
returnsDashboardApi
instead ofDashboardContainer
.After this PR, all react context's in dashboard return
DashboardApi
and thus all components are now prepared for the migration from DashboardContainer to DashboardApi.