-
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
Make Lens embeddable respect disableTriggers input #62214
Comments
<ExpressionRendererComponent
variables={{embeddable: props.embeddable}}
{...}
/> And then in expression function access it: fn(data: LensMultiTable, args: XYArgs, { variables }) {
return {
type: 'render',
as: 'lens_xy_chart_renderer',
value: {
data,
args,
embeddable: variables.embeddable,
},
};
}, Maybe actually it is better to use the variables instead of the context directly.
|
Let me elaborate on the approaches here a bit:
|
making embeddable high level concept on handlers is in my opinion the worst possible option, as that would mean renderers only work inside embeddables ... think about the consequence for canvas. the concept of renderers is very simple, they get dom element, if there is anything that should always be passed to specific renderer, it should be made part of its if there is anything that should be passed down to every handler we should really revisit if that is really necessarily as that affects everything using them and we must make sure that information makes sense in all the contexts. i think from this perspective embeddable should be off the list. if we would still consider moving uiActions on the handlers (to replace the |
I just synced with Peter and that is the outcome: We'll use option #1 above: We use the App Arch will prioritize fixing the following two things, before we can switch:
|
Resolved by #65675 Lens uses the same event types as visualize to pass the filter context up to the embeddable. |
Any embeddable can have an
disableTriggers: true
set on their embeddable input. If this is set, it means, that the content of the embeddable should never execute any triggers (i.e. call theexecuteTriggerActions
method). This will be used e.g. by Canvas to disable that filtering works in charts.If an embeddable ignores this (as Lens currently does) you can still trigger e.g. the filter dialog for multiple filters in Canvas, even though it has no effect anymore when you click something in it:
The correct solution will be not to call the
executeTriggerActions
method inside charts if this flag was set to the embeddable. Now to the problems:The chart (which has that code logic) is rendered using an expression renderer. That is only registered once, and we currently don't have a way of passing information (whether the
disableTriggers
flag was set) from a specific embeddable down to that renderer'srender
function.I talked a bit with @stacey-gammon and so far the best solution we could still come up with is, actually making the
embeddable
and in that term maybe alsoexecuteTriggerActions
a high-level concept on thehandlers
so we can access it in all renderers via the handlers.This would still require the ExpressionExecutorService as the corresponding React components to accept the embeddable as an input.
I currently don't see any way without changing something in the expression plugin to get the information down into the render function.
@elastic/kibana-app-arch I think we need your input here (cc @lukeelmers since we just closed an issue with a similar discussion).
The text was updated successfully, but these errors were encountered: