[Lens] Pass the uiSettings default language to filters aggregation #77012
Labels
Feature:Lens
good first issue
low hanging fruit
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
technical debt
Improvement of the software architecture and operational architecture
Projects
Describe the feature:
Can be done after merging #75635
Right now we use 'kuery' as a default language in filters aggregation, but in the future we want this setting to come from uiSettings. The implementation details can be found below (by Joe):
It looks like there are three cases where the default query is required: When adding a new filter using the add button in the UI (which has access to
data
), when initializing an empty filters array (in buildColumn) and when writing the esaggs config. The one in buildColumn could be omitted because it will be caught by the logic in toEsAggsConfig and in the UI anyway.To solve it cleanly we could extend
toEsAggsConfig
to also pass indata
. This is a change scoped in the index pattern datasource. To do so,kibana/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts
Line 129 in ddf99b6
has to be replaced by a generator function to pass in the reference and keep it in a function closure:
Then it can be passed through like this:
kibana/x-pack/plugins/lens/public/indexpattern_datasource/indexpattern.tsx
Line 193 in e82e536
kibana/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts
Line 129 in ddf99b6
kibana/x-pack/plugins/lens/public/indexpattern_datasource/to_expression.ts
Line 24 in ddf99b6
kibana/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.tsx
Line 144 in fdbf1ae
kibana/x-pack/plugins/lens/public/indexpattern_datasource/operations/definitions/filters/filters.tsx
Line 154 in fdbf1ae
For
buildColumn
it's pretty similar - we call it in the dimension panel and popover editor (which have access todata
already, so that's easy) and in suggestions. For suggestions, we would need to do the same thing as described above fortoEsAggsConfig
.The text was updated successfully, but these errors were encountered: