mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[canvas] fix by-value map embeddables have broken layers (#190996)
Resolves https://github.com/elastic/kibana/issues/190994 ### Test instructions 1. create new canvas workpad 2. Click "Select type" and select "Maps" 3. Add a documents layer to your map and click "Save and return" 4. Click "canvas" bread crumb to go back to canvas listing page 5. Open you work pad again. Map should still display data
This commit is contained in:
parent
0ffd37a074
commit
1da096793d
3 changed files with 14 additions and 0 deletions
|
@ -49,6 +49,7 @@ export const useCanvasApi: () => CanvasContainerApi = () => {
|
|||
createNewEmbeddable(panelType, initialState);
|
||||
},
|
||||
disableTriggers: true,
|
||||
type: 'canvas',
|
||||
/**
|
||||
* getSerializedStateForChild is left out here because we cannot access the state here. That method
|
||||
* is injected in `x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx`
|
||||
|
|
|
@ -11,6 +11,7 @@ import { EmbeddableInput as Input } from '@kbn/embeddable-plugin/common';
|
|||
import type {
|
||||
HasAppContext,
|
||||
HasDisableTriggers,
|
||||
HasType,
|
||||
PublishesViewMode,
|
||||
PublishesUnifiedSearch,
|
||||
} from '@kbn/presentation-publishing';
|
||||
|
@ -25,5 +26,6 @@ export type EmbeddableInput = Input & {
|
|||
export type CanvasContainerApi = PublishesViewMode &
|
||||
CanAddNewPanel &
|
||||
HasDisableTriggers &
|
||||
HasType &
|
||||
HasSerializedChildState &
|
||||
Partial<HasAppContext & PublishesUnifiedSearch>;
|
||||
|
|
|
@ -12,6 +12,7 @@ import { APPLY_FILTER_TRIGGER } from '@kbn/data-plugin/public';
|
|||
import { ReactEmbeddableFactory, VALUE_CLICK_TRIGGER } from '@kbn/embeddable-plugin/public';
|
||||
import { EmbeddableStateWithType } from '@kbn/embeddable-plugin/common';
|
||||
import {
|
||||
apiIsOfType,
|
||||
areTriggersDisabled,
|
||||
getUnchangingComparator,
|
||||
initializeTimeRange,
|
||||
|
@ -125,6 +126,16 @@ export const mapEmbeddableFactory: ReactEmbeddableFactory<
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Canvas by-value embeddables do not support references
|
||||
*/
|
||||
if (apiIsOfType(parentApi, 'canvas')) {
|
||||
return {
|
||||
rawState: getByValueState(rawState, savedMap.getAttributes()),
|
||||
references: [],
|
||||
};
|
||||
}
|
||||
|
||||
// by-value embeddable
|
||||
const { attributes, references } = extractReferences({
|
||||
attributes: savedMap.getAttributes(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue