-
Notifications
You must be signed in to change notification settings - Fork 916
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
Fixes broken app when management is turned off #4891
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,8 +71,15 @@ export const bootstrapUiActions = (uiActions: UiActionsSetup) => { | |
uiActions.registerTrigger(externalActionTrigger); | ||
uiActions.registerTrigger(pluginResourceDeleteTrigger); | ||
|
||
uiActions.addTriggerAction(EXTERNAL_ACTION_TRIGGER, openEventsFlyoutAction); | ||
uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, viewEventsOptionAction); | ||
uiActions.addTriggerAction(SAVED_OBJECT_DELETE_TRIGGER, savedObjectDeleteAction); | ||
uiActions.addTriggerAction(PLUGIN_RESOURCE_DELETE_TRIGGER, pluginResourceDeleteAction); | ||
uiActions.addTriggerAction(EXTERNAL_ACTION_TRIGGER, openEventsFlyoutAction); | ||
|
||
// These triggers are registered by other plugins. If they are disabled can throw an error. | ||
try { | ||
uiActions.addTriggerAction(CONTEXT_MENU_TRIGGER, viewEventsOptionAction); | ||
uiActions.addTriggerAction(SAVED_OBJECT_DELETE_TRIGGER, savedObjectDeleteAction); | ||
Comment on lines
+78
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't it be safer to wrap them individually? That way, a failure, due to one plugin being disabled, will not prevent other listeners from being added. Maybe even throw the triggers and the callbacks into an array and then loop through them and add the trigger, wrapped in a try-catch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah with the current behaviour this is fine. The context menu trigger comes from the embeddables plugin which is not something we disable (Dashboards would not work without it). So in theory the only real action that cannot be registered is the savedObject Management trigger, which is already the second action in the try block. |
||
} catch (e) { | ||
// eslint-disable-next-line no-console | ||
console.error(e); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.