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

[Lens] Pinned filters not applied when coming from different app #73825

Merged

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jul 30, 2020

Summary

Fixes #73012
The bug was caused by the fact that the state update only happens on updates from observable:

 const filterSubscription = data.query.filterManager.getUpdates$().subscribe({
      next: () => {
        setState((s) => ({ ...s, filters: data.query.filterManager.getFilters() }));
        trackUiEvent('app_filters_updated');
      },
    });

We do run data.query.filterManager.setAppFilters([]) on start and then data.query.filterManager.setAppFilters(savedObject.state.filters) and on document load, but if there was no appFilters in previous app, we set up the appFilters to the same value as before, and so next won't be ever run, so the state won't be synchronized.

If lens saved object has some app filters, the bug is not reproduced even without this fix.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
lens 24.7KB +35.0B 24.7KB

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mbondyra mbondyra marked this pull request as ready for review July 31, 2020 05:55
@mbondyra mbondyra requested a review from a team July 31, 2020 05:55
@mbondyra mbondyra added Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v7.9.0 v8.0.0 labels Jul 31, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in Chrome and FF, works as expected. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:fix Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Pinned filter is not applied when navigating to Lens
4 participants