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

[Lens] Add option to include action menu in embeddable renderer #93941

Closed
flash1293 opened this issue Mar 8, 2021 · 3 comments · Fixed by #102038
Closed

[Lens] Add option to include action menu in embeddable renderer #93941

flash1293 opened this issue Mar 8, 2021 · 3 comments · Fixed by #102038
Assignees
Labels
enhancement New value added to drive a business result Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@flash1293
Copy link
Contributor

The EmbeddableComponent of the lens plugin exposed an embeddable renderer which is easy to use in order to render a bare visualization. However a lot of features are encapsulated in the action dropdown menu. There should be a property to enable displaying all available actions in the consuming app (e.g. csv download)

@flash1293 flash1293 added enhancement New value added to drive a business result Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Mar 8, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor Author

Looked into this together with @dej611 and this is the plan for implementation we came up with:

  • We can use the EmbeddablePanel component with a hidden title for this - it does all the things we need
  • Our issue - the embeddable panel requires a consumer to construct the embeddable instance manually which is annoying
  • Right now we are using the EmbeddableRenderer component which can create an embeddable instance using the factory and inputs - however it's hardcoded to use the EmbeddableRoot component to actually render the embeddable instead of the panel
  • Our plan: Refactor the EmbeddableRenderer component and pull out the part which is generating the embeddable instance using the factory into a hook: const { embeddable, loading, error } = useEmbeddableFactory(factory, input)
  • Use the hook in EmbeddableRenderer and also export it directly
  • For Lens, use the hook and render either using EmbeddablePanel or EmbeddableRoot, depending on whether the user wants to show the action menu or not

Related:

  • Also add a prop to the Lens component to optionally filter the list of actions

@stacey-gammon Do you think this is a good extension of embeddables?

@stacey-gammon
Copy link
Contributor

Sounds reasonable to me!

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:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants