From ad7814ad7ad78d1dadee58d9d98b5e30df932646 Mon Sep 17 00:00:00 2001 From: Julia Date: Mon, 16 Oct 2023 11:29:49 +0200 Subject: [PATCH] [RAM] default value when have deleted slack connector attached to a rule (#168695) Solves: https://github.com/elastic/kibana/issues/168563 and https://github.com/elastic/kibana/issues/168027 ## Summary Should work like this: https://github.com/elastic/kibana/assets/26089545/10544c51-428a-4d31-af6c-bf1ae7df06d6 But worked like this: https://github.com/elastic/kibana/assets/26089545/9a171bcf-74ce-45be-af68-571a83615165 And warning message under the dropdown was replaced: From: Screenshot 2023-10-09 at 22 04 58 To: Screenshot 2023-10-12 at 14 29 38 - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit cde32938731d7cafd089e4665872609abd25c126) --- .../public/connector_types/slack/slack.tsx | 2 +- .../public/connector_types/slack_api/translations.ts | 2 +- .../action_connector_form/connectors_selection.tsx | 8 ++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx b/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx index 8fe351407ab92..95c35565e27b5 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/slack/slack.tsx @@ -39,7 +39,7 @@ export function getConnectorType(): ConnectorTypeModel> => { - let selectedConnector = connectors.find((connector) => connector.id === actionItemId); - if (allowGroupConnector.length > 0 && !selectedConnector) { - selectedConnector = connectors.find((connector) => - allowGroupConnector.includes(connector.actionTypeId) - ); - } + const selectedConnector = connectors.find((connector) => connector.id === actionItemId); + if (!selectedConnector) { return []; }