Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MGMTEX] Fix action data override when adding a second action (elasti…
…c#181604) ## Summary We were overwriting the `actionTypeId` of the first action in the "create connector" callback. The value assigned was the `actionTypeId` of the newly created action, meaning that we would have converted the first action to be the same as the second one. This fix changes the `actionTypeId` not for the first option but for all current `activeActionItem.indices`. Previously, we did add that override to fix a bug related to the slack connector elastic#155722. Its test should cover us from breaking it back again. I did test it manually just in case and it seems to be working still. Feel free to test it too. Also, if you are wondering why `activeActionItems.indices` is an array of numbers. The user might be using the same connector in more than one action and then delete the connector. In case this happens, and the user clicks on "edit rule", they will be able to restore both actions by just creating the connector once. In order to be able to restore all affected actions, their index is being stored as a number[]. More info here elastic#86838 Closes elastic#181407 --------- Co-authored-by: Antonio <[email protected]>
- Loading branch information