[8.17] [ResponseOps][Rules] Do not show connector not registered in action connectors modal (#212660) (#212778)

# Backport

This will backport the following commits from `main` to `8.17`:
- [[ResponseOps][Rules] Do not show connector not registered in action
connectors modal
(#212660)](https://github.com/elastic/kibana/pull/212660)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Janki
Salvi","email":"117571355+js-jankisalvi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-28T13:56:35Z","message":"[ResponseOps][Rules]
Do not show connector not registered in action connectors modal
(#212660)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/212584\nResolves
https://github.com/elastic/kibana/issues/207185\n\n<img width=\"1917\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0b50f829-60a2-435e-9b76-74231d0bb54c\"\n/>\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\n- [x]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"83f787ac24184b87a3a0f6d41380577666faeb42","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","Feature:Alerting/RulesManagement","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.3","v8.16.5"],"title":"[ResponseOps][Rules]
Do not show connector not registered in action connectors
modal","number":212660,"url":"https://github.com/elastic/kibana/pull/212660","mergeCommit":{"message":"[ResponseOps][Rules]
Do not show connector not registered in action connectors modal
(#212660)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/212584\nResolves
https://github.com/elastic/kibana/issues/207185\n\n<img width=\"1917\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0b50f829-60a2-435e-9b76-74231d0bb54c\"\n/>\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\n- [x]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"83f787ac24184b87a3a0f6d41380577666faeb42"}},"sourceBranch":"main","suggestedTargetBranches":["8.17","8.16"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212775","number":212775,"state":"OPEN"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212773","number":212773,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212660","number":212660,"mergeCommit":{"message":"[ResponseOps][Rules]
Do not show connector not registered in action connectors modal
(#212660)\n\n## Summary\n\nResolves
https://github.com/elastic/kibana/issues/212584\nResolves
https://github.com/elastic/kibana/issues/207185\n\n<img width=\"1917\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/0b50f829-60a2-435e-9b76-74231d0bb54c\"\n/>\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\n- [x]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"83f787ac24184b87a3a0f6d41380577666faeb42"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/212774","number":212774,"state":"OPEN"},{"branch":"8.17","label":"v8.17.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
This commit is contained in:
Janki Salvi 2025-02-28 16:13:03 +00:00 committed by GitHub
parent faabb4e47a
commit 9415fc950d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,13 +73,18 @@ export const RuleActionsConnectorsModal = (props: RuleActionsConnectorsModalProp
const availableConnectors = useMemo(() => {
return connectors.filter(({ actionTypeId }) => {
const actionType = connectorTypes.find(({ id }) => id === actionTypeId);
if (!actionTypeRegistry.has(actionTypeId)) {
return false;
}
const actionTypeModel = actionTypeRegistry.get(actionTypeId);
if (!actionType) {
return false;
}
if (!actionTypeModel.actionParamsFields) {
if (!actionTypeModel?.actionParamsFields) {
return false;
}