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] Use "Add New" Embeddable flow like Dashboard #81812

Closed
crob611 opened this issue Oct 27, 2020 · 5 comments · Fixed by #113827
Closed

[Canvas] Use "Add New" Embeddable flow like Dashboard #81812

crob611 opened this issue Oct 27, 2020 · 5 comments · Fixed by #113827
Assignees
Labels
enhancement New value added to drive a business result Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:x-large Extra Large Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@crob611
Copy link
Contributor

crob611 commented Oct 27, 2020

Canvas currently uses an Add Embeddable flow that only allows you to add Saved Objects backed Embeddables.

The flyout used by dashboard includes an "Add New" button that lets you build embeddable certain kinds of embeddables (ML Swimlane) on the fly. Canvas should switch to using this method so that Canvas can take advantage of these new kinds of embeddables that do not require a saved object.

@crob611 crob611 added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Feature:Canvas labels Oct 27, 2020
@elasticmachine
Copy link
Contributor

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

@ryankeairns
Copy link
Contributor

Proposed updates to the flyout are related to the toolbar work. Explained here: #82906

@cqliu1 cqliu1 added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:x-large Extra Large Level of Effort enhancement New value added to drive a business result labels Dec 5, 2020
@cqliu1
Copy link
Contributor

cqliu1 commented Jan 13, 2021

We want to use the same panel toolbar from Dashboard (see #85663) in Canvas to handle creating new by-value/by-reference embeddable and adding existing by-reference embeddables.

In order to integrate the panel toolbar, Canvas would need to generically support both by-value and by-ref for any type of embeddable. This is potentially a breaking change and requires some research.

This panel toolbar expects an Embeddable Container to be passed into the component to handle adding embeddables, so it'll require turning the Canvas workpad in an embeddable container.

Q: Do we need to turn workpads into an Embeddable Container? Would this support native elements? Would this require turning Canvas elements into embeddables?

To persist by-value embeddables, we also need to store the embeddable input object as part of the workpad object and will result in changes to the Workpad schema.

@clintandrewhall
Copy link
Contributor

@cqliu1 In the immediate term, I'm more interested in having a consistent UI than I am a consistent embeddables architecture. In other words, while we can do research on the by-value/by-reference change, the components that make up the toolbar need not make that distinction... they just need to look the same. We could propose a pattern:

A toolbar in a Presentation solution consists of a blue "create" button, then three to five "symbol-based, quick create" buttons, (e.g. filter controls, common elements, text/link/etc), then a "full list" menu, then "Add from Library", (if applicable)

We could implement this pattern in Canvas today using the same components... just not those with particular business logic.

@crob611
Copy link
Contributor Author

crob611 commented Jun 2, 2021

Just some notes from our meeting of generally what we think needs to happen to get this done. I will break this up into smaller issues that we can knock out one by one.

Embeddables by value in Canvas project

- Embeddable renderer should handle rendering embeddables by value
  - The embeddable renderer currently only does "Embeddable.createFromSavedObject" but should just do a standard "create" if there is no Id in the input
  - This might need an embeddable container to properly render
  - Switch to expression handler handlers.event for custom events instead of the canvas custom handlers
  

- Unrelated Task: Canvas uses renderer handlers outside of what's defined by Expressions.  
  - We should switch to use the provided handlers.event to fire our own events


- Create raw "embeddable" function,
  - This function would just take "config" as an argument. This config will just be a big old json blob.
  - We stll have the issue of action inside of the embeddable altering the input and would need to alter the underlying expression. (Example, recentering a map)
  - Maybe the embeddable input is part of the "element" 
  - We need to make sure that the blob displays nicely into the expression editor. 
    -Could be "go to lens" type stuff/etc 
  - Need a way to easily kick into "edit this config" 
  - Migrate the existing "savedMap" etc functions to just use this embeddable function

Telemetry and Migrations and References
  - Just like dashboard
  - Well tested

Switch to New Menu to create "By Values"
  - Handle state transfer for inserting new/edits into the workpad
  

- Filtering embeddables
  - I think the endgame should be that we hide the expression editor for embeddables
  - Then there is some kind of interface for selecting what filters are applied to that embeddable

- Canvas Embeddable Panel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Canvas impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:x-large Extra Large Level of Effort Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants