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

[8.x] [Lens][Embeddable] Apply the correct references for filters (#204047) #205000

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

Questions ?

Please refer to the Backport tool documentation

Questions ?

Please refer to the Backport tool documentation

Questions ?

Please refer to the Backport tool documentation

…204047)

## Summary

Fixes elastic#180726

Fix the filter references when inline editing with the correct ones.

I've tried to reduce the fix to a minimal `extract` wrapper, but
unfortunately that is not possible due to some shared logic who rely on
the passed filters references and need to be injected.
So, why not injecting them and instead rely on the search context api?
Right now there's no difference, but formally the `api.filters$` is the
right place to get the latest version, and if in the future the `Edit
filters` flows would change, this api should be the go-to place to have
the right value.

Why not adding a FTR?
There's a bigger problem with the panel filters action who has a dynamic
`data-test-subj` value which is impossible to get right now. I would
rather prefer to fix that first and then add some tests in general for
multiple scenarios in Lens.

## Testing it locally

* Create a viz with a filter in the editor, save and return to dashboard
* Check the filters are shown correctly in the dashboard panel
* Edit inline and change the chart type. Apply changes
* Check the filters are shown correctly
* Now "edit" in the editor without changing anything
* Check the filter can be edited correctly (no empty popover) ✅  or 💥
* Save and return to dashboard
* Check the filters are shown correctly ✅  or 💥

(cherry picked from commit c521c1c)
@kibanamachine kibanamachine merged commit ce4641f into elastic:8.x Dec 19, 2024
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 1.5MB 1.5MB +223.0B

cc @dej611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants