Skip to content

Commit

Permalink
[RAM] default value when have deleted slack connector attached to a r…
Browse files Browse the repository at this point in the history
…ule (elastic#168695)

Solves: elastic#168563 and
elastic#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:
<img width="568" alt="Screenshot 2023-10-09 at 22 04 58"
src="https://github.com/elastic/kibana/assets/26089545/b183adf9-e7e6-4520-b212-236b4b581244">

To:
<img width="469" alt="Screenshot 2023-10-12 at 14 29 38"
src="https://github.com/elastic/kibana/assets/26089545/5defc4a5-4a68-463c-b40a-0b3b14ecb95a">

- [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 <[email protected]>
(cherry picked from commit cde3293)
  • Loading branch information
guskovaue committed Oct 16, 2023
1 parent 976088d commit ad7814a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function getConnectorType(): ConnectorTypeModel<unknown, SlackSecrets, Sl
defaultMessage: 'Send messages to Slack channels.',
}),
actionTypeTitle: i18n.translate('xpack.stackConnectors.components.slack.connectorTypeTitle', {
defaultMessage: 'Send to Slack',
defaultMessage: 'Slack',
}),
validateParams: async (
actionParams: SlackActionParams
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const SELECT_MESSAGE = i18n.translate(
export const ACTION_TYPE_TITLE = i18n.translate(
'xpack.stackConnectors.components.slack_api.connectorTypeTitle',
{
defaultMessage: 'Send to Slack',
defaultMessage: 'Slack',
}
);
export const ALLOWED_CHANNELS = i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,8 @@ const getValueOfSelectedConnector = (
actionTypeRegistered: ActionTypeModel,
allowGroupConnector: string[] = []
): Array<EuiComboBoxOptionOption<ConnectorOption>> => {
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 [];
}
Expand Down

0 comments on commit ad7814a

Please sign in to comment.