Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.6] [Security Solution] Failed to Fetch Rules and Timeline in Previ…
…ew Flyout (#146904) (#146921) # Backport This will backport the following commits from `main` to `8.6`: - [[Security Solution] Failed to Fetch Rules and Timeline in Preview Flyout (#146904)](#146904) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2022-12-02T20:17:54Z","message":"[Security Solution] Failed to Fetch Rules and Timeline in Preview Flyout (#146904)\n\n## Summary\r\n\r\nThese changes fixes the issue with the unexpected \"Failed to Fetch Rule\"\r\nerror toast that appears when user opens the alert details from the Rule\r\nPreview page.\r\n\r\nThe issue was introduced by [recent\r\nrefactoring](#142950) where we\r\nswitched from the optional toast to showing error toast always when it\r\nis not possible to fetch the rule (see `useRuleWithFallback` hook). In\r\ncase of Rule Preview the rule does not exist and thus server returns 404\r\n(not found) error. In case of Rule Preview we would like to ignore this\r\nerror and build the rule from the alert.\r\n\r\nBug Ticket: #146858","sha":"1b4c66101b02dd4c01582a0e7b684eb5b499101a","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team: SecuritySolution","Team:Detection Rules","Team:Detection Alerts","backport:prev-minor","ci:cloud-deploy","v8.7.0"],"number":146904,"url":"https://github.com/elastic/kibana/pull/146904","mergeCommit":{"message":"[Security Solution] Failed to Fetch Rules and Timeline in Preview Flyout (#146904)\n\n## Summary\r\n\r\nThese changes fixes the issue with the unexpected \"Failed to Fetch Rule\"\r\nerror toast that appears when user opens the alert details from the Rule\r\nPreview page.\r\n\r\nThe issue was introduced by [recent\r\nrefactoring](#142950) where we\r\nswitched from the optional toast to showing error toast always when it\r\nis not possible to fetch the rule (see `useRuleWithFallback` hook). In\r\ncase of Rule Preview the rule does not exist and thus server returns 404\r\n(not found) error. In case of Rule Preview we would like to ignore this\r\nerror and build the rule from the alert.\r\n\r\nBug Ticket: #146858","sha":"1b4c66101b02dd4c01582a0e7b684eb5b499101a"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146904","number":146904,"mergeCommit":{"message":"[Security Solution] Failed to Fetch Rules and Timeline in Preview Flyout (#146904)\n\n## Summary\r\n\r\nThese changes fixes the issue with the unexpected \"Failed to Fetch Rule\"\r\nerror toast that appears when user opens the alert details from the Rule\r\nPreview page.\r\n\r\nThe issue was introduced by [recent\r\nrefactoring](#142950) where we\r\nswitched from the optional toast to showing error toast always when it\r\nis not possible to fetch the rule (see `useRuleWithFallback` hook). In\r\ncase of Rule Preview the rule does not exist and thus server returns 404\r\n(not found) error. In case of Rule Preview we would like to ignore this\r\nerror and build the rule from the alert.\r\n\r\nBug Ticket: #146858","sha":"1b4c66101b02dd4c01582a0e7b684eb5b499101a"}}]}] BACKPORT--> Co-authored-by: Ievgen Sorokopud <[email protected]>
- Loading branch information