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

Use Actions / Triggers for Creating Panels #97010

Closed
Tracked by #144752
cqliu1 opened this issue Apr 13, 2021 · 2 comments
Closed
Tracked by #144752

Use Actions / Triggers for Creating Panels #97010

cqliu1 opened this issue Apr 13, 2021 · 2 comments
Labels
chore Feature:Dashboard Dashboard related features Feature:UIActions UI actions. These are client side only, not related to the server side actions.. impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:large Large Level of Effort Project:Dashboard Usability Related to the Dashboard Usability initiative Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas

Comments

@cqliu1
Copy link
Contributor

cqliu1 commented Apr 13, 2021

Describe the feature:

We should register a uiActions trigger to allow other plugins to register creation links for Dashboard.

Describe a specific use case for the feature:

The editor menu that allows new panels to be created is currently populated with visualizations and embeddables by the Dashboard. Instead of Dashboard generating these menu items, we should have the apps register actions for creating their corresponding embeddables.

Registering the menu options as uiActions would give us better control of the ordering and grouping in the menu while also reducing the dependencies in Dashboard since Dashboard is pulling in the vis type registry and embeddable factory registry to populate the menu.

This would also make it easy for Canvas and other apps to use the same actions to handle embedding visualizations.

Here's a example snippet of how the uiActions can be registered:

// In dashboard:
<button onClick={plugins.uiActions.getTrigger('ALL_EDITORS_CLICK').exec({...})}>All editors</button>

// Other plugins, say Lens:
plugins.uiActions.createAction({
  id: 'GO_TO_LENS_EDITOR',
  order: 1000000,
getHref: () => '',
  execute: async () => {
    // go to lens
  },
});

plugins.uiActions.attachTriggerAction('ALL_EDITORS_CLICK', 'GO_TO_LENS_EDITOR');
//In Canvas:

<button onClick={plugins.uiActions.getTrigger('ALL_EDITORS_CLICK_CANVAS').exec({...})}>All editors</button>
plugins.uiActions.attachTriggerAction('ALL_EDITORS_CLICK_CANVAS', 'GO_TO_LENS_EDITOR');
or

<button onClick={plugins.uiActions.getTrigger('ALL_EDITORS_CLICK').exec({...})}>All editors canvas</button>

It would be nice to have the vis type registry and embeddable factory registry automatically register uiActions so plugin developers can get uiActions out of the box when registering a new vis type or embeddable.

@cqliu1 cqliu1 added chore Feature:Dashboard Dashboard related features Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:large Large Level of Effort impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Feature:UIActions UI actions. These are client side only, not related to the server side actions.. labels Apr 13, 2021
@elasticmachine
Copy link
Contributor

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

@ThomThomson ThomThomson changed the title [Dashboard] Use uiActions for Editor menu options [Dashboard Usability] Use Actions / Triggers for Dashboard Toolbar Jan 17, 2023
@ThomThomson ThomThomson added the Project:Dashboard Usability Related to the Dashboard Usability initiative label Jan 17, 2023
@ThomThomson ThomThomson changed the title [Dashboard Usability] Use Actions / Triggers for Dashboard Toolbar [Dashboard Usability] Use Actions / Triggers for Creating Panels Mar 6, 2023
@cqliu1 cqliu1 changed the title [Dashboard Usability] Use Actions / Triggers for Creating Panels Use Actions / Triggers for Creating Panels Mar 14, 2024
@cqliu1
Copy link
Contributor Author

cqliu1 commented Mar 14, 2024

Closing because this is done. There is now an ADD_PANEL_TRIGGER trigger.

@cqliu1 cqliu1 closed this as completed Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Dashboard Dashboard related features Feature:UIActions UI actions. These are client side only, not related to the server side actions.. impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:large Large Level of Effort Project:Dashboard Usability Related to the Dashboard Usability initiative Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas
Projects
None yet
Development

No branches or pull requests

3 participants