Skip to content

[ResponseOps][MaintenanceWindow] Add filter button of DSL filter throws error on create/edit MWs#259517

Merged
georgianaonoleata1904 merged 14 commits intoelastic:mainfrom
georgianaonoleata1904:mw-wildcard-follow-up
Apr 3, 2026
Merged

[ResponseOps][MaintenanceWindow] Add filter button of DSL filter throws error on create/edit MWs#259517
georgianaonoleata1904 merged 14 commits intoelastic:mainfrom
georgianaonoleata1904:mw-wildcard-follow-up

Conversation

@georgianaonoleata1904
Copy link
Copy Markdown
Contributor

@georgianaonoleata1904 georgianaonoleata1904 commented Mar 25, 2026

Closes #259514

Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no index patterns available. getFilterFromQueryDsl accessed indexPatterns[0].id without guarding against an empty array.

  • fixed also: filter not being displayed after creation, two separate guards were preventing DSL filter pills from rendering in Maintenance Windows (where indexPatterns / dataViews is an empty array):
  • fixed also edit added filter: indexPattern?.getName() fails because getName() is a method on the DataView class, not on plain DataViewBase objects. Fixed by using optional call getName?.() with fallbacks to name and title.

Related to: #256622

@georgianaonoleata1904 georgianaonoleata1904 self-assigned this Mar 25, 2026
@georgianaonoleata1904 georgianaonoleata1904 requested a review from a team as a code owner March 25, 2026 09:48
@georgianaonoleata1904 georgianaonoleata1904 added release_note:fix backport:skip This PR does not require backporting Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.4.0 labels Mar 25, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@georgianaonoleata1904 georgianaonoleata1904 added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:fix labels Mar 26, 2026
Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

Copy link
Copy Markdown
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

Verified locally, works as expected 👍
image

@@ -346,12 +346,10 @@ export class SearchBarUI<QT extends (Query | AggregateQuery) | Query = Query> ex
}

private shouldRenderFilterBar() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about just return this.props.showFilterBar || this.props.filters.length?

Really you are just removing indexPatterns length check.

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.

it works with &&: return this.props.showFilterBar && this.props.filters

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.

updated the pr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think return this.props.showFilterBar && this.props.filters is correct. This will return false when this.props.filters is not provided.

Taking a step back, we want to render filter bar whenever this.props.showFilterBar is true regardless of available indexPatterns. In that case. I think we should remove shouldRenderFilterBar helper function and just replace its usage with this.props.showFilterBar

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.

Hi @nreese I've addressed the requested changes to remove shouldRenderFilterBar function and to use this.props.showFilterBar instead.

@cnasikas
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #186 / Agent Builder sidebar Sidebar Error Handling can start a new chat when there is an error

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
unifiedSearch 154.9KB 155.1KB +220.0B
Unknown metric groups

References to deprecated APIs

id before after diff
unifiedSearch 2 4 +2

Unreferenced deprecated APIs

id before after diff
unifiedSearch 2 4 +2

History

cc @georgianaonoleata1904

Copy link
Copy Markdown
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

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

changes look good to me 👍

verified locally, works as expected 🎉
image

Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

@georgianaonoleata1904 georgianaonoleata1904 merged commit f6c8369 into elastic:main Apr 3, 2026
19 checks passed
@cnasikas cnasikas added the bug Fixes for quality problems that affect the customer experience label Apr 3, 2026
@georgianaonoleata1904 georgianaonoleata1904 added backport:version Backport to applied version labels v9.3.3 v9.2.8 and removed backport:skip This PR does not require backporting labels Apr 3, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23948182226

@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23948182217

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.2
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 3, 2026
…ws error on create/edit MWs (elastic#259517)

Closes elastic#259514

## Summary

Fix crash in FilterEditor when submitting a Query DSL filter with no
index patterns available. getFilterFromQueryDsl accessed
indexPatterns[0].id without guarding against an empty array.
- fixed also: filter not being displayed after creation, two separate
guards were preventing DSL filter pills from rendering in Maintenance
Windows (where indexPatterns / dataViews is an empty array):
- fixed also edit added filter: indexPattern?.getName() fails because
getName() is a method on the DataView class, not on plain DataViewBase
objects. Fixed by using optional call getName?.() with fallbacks to name
and title.

Related to: elastic#256622

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit f6c8369)
@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.2
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 3, 2026
…r throws error on create/edit MWs (#259517) (#261139)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[ResponseOps][MaintenanceWindow] Add filter button of DSL filter
throws error on create/edit MWs
(#259517)](#259517)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2026-04-03T09:43:16Z","message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit
MWs","number":259517,"url":"https://github.com/elastic/kibana/pull/259517","mergeCommit":{"message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259517","number":259517,"mergeCommit":{"message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Apr 3, 2026
…r throws error on create/edit MWs (#259517) (#261138)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[ResponseOps][MaintenanceWindow] Add filter button of DSL filter
throws error on create/edit MWs
(#259517)](#259517)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Georgiana-Andreea
Onoleață","email":"georgiana.onoleata@elastic.co"},"sourceCommit":{"committedDate":"2026-04-03T09:43:16Z","message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.4.0","v9.3.3","v9.2.8"],"title":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit
MWs","number":259517,"url":"https://github.com/elastic/kibana/pull/259517","mergeCommit":{"message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353"}},"sourceBranch":"main","suggestedTargetBranches":["9.3","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259517","number":259517,"mergeCommit":{"message":"[ResponseOps][MaintenanceWindow]
Add filter button of DSL filter throws error on create/edit MWs
(#259517)\n\nCloses
https://github.com/elastic/kibana/issues/259514\n\n## Summary\n\nFix
crash in FilterEditor when submitting a Query DSL filter with no\nindex
patterns available. getFilterFromQueryDsl accessed\nindexPatterns[0].id
without guarding against an empty array.\n- fixed also: filter not being
displayed after creation, two separate\nguards were preventing DSL
filter pills from rendering in Maintenance\nWindows (where indexPatterns
/ dataViews is an empty array):\n- fixed also edit added filter:
indexPattern?.getName() fails because\ngetName() is a method on the
DataView class, not on plain DataViewBase\nobjects. Fixed by using
optional call getName?.() with fallbacks to name\nand title.\n\nRelated
to:
https://github.com/elastic/kibana/pull/256622\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"f6c836958dab7169a84f7c2ec19e2e758f823353"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Georgiana-Andreea Onoleață <georgiana.onoleata@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v9.2.8 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ResponseOps][MaintenanceWindows] Add filter button of DSL filter throws error on create/edit MWs

6 participants