Skip to content

Hide action types in action form that don't have actionParamsFields set#68171

Merged
mikecote merged 2 commits intoelastic:masterfrom
mikecote:alerting/hide-servicenow-jira
Jun 4, 2020
Merged

Hide action types in action form that don't have actionParamsFields set#68171
mikecote merged 2 commits intoelastic:masterfrom
mikecote:alerting/hide-servicenow-jira

Conversation

@mikecote
Copy link
Copy Markdown
Contributor

@mikecote mikecote commented Jun 3, 2020

Resolves #68001

In this PR, I'm removing action types that don't have actionParamsFields set from showing up as available in the action form due to not having fields to render in the form once selected. This will automatically hide Jira and ServiceNow because both don't have actionParamsFields set.

@mikecote mikecote added Feature:Alerting v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Actions Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v7.8.0 v7.9.0 labels Jun 3, 2020
@mikecote mikecote self-assigned this Jun 3, 2020
Copy link
Copy Markdown
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after fixing some unit tests.

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mikecote mikecote marked this pull request as ready for review June 4, 2020 14:32
@mikecote mikecote requested a review from a team as a code owner June 4, 2020 14:32
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@mikecote
Copy link
Copy Markdown
Contributor Author

mikecote commented Jun 4, 2020

Note: for testing this, you will need to set these inside your kibana.yml config:

xpack.lists.enabled: true
xpack.ingestManager.enabled: true

This enables the SIEM plugin which will register the ServiceNow and Jira action types.

Copy link
Copy Markdown
Contributor

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; code works as advertised

@pmuellr
Copy link
Copy Markdown
Contributor

pmuellr commented Jun 4, 2020

I'm curious about this mechanism. Guessing we see the SN and Jira action types from the actions plugin API, but then these actionParamsFields are only set when the action type is registered in a ui plugin, hence filtering them out.

From 10K feet, it seems like it's making use of some implementation detail, which seems not great, vs some more explicit / declarative approach. But fine for now. Maybe with the RBAC stuff coming it may make more sense to handle this kind of thing that way (but I'm thinking RBAC is for alerts and not really actions).

@mikecote
Copy link
Copy Markdown
Contributor Author

mikecote commented Jun 4, 2020

I'm curious about this mechanism. Guessing we see the SN and Jira action types from the actions plugin API, but then these actionParamsFields are only set when the action type is registered in a ui plugin, hence filtering them out.

The action types that aren't registered in the UI get filtered out on the line above the filter I added (https://github.com/elastic/kibana/blob/master/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/action_form.tsx#L549).

The ServiceNow and Jira have UI components registered (https://github.com/elastic/kibana/blob/master/x-pack/plugins/security_solution/public/common/lib/connectors/servicenow/index.tsx#L41-L46) but don't define an actionParamsFields value. Without this change, we render an empty form. Though, I'm surprised we support this 🤔 https://github.com/elastic/kibana/blob/master/x-pack/plugins/triggers_actions_ui/public/types.ts#L61-L63 in TypeScript.

@mikecote
Copy link
Copy Markdown
Contributor Author

mikecote commented Jun 4, 2020

A follow up issue #68311 has been opened in regards to what is discussed above.

@mikecote mikecote merged commit c8e6855 into elastic:master Jun 4, 2020
mikecote added a commit to mikecote/kibana that referenced this pull request Jun 4, 2020
…et (elastic#68171)

* Hide action types in alert flyout that don't have actionParamsFields set

* Fix jest tests
mikecote added a commit to mikecote/kibana that referenced this pull request Jun 4, 2020
…et (elastic#68171)

* Hide action types in alert flyout that don't have actionParamsFields set

* Fix jest tests
mikecote added a commit that referenced this pull request Jun 5, 2020
…et (#68171) (#68312)

* Hide action types in alert flyout that don't have actionParamsFields set

* Fix jest tests
mikecote added a commit that referenced this pull request Jun 8, 2020
…elds set (#68171) (#68313)

* Hide action types in action form that don't have actionParamsFields set (#68171)

* Hide action types in alert flyout that don't have actionParamsFields set

* Fix jest tests

* Fix tests to be compatible with 7.8

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Actions Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v7.8.0 v7.9.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide Jira and ServiceNow alert actions

5 participants