Skip to content

[Controls Anywhere] Make "Use global filters" setting ignore control selections#240375

Merged
Zacqary merged 4 commits intoelastic:controlsAnywherefrom
Zacqary:237887-globalfilter-controls
Oct 28, 2025
Merged

[Controls Anywhere] Make "Use global filters" setting ignore control selections#240375
Zacqary merged 4 commits intoelastic:controlsAnywherefrom
Zacqary:237887-globalfilter-controls

Conversation

@Zacqary
Copy link
Copy Markdown
Contributor

@Zacqary Zacqary commented Oct 23, 2025

Summary

Closes #237887

When setting "Use global filters" on a control, it will now pass a set of empty filters to the fetchContext when fetching new data, instead of keeping filters from all the other controls on the dashboard.

@Zacqary Zacqary added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// label Oct 23, 2025
@Zacqary Zacqary requested a review from a team as a code owner October 23, 2025 20:52
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)


ignoreValidations,
...fetchContext,
filters: getFetchContextFilters(fetchContext, useGlobalFilters),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This fixes a bug where:

  1. The user disables Use Global Filters, and then the control fetches new data with filters disabled
  2. The user re-enables Use Global Filters, but the control doesn't fetch new data until the user makes a change to the filters elsewhere on the dashboard

When we mutated fetchContext.filters, it wouldn't replace the missing filters when only the useGlobalFilters subject emitted a new value.

This was probably a preexisting bug.

Copy link
Copy Markdown
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Tested locally + code review

Copy link
Copy Markdown
Contributor

@Heenawter Heenawter left a comment

Choose a reason for hiding this comment

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

Actually - sorry 🤦 If the legacy chainingSystem was NONE, we wanted to do a transform on the control group input so that useGlobalFilters was false

Do you mind doing that? See src/platform/plugins/shared/dashboard/server/content_management/v1/transforms/out/transform_control_group_out.ts

@Zacqary Zacqary requested a review from Heenawter October 27, 2025 19:12
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Oct 28, 2025

💔 Build Failed

Failed CI Steps

History

@Zacqary Zacqary merged commit 2a336c2 into elastic:controlsAnywhere Oct 28, 2025
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Project:Controls Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t//

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants