-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Canvas] Enable Embeddable maps #53971
Conversation
Pinging @elastic/kibana-canvas (Team:Canvas) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@timductive Is your TimeFilter set to use the |
@crob611 default @timestamp, let me try it with order_date |
yep that bug was user error. It would be nice of the panel timerange could update when a global filter is applied. The data updates but not the panel timerange. Filters will be a little tricky until we revamp them as a whole though. |
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.
AppArch change LGTM.
@@ -5,11 +5,11 @@ | |||
*/ | |||
|
|||
import { ExpressionType } from 'src/plugins/expressions/public'; | |||
import { EmbeddableInput } from 'src/legacy/core_plugins/embeddable_api/public/np_ready/public'; | |||
import { EmbeddableInput } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; |
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.
Embeddables are in the New Platform, you can import everything from there.
import { EmbeddableInput } from '../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; | |
import { EmbeddableInput } from '../../../../../../src/plugins/embeddable/public'; |
@@ -9,7 +9,7 @@ import { MAP_SAVED_OBJECT_TYPE } from '../../../maps/common/constants'; | |||
import { VISUALIZE_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/visualize_embeddable/constants'; | |||
import { SEARCH_EMBEDDABLE_TYPE } from '../../../../../../src/legacy/core_plugins/kibana/public/discover/np_ready/embeddable/constants'; | |||
|
|||
export const EmbeddableTypes = { | |||
export const EmbeddableTypes: Record<string, string> = { |
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.
Maybe
export const EmbeddableTypes: Record<string, string> = { | |
export const EmbeddableTypes: Record<string, string | undefined> = { |
or
export const EmbeddableTypes: Record<string, string> = { | |
export const EmbeddableTypes: { map: string, search: string, visualization: string } = { |
Probably can close #44125 as part of this. |
@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.
Looks good to me!
Tested it a decent bit and it seems to work well. My only thought is what to do if the saved map being rendered gets deleted. Current behavior is a blank element with an error being thrown in console. Could we just display the element in an error state or something?
const { elementId, embeddableExpression } = payload; | ||
|
||
// Find the element | ||
const pageWithElement = workpadState.pages.find(page => { |
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.
nit: we're doin a lot of this kind of finding a page or element given an element id across this code. maybe something to refactor?
Testing looks good with the new changes! |
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Enables Embeddable maps in Canvas. Updates expressions as maps are interacted with * Fix type check errors * Update imports. Remove filters from initial embed expressions * Adds hide layer functionality to canvas map embeds * Fix typecheck error * Fix Type check Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* upstream/master: (26 commits) Take page offset into account too (elastic#54567) [APM] Support error.{log,exception}.stacktrace.classname (elastic#54577) Np migration tsvb route validation (elastic#51850) [ML] MML calculator enhancements for multi-metric job wizard (elastic#54573) [SIEM] Fix Inspect query 'request timestamp' value changes when curso… (elastic#54223) Fix chromeless NP apps not using full page width (elastic#54550) Remove extraneous public import to prevent failing Kibana startup (elastic#54676) [Uptime] Temporarily skip flakey tests (elastic#54675) Skip failing uptime tests Create UI for alerting and actions plugin (elastic#48959) [dev/build/sass] build stylesheets for disabled plugins too (elastic#54654) [SIEM] Use bulk actions API when updating or deleting rules (elastic#54521) Support "Deprecated" label in advanced settings (elastic#54539) [Maps] add text halo color and width style properties (elastic#53827) Service Map Data API at Runtime (elastic#54027) [SIEM] Detection Engine Create Rule Design Review #1 (elastic#54442) Skip flaky test [Canvas] Enable Embeddable maps (elastic#53971) [SIEM][Detection Engine] Increases the number or rules you can view on a single page (elastic#54628) uiSettings - use validation field for image field maxSize (elastic#54522) ...
* [Canvas] Enable Embeddable maps (#53971) * Enables Embeddable maps in Canvas. Updates expressions as maps are interacted with * Fix type check errors * Update imports. Remove filters from initial embed expressions * Adds hide layer functionality to canvas map embeds * Fix typecheck error * Fix Type check Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> * Re-enable embeds in Canvas Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Enables Embeddable maps in Canvas. Updates expressions as maps are interacted with * Fix type check errors * Update imports. Remove filters from initial embed expressions * Adds hide layer functionality to canvas map embeds * Fix typecheck error * Fix Type check Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This enables Embeddable Maps for Canvas. The most important feature added here is interaction with a map (panning, zooming, adjusting time range, etc) will also update the expression backing the element so the map will return to that state on reload.
One feature this does not include is keeping track of which layers are enabled and disabled. There will need to be some changes to the Map Embeddable for that to happen and it will be tackled in a followup PR.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers