Skip to content
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

Merged
merged 10 commits into from
Jan 13, 2020
Merged

Conversation

crob611
Copy link
Contributor

@crob611 crob611 commented Jan 3, 2020

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 strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@crob611 crob611 requested review from a team as code owners January 3, 2020 22:03
@crob611 crob611 added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:enhancement review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.6.0 v8.0.0 labels Jan 3, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@lizozom
Copy link
Contributor

lizozom commented Jan 5, 2020

@elasticmachine merge upstream

@crob611
Copy link
Contributor Author

crob611 commented Jan 6, 2020

@elasticmachine merge upstream

@timductive
Copy link
Member

Screen Shot 2020-01-07 at 11 23 12 AM

This is looking really good in testing. The only issue I found is in the screenshot. If I have a global timefilter it seems like it is attempting to filter the data twice resulting in no data. Even when the panel time range and the global time range are the same.

@streamich streamich self-requested a review January 7, 2020 17:28
@crob611
Copy link
Contributor Author

crob611 commented Jan 7, 2020

@timductive Is your TimeFilter set to use the order_date field, or is it using the default @timestamp?

@timductive
Copy link
Member

@crob611 default @timestamp, let me try it with order_date

@timductive
Copy link
Member

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.

Copy link
Contributor

@streamich streamich left a 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';
Copy link
Contributor

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.

Suggested change
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> = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

Suggested change
export const EmbeddableTypes: Record<string, string> = {
export const EmbeddableTypes: Record<string, string | undefined> = {

or

Suggested change
export const EmbeddableTypes: Record<string, string> = {
export const EmbeddableTypes: { map: string, search: string, visualization: string } = {

@timductive
Copy link
Member

Probably can close #44125 as part of this.

@timductive timductive mentioned this pull request Jan 8, 2020
@crob611
Copy link
Contributor Author

crob611 commented Jan 10, 2020

@elasticmachine merge upstream

Copy link
Contributor

@poffdeluxe poffdeluxe left a 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 => {
Copy link
Contributor

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?

@timductive
Copy link
Member

Testing looks good with the new changes! :shipit:

@crob611
Copy link
Contributor Author

crob611 commented Jan 13, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@crob611 crob611 merged commit 24b3ecb into elastic:master Jan 13, 2020
crob611 pushed a commit to crob611/kibana that referenced this pull request Jan 13, 2020
* 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>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jan 14, 2020
* 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)
  ...
crob611 pushed a commit that referenced this pull request Jan 14, 2020
* [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>
jkelastic pushed a commit to jkelastic/kibana that referenced this pull request Jan 17, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:enhancement review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants