elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.61k stars 8.22k forks source link

[canvas][map] Canvas can not render Map with query or filter in 8.15 #199318

Open nreese opened 5 hours ago

nreese commented 5 hours ago

Steps

1) install sample web logs 2) create new canvas work pad 3) Click "Add from library" and add "[Logs] Total Requests and Bytes" map to workpad 4) Click panel actions button and select "Edit map" 5) Add query "bytes > 5000" to map and click "Save and return". 6) notice how the map is no longer rendered. Image

Problem

Filter notification action opens a popover to show filters and queries applied to the panel. Image

Filter popover retrieves data views with the following code snippet from https://github.com/elastic/kibana/blob/8.15/src/plugins/dashboard/public/dashboard_actions/filters_notification_popover.tsx#L59

const dataViews = useMemo(() => api.parentApi?.getAllDataViews(), [api]);

parentApi is undefined for legacy embeddables so dataViews is set to undefined. For new react embeddables, parentApi is defined by the results of useCanvasApi. parentApi does not implement getAllDataViews, resulting in the failure.

In 8.15, map embeddable was converted to the new embeddable system causing the regresion.

elasticmachine commented 4 hours ago

Pinging @elastic/kibana-presentation (Team:Presentation)