-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ui Actions] Support emitting nested triggers and actions #59162
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
@stacey-gammon, I implemented some of these as part of POC of url drilldown with trigger picker: #70421 The case I wanted to support:
I didn't see your implementation thoughts before implementing this in POC and took different approach of setting up ⬆️ this was easy to implement and it fitted nicely, but your suggestion seem more elegant and support wider range of cases. I think, I'd try to implement your thoughts. 1 correction:
This can't be a js event loop, because action execution is async. |
There is an example of this in the
ui_actions_explorer
(once #58765 is merged).This causes two pop up menus to show up. We have a real life desire to support this as well for the
VALUE_CLICK_TRIGGER
. If the data emitted with the value click trigger can be transformed to aFilter
shape then you should be able to execute any actions that are attached toVALUE_CLICK_TRIGGER
as well as any actions attached toAPPLY_FILTER_TRIGGER
.For instance, say you have an action that just works of
field: string, value: string
data - e.g. it just searches google or somethingwww.google.com/s?q="${field} ${value}"
. If you click on a pie slice, you will have this data. You should be able to attach thesearch google
action to that trigger, as well as the usual actions that rely onFilter
context.Implementation thoughts
First: introduce the concept of automatically executed actions. I think this could be useful for other reasons anyway (consider the situation of a HOVER trigger and wanting to attach it to an action that shows a tooltip and an action that shows a global threshold line - those are two actions that should be executed simultaneously, and not shown to the user in a context menu for them to choose from).
Second: introduce batching of emitted triggers to be execute on the next event loop.
Then, an auto executed action can be attached to
VALUE_CLICK_TRIGGER
-ACTION_EMIT_APPLY_FILTER_TRIGGER
. This checks to see if the data can be transformed into aFilter
shape. If it does, ituiActionApi.emit(APPLY_FILTER_TRIGGER, filters)
. Because this is auto executed, it gets emitted before the event loop, should get batched up and then the context menu shown to the user should contain both actions attached toVALUE_CLICK_TRIGGER
and actions attached toAPPLY_FILTER_TRIGGER
The text was updated successfully, but these errors were encountered: