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 (#168695)

Solves: #168563 and
#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]>
  • Loading branch information
guskovaue and kibanamachine authored Oct 16, 2023
1 parent de13e23 commit cde3293
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});

// FLAKY: https://github.com/elastic/kibana/issues/168027
describe.skip('Edit rule with deleted connector', function () {
describe('Edit rule with deleted connector', function () {
const testRunUuid = uuidv4();

afterEach(async () => {
Expand Down

0 comments on commit cde3293

Please sign in to comment.