Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Security Solution] Fix hanging rule creation page (elastic#201629
) (elastic#201852) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Fix hanging rule creation page (elastic#201629)](elastic#201629) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T18:10:46Z","message":"[Security Solution] Fix hanging rule creation page (elastic#201629)\n\n**Closes:** https://github.com/elastic/kibana/issues/201606\r\n\r\n## Summary\r\n\r\nThis PR fixes a bug introduced in elastic@06986e4 leading to hanging rule creation page after manipulation with EQL rule's query and alert suppression fields.\r\n\r\n## Details\r\n\r\nhttps://github.com/elastic/kibana/commit/06986e4a86a0fa3c3951fcb6b2ba34ebe2769820 add `usePersistentAlertSuppressionState()` hook to persist alert suppression state upon rule type change. It didn't take into account rule type change is a tricky process leading to multiple re-renders. In that case it easily can lead to a hanging page due to repeating updating form values leading to re-rendering.\r\n\r\nThe fix checks for the current and previous rule types to reset alert suppression form data only once upon rule type change.","sha":"9ddb459c7b6e9272b55b1a5b27b49108064ed5af","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","v9.0.0","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Rule Creation","Team:Detection Engine","backport:version","v8.17.0","v8.18.0"],"title":"[Security Solution] Fix hanging rule creation page","number":201629,"url":"https://github.com/elastic/kibana/pull/201629","mergeCommit":{"message":"[Security Solution] Fix hanging rule creation page (elastic#201629)\n\n**Closes:** https://github.com/elastic/kibana/issues/201606\r\n\r\n## Summary\r\n\r\nThis PR fixes a bug introduced in elastic@06986e4 leading to hanging rule creation page after manipulation with EQL rule's query and alert suppression fields.\r\n\r\n## Details\r\n\r\nhttps://github.com/elastic/kibana/commit/06986e4a86a0fa3c3951fcb6b2ba34ebe2769820 add `usePersistentAlertSuppressionState()` hook to persist alert suppression state upon rule type change. It didn't take into account rule type change is a tricky process leading to multiple re-renders. In that case it easily can lead to a hanging page due to repeating updating form values leading to re-rendering.\r\n\r\nThe fix checks for the current and previous rule types to reset alert suppression form data only once upon rule type change.","sha":"9ddb459c7b6e9272b55b1a5b27b49108064ed5af"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201629","number":201629,"mergeCommit":{"message":"[Security Solution] Fix hanging rule creation page (elastic#201629)\n\n**Closes:** https://github.com/elastic/kibana/issues/201606\r\n\r\n## Summary\r\n\r\nThis PR fixes a bug introduced in elastic@06986e4 leading to hanging rule creation page after manipulation with EQL rule's query and alert suppression fields.\r\n\r\n## Details\r\n\r\nhttps://github.com/elastic/kibana/commit/06986e4a86a0fa3c3951fcb6b2ba34ebe2769820 add `usePersistentAlertSuppressionState()` hook to persist alert suppression state upon rule type change. It didn't take into account rule type change is a tricky process leading to multiple re-renders. In that case it easily can lead to a hanging page due to repeating updating form values leading to re-rendering.\r\n\r\nThe fix checks for the current and previous rule types to reset alert suppression form data only once upon rule type change.","sha":"9ddb459c7b6e9272b55b1a5b27b49108064ed5af"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <[email protected]>
- Loading branch information