elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.78k stars 8.19k forks source link

[Dashboard] [Controls] Add custom icons to options list suggestions #147030

Open Heenawter opened 1 year ago

Heenawter commented 1 year ago

Related to https://github.com/elastic/kibana/issues/146997

Describe the feature:

The @elastic/observability team wants to make use of the new Controls in their solution - however, in order to get the best experience from this, they want the ability to add custom icons beside the suggestions like so:

There are a few things to consider here...

  1. Should we expose this to users somehow?
  2. Should we simply add an "icon" to the control's input and make it dependent on the consumer to define this?
  3. Instead of (2), perhaps it's possible for the ES data itself to store this icon and we could fetch it as part of the ES query - need to do more research here...
elasticmachine commented 1 year ago

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

shahzad31 commented 1 year ago

i was hoping a component like this can be exposed directly from EUI, i had also made an enhancement request to extend EuiSelectable based filtering. https://github.com/elastic/eui/issues/6436

ThomThomson commented 1 year ago

This is a cool idea! Is there any precedent in terms of storing icon-type in elasticsearch? A complicated & feature complete version of this that is probably not warranted involves storing the icon type in another field in ES and using top_hit to fetch the icon field from the term.

The cleanest way to do this from our POV would to be not expose this to the end-user and instead have this passed in as a callback when using the controlGroupRenderer. Then the implementor could determine which icons to show alongside which values in which Control.