Skip to content

Commit

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

# Backport

This will backport the following commits from `main` to `8.11`:
- [[RAM] default value when have deleted slack connector attached to a
rule (#168695)](#168695)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Julia","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-16T09:29:49Z","message":"[RAM]
default value when have deleted slack connector attached to a rule
(#168695)\n\nSolves: #168563
and\r\nhttps://github.com//issues/168027\r\n\r\n##
Summary\r\n\r\nShould work like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/10544c51-428a-4d31-af6c-bf1ae7df06d6\r\n\r\nBut
worked like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/9a171bcf-74ce-45be-af68-571a83615165\r\n\r\n\r\nAnd
warning message under the dropdown was replaced:\r\nFrom:\r\n<img
width=\"568\" alt=\"Screenshot 2023-10-09 at 22 04
58\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/b183adf9-e7e6-4520-b212-236b4b581244\">\r\n\r\nTo:\r\n<img
width=\"469\" alt=\"Screenshot 2023-10-12 at 14 29
38\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/5defc4a5-4a68-463c-b40a-0b3b14ecb95a\">\r\n\r\n\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"cde32938731d7cafd089e4665872609abd25c126","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:fix","Team:ResponseOps","Feature:Alerting/RuleActions","v8.11.0","v8.12.0","v8.10.4"],"number":168695,"url":"https://github.com/elastic/kibana/pull/168695","mergeCommit":{"message":"[RAM]
default value when have deleted slack connector attached to a rule
(#168695)\n\nSolves: #168563
and\r\nhttps://github.com//issues/168027\r\n\r\n##
Summary\r\n\r\nShould work like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/10544c51-428a-4d31-af6c-bf1ae7df06d6\r\n\r\nBut
worked like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/9a171bcf-74ce-45be-af68-571a83615165\r\n\r\n\r\nAnd
warning message under the dropdown was replaced:\r\nFrom:\r\n<img
width=\"568\" alt=\"Screenshot 2023-10-09 at 22 04
58\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/b183adf9-e7e6-4520-b212-236b4b581244\">\r\n\r\nTo:\r\n<img
width=\"469\" alt=\"Screenshot 2023-10-12 at 14 29
38\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/5defc4a5-4a68-463c-b40a-0b3b14ecb95a\">\r\n\r\n\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"cde32938731d7cafd089e4665872609abd25c126"}},"sourceBranch":"main","suggestedTargetBranches":["8.11","8.10"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168695","number":168695,"mergeCommit":{"message":"[RAM]
default value when have deleted slack connector attached to a rule
(#168695)\n\nSolves: #168563
and\r\nhttps://github.com//issues/168027\r\n\r\n##
Summary\r\n\r\nShould work like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/10544c51-428a-4d31-af6c-bf1ae7df06d6\r\n\r\nBut
worked like
this:\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/26089545/9a171bcf-74ce-45be-af68-571a83615165\r\n\r\n\r\nAnd
warning message under the dropdown was replaced:\r\nFrom:\r\n<img
width=\"568\" alt=\"Screenshot 2023-10-09 at 22 04
58\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/b183adf9-e7e6-4520-b212-236b4b581244\">\r\n\r\nTo:\r\n<img
width=\"469\" alt=\"Screenshot 2023-10-12 at 14 29
38\"\r\nsrc=\"https://github.com/elastic/kibana/assets/26089545/5defc4a5-4a68-463c-b40a-0b3b14ecb95a\">\r\n\r\n\r\n-
[x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<[email protected]>","sha":"cde32938731d7cafd089e4665872609abd25c126"}},{"branch":"8.10","label":"v8.10.4","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia <[email protected]>
  • Loading branch information
kibanamachine and guskovaue authored Oct 16, 2023
1 parent 49249e3 commit 4e6acaf
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 4e6acaf

Please sign in to comment.