Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [visualize embeddable] fix panel disappears from dashboard when…
… canceling edit after dashboard save (#193914) (#194152) # Backport This will backport the following commits from `main` to `8.x`: - [[visualize embeddable] fix panel disappears from dashboard when canceling edit after dashboard save (#193914)](#193914) <!--- 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-26T13:47:04Z","message":"[visualize embeddable] fix panel disappears from dashboard when canceling edit after dashboard save (#193914)\n\nPart of #193905. Broke work into\r\nseparate PRs to backport map embeddable changes to 8.15.\r\n\r\nResolves issue for Visualize embeddable and dashboard empty screen. The\r\nproblem is that Visualize embeddable is using a stale result from\r\n`parentApi.getAppContext`. Dashboard's `getAppContext` changes the\r\n`getCurrentPath` when the dashboard has a saved object id. By using the\r\nstale results, `getCurrentPath` returned `#/create` instead of\r\n`#/view/`. The fix is to get a current version of `getAppContext` when\r\nrequired.\r\n\r\n### Test steps\r\n1. create new dashboard\r\n2. Click \"Add panel\" (problem also exists when using \"Add from library\")\r\n3. Select \"Aggregation based\"\r\n4. In editor, click \"Save and return\"\r\n5. Save dashboard\r\n6. Click \"Edit\" in panel context menu\r\n7. In editor, click \"Cancel\"\r\n8. Ensure visualize panel is still displayed in dashboard","sha":"d6c8840a561484bee74dbcb335290c879e82d370","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","project:embeddableRebuild","v8.16.0","backport:version"],"title":"[visualize embeddable] fix panel disappears from dashboard when canceling edit after dashboard save","number":193914,"url":"https://github.com/elastic/kibana/pull/193914","mergeCommit":{"message":"[visualize embeddable] fix panel disappears from dashboard when canceling edit after dashboard save (#193914)\n\nPart of #193905. Broke work into\r\nseparate PRs to backport map embeddable changes to 8.15.\r\n\r\nResolves issue for Visualize embeddable and dashboard empty screen. The\r\nproblem is that Visualize embeddable is using a stale result from\r\n`parentApi.getAppContext`. Dashboard's `getAppContext` changes the\r\n`getCurrentPath` when the dashboard has a saved object id. By using the\r\nstale results, `getCurrentPath` returned `#/create` instead of\r\n`#/view/`. The fix is to get a current version of `getAppContext` when\r\nrequired.\r\n\r\n### Test steps\r\n1. create new dashboard\r\n2. Click \"Add panel\" (problem also exists when using \"Add from library\")\r\n3. Select \"Aggregation based\"\r\n4. In editor, click \"Save and return\"\r\n5. Save dashboard\r\n6. Click \"Edit\" in panel context menu\r\n7. In editor, click \"Cancel\"\r\n8. Ensure visualize panel is still displayed in dashboard","sha":"d6c8840a561484bee74dbcb335290c879e82d370"}},"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/193914","number":193914,"mergeCommit":{"message":"[visualize embeddable] fix panel disappears from dashboard when canceling edit after dashboard save (#193914)\n\nPart of #193905. Broke work into\r\nseparate PRs to backport map embeddable changes to 8.15.\r\n\r\nResolves issue for Visualize embeddable and dashboard empty screen. The\r\nproblem is that Visualize embeddable is using a stale result from\r\n`parentApi.getAppContext`. Dashboard's `getAppContext` changes the\r\n`getCurrentPath` when the dashboard has a saved object id. By using the\r\nstale results, `getCurrentPath` returned `#/create` instead of\r\n`#/view/`. The fix is to get a current version of `getAppContext` when\r\nrequired.\r\n\r\n### Test steps\r\n1. create new dashboard\r\n2. Click \"Add panel\" (problem also exists when using \"Add from library\")\r\n3. Select \"Aggregation based\"\r\n4. In editor, click \"Save and return\"\r\n5. Save dashboard\r\n6. Click \"Edit\" in panel context menu\r\n7. In editor, click \"Cancel\"\r\n8. Ensure visualize panel is still displayed in dashboard","sha":"d6c8840a561484bee74dbcb335290c879e82d370"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <[email protected]>
- Loading branch information