Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Alerting UI] Replace some of ui plugin dependencies with KibanaContextProvider #65146

Closed
YulNaumenko opened this issue May 4, 2020 · 4 comments · Fixed by #83248
Closed
Assignees
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)

Comments

@YulNaumenko
Copy link
Contributor

Currently we have a bunch of plugin dependencies included to AppContextProvider. It could be replaced with KibanaContextProvider:
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';

Also some of this dependencies could be removed from ActionsContextProvider and AlertsContextProvider, because all of plugins which embedding Alerts and Actions UI also use KibanaContextProvider.

@YulNaumenko YulNaumenko added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) labels May 4, 2020
@elasticmachine
Copy link
Contributor

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

@mikecote
Copy link
Contributor

mikecote commented Oct 2, 2020

Duplicate issue with more information #78911 (closed as duplicate).

@mikecote mikecote changed the title [Alerting UI] Replace some of ui plugin dependancies with KibanaContextProvider [Alerting UI] Replace some of ui plugin dependencies with KibanaContextProvider Oct 20, 2020
@mikecote
Copy link
Contributor

NOTE: It could be worth investigating some start plugin APIs that return flyouts for other plugins to use (ex: getCreateAlertFlyout({..}). That way they don't have to pass in all the dependencies our plugins already have and require code directly from our plugins.

@cnasikas
Copy link
Member

cnasikas commented Nov 11, 2020

Hi @mikecote @YulNaumenko!

Cases would love to have this functionality for 7.11. I am creating the Alerts UI for the case connector and I need to use this component. The component uses the notification service. It gets it as const { http, notifications } = useKibana().services;. If I register my action type (plugins.triggersActionsUi.actionTypeRegistry.register(getCaseConnectorUI())) the service is not there. This is happening because the triggers_actions_ui plugin uses its own provider (AppContextProvider) and not the KibanaContextProvider.

Cases would need the notifications and http services.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams)
Projects
None yet
5 participants