-
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
[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data #199690
Conversation
…eDescriptor when indexPatternId is not provided error and no data
Pinging @elastic/kibana-presentation (Team:Presentation) |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
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! code review and tested with 7.17 saved object.
Starting backport for target branches: 8.15, 8.16, 8.x |
…eDescriptor when indexPatternId is not provided error and no data (elastic#199690) Closes elastic#191777 In 8.15, map embeddable was migrated from a legacy embeddable to a react embeddable. This changed reference injection. See below for details. TLDR is that legacy embeddables pass all references to the embeddable factory when no references for the panel exist. React embeddables just pass an empty reference list regardless of if panel references exist or not. [Reference injection with legacy embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53) ``` workingState.panels[key] = { ...panel }; const filteredReferences = getReferencesForPanelId(key, references); const panelReferences = filteredReferences.length === 0 ? references : filteredReferences; ``` [Reference injection with react embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835) ``` const rawState = this.getInput().panels[childId].explicitInput; const { id, ...serializedState } = rawState; if (!rawState || Object.keys(serializedState).length === 0) return; const references = getReferencesForPanelId(childId, this.savedObjectReferences); return { rawState, references, }; ``` ### Test instructions 1) install dashboard from 7.17 saved objects from issue. 2) Open dashboard. Verify data-view is found. Note, layer will not load since your install has no index 'logstash-*', but reference problem has been fixed Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 80a9f40)
…eDescriptor when indexPatternId is not provided error and no data (elastic#199690) Closes elastic#191777 In 8.15, map embeddable was migrated from a legacy embeddable to a react embeddable. This changed reference injection. See below for details. TLDR is that legacy embeddables pass all references to the embeddable factory when no references for the panel exist. React embeddables just pass an empty reference list regardless of if panel references exist or not. [Reference injection with legacy embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53) ``` workingState.panels[key] = { ...panel }; const filteredReferences = getReferencesForPanelId(key, references); const panelReferences = filteredReferences.length === 0 ? references : filteredReferences; ``` [Reference injection with react embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835) ``` const rawState = this.getInput().panels[childId].explicitInput; const { id, ...serializedState } = rawState; if (!rawState || Object.keys(serializedState).length === 0) return; const references = getReferencesForPanelId(childId, this.savedObjectReferences); return { rawState, references, }; ``` ### Test instructions 1) install dashboard from 7.17 saved objects from issue. 2) Open dashboard. Verify data-view is found. Note, layer will not load since your install has no index 'logstash-*', but reference problem has been fixed Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 80a9f40)
…eDescriptor when indexPatternId is not provided error and no data (elastic#199690) Closes elastic#191777 In 8.15, map embeddable was migrated from a legacy embeddable to a react embeddable. This changed reference injection. See below for details. TLDR is that legacy embeddables pass all references to the embeddable factory when no references for the panel exist. React embeddables just pass an empty reference list regardless of if panel references exist or not. [Reference injection with legacy embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53) ``` workingState.panels[key] = { ...panel }; const filteredReferences = getReferencesForPanelId(key, references); const panelReferences = filteredReferences.length === 0 ? references : filteredReferences; ``` [Reference injection with react embeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835) ``` const rawState = this.getInput().panels[childId].explicitInput; const { id, ...serializedState } = rawState; if (!rawState || Object.keys(serializedState).length === 0) return; const references = getReferencesForPanelId(childId, this.savedObjectReferences); return { rawState, references, }; ``` ### Test instructions 1) install dashboard from 7.17 saved objects from issue. 2) Open dashboard. Verify data-view is found. Note, layer will not load since your install has no index 'logstash-*', but reference problem has been fixed Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 80a9f40)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ESSourceDescriptor when indexPatternId is not provided error and no data (#199690) (#199855) # Backport This will backport the following commits from `main` to `8.15`: - [[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)](#199690) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-11-12T18:19:40Z","message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","project:embeddableRebuild","backport:version","v8.17.0","v8.16.1","v8.15.5"],"title":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data","number":199690,"url":"https://github.com/elastic/kibana/pull/199690","mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199690","number":199690,"mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
…SSourceDescriptor when indexPatternId is not provided error and no data (#199690) (#199857) # Backport This will backport the following commits from `main` to `8.x`: - [[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)](#199690) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-11-12T18:19:40Z","message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","project:embeddableRebuild","backport:version","v8.17.0","v8.16.1","v8.15.5"],"title":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data","number":199690,"url":"https://github.com/elastic/kibana/pull/199690","mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199690","number":199690,"mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
…ESSourceDescriptor when indexPatternId is not provided error and no data (#199690) (#199856) # Backport This will backport the following commits from `main` to `8.16`: - [[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)](#199690) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nathan Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2024-11-12T18:19:40Z","message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","v9.0.0","project:embeddableRebuild","backport:version","v8.17.0","v8.16.1","v8.15.5"],"title":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data","number":199690,"url":"https://github.com/elastic/kibana/pull/199690","mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199690","number":199690,"mergeCommit":{"message":"[maps] fix Upgraded maps panel displays Cannot create AbstractESSourceDescriptor when indexPatternId is not provided error and no data (#199690)\n\nCloses https://github.com/elastic/kibana/issues/191777\r\n\r\nIn 8.15, map embeddable was migrated from a legacy embeddable to a react\r\nembeddable. This changed reference injection. See below for details.\r\nTLDR is that legacy embeddables pass all references to the embeddable\r\nfactory when no references for the panel exist. React embeddables just\r\npass an empty reference list regardless of if panel references exist or\r\nnot.\r\n\r\n[Reference injection with legacy\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/common/dashboard_container/persistable_state/dashboard_container_references.ts#L53)\r\n```\r\nworkingState.panels[key] = { ...panel };\r\nconst filteredReferences = getReferencesForPanelId(key, references);\r\nconst panelReferences = filteredReferences.length === 0 ? references : filteredReferences;\r\n```\r\n\r\n[Reference injection with react\r\nembeddables](https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#L835)\r\n```\r\n const rawState = this.getInput().panels[childId].explicitInput;\r\n const { id, ...serializedState } = rawState;\r\n if (!rawState || Object.keys(serializedState).length === 0) return;\r\n const references = getReferencesForPanelId(childId, this.savedObjectReferences);\r\n return {\r\n rawState,\r\n references,\r\n };\r\n```\r\n\r\n### Test instructions\r\n1) install dashboard from 7.17 saved objects from issue.\r\n2) Open dashboard. Verify data-view is found. Note, layer will not load\r\nsince your install has no index 'logstash-*', but reference problem has\r\nbeen fixed\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"80a9f40e25c1707d5c73c415b53648398febd646"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
Closes #191777
In 8.15, map embeddable was migrated from a legacy embeddable to a react embeddable. This changed reference injection. See below for details. TLDR is that legacy embeddables pass all references to the embeddable factory when no references for the panel exist. React embeddables just pass an empty reference list regardless of if panel references exist or not.
Reference injection with legacy embeddables
Reference injection with react embeddables
Test instructions