Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.14] [Custom threshold][Logs Explorer] Fix an issue with saving pre…
…filled filters in the custom threshold rule on the Logs Explorer page (#183900) (#184087) # Backport This will backport the following commits from `main` to `8.14`: - [[Custom threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page (#183900)](#183900) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Maryam Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2024-05-23T07:16:07Z","message":"[Custom threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes #183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving prefilled filters in the custom\r\nthreshold rule by using `getSearchConfiguration` every time the\r\nserachConfiguration is saved in rule parameters. Now,\r\n`getSearchConfiguration` does two things:\r\n1. Ensure the query has the correct type (`Qurey`), or it will be set as\r\nthe default query.\r\n2. Adjust filters by removing `$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted the related type to exclude `$state`.\r\n\r\n### How to test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.15.0"],"title":"[Custom threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page","number":183900,"url":"#183900 threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes #183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving prefilled filters in the custom\r\nthreshold rule by using `getSearchConfiguration` every time the\r\nserachConfiguration is saved in rule parameters. Now,\r\n`getSearchConfiguration` does two things:\r\n1. Ensure the query has the correct type (`Qurey`), or it will be set as\r\nthe default query.\r\n2. Adjust filters by removing `$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted the related type to exclude `$state`.\r\n\r\n### How to test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#183900 threshold][Logs Explorer] Fix an issue with saving prefilled filters in the custom threshold rule on the Logs Explorer page (#183900)\n\nFixes #183710\r\n\r\n## Summary\r\n\r\nThis PR fixes the issue of saving prefilled filters in the custom\r\nthreshold rule by using `getSearchConfiguration` every time the\r\nserachConfiguration is saved in rule parameters. Now,\r\n`getSearchConfiguration` does two things:\r\n1. Ensure the query has the correct type (`Qurey`), or it will be set as\r\nthe default query.\r\n2. Adjust filters by removing `$state` and only keeping `meta` and\r\n`query`\r\n\r\nAlso, I adjusted the related type to exclude `$state`.\r\n\r\n### How to test\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/12370520/9d69e601-d021-4ae3-8baf-88286d3716fe","sha":"4ccd47d90e7b812d0d405cdd906a8b775757c1a4"}}]}] BACKPORT--> Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
- Loading branch information