Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RO] Incorrect Deletion of Webhook Actions in Kibana Rules (#159204)
## Summary Fixes #158167 The issue occurred because we were using a number called "index" as the React key prop. When we removed the first element, the second one took its place, but React still showed the removed element. To fix this problem, we found a solution by using the uuid field that each action item has. We now generate it for each new action we create in the action form and use that as key I was told to add @pmuellr as you might know if we are missing something 🙇 ### Test: why xpath selector? I had to use the xpath selector to fix a problem we had. The problem was between two actions we set up. They look the same, but the body content is the only different (I've attached a screenshot for more details). We use a third party component for these actions. This component doesn't have any "value" attribute and doesn't add anything besides the HTML text. I tried to find other useful details but couldn't find any. The problem comes up when we try to delete one of the actions. To fix it, we needed to check if that component was missing. We already have tools that can look for missing components, but they don't work with the xpath selector. So, I added a new function that can do this. Now, we can use the xpath selector to look for missing components and fix the problem <details> <summary>See Screenshot</summary> <img src="https://github.com/elastic/kibana/assets/17549662/5447795d-0281-4847-aa85-76d0e5fdec3d"/> </details> ```[tasklist] - [x] Make sure that it's ok to generate the uuid - [x] Test - [x] Do we need to backport? Versions? ```
- Loading branch information