diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d41aaba9994..56108ee0acbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [TSVB, Dashboards] Fix inconsistent dark mode code editor themes ([#4609](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4609)) - [Legacy Maps] Fix dark mode style overrides ([#4658](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4658)) - [BUG] Fix management overview page duplicate rendering ([#4636](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4636)) +- Fixes broken app when management is turned off ([#4891](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4891)) ### 🚞 Infrastructure diff --git a/src/core/types/capabilities.ts b/src/core/types/capabilities.ts index a4d4b59b2a4e..d964cd75b997 100644 --- a/src/core/types/capabilities.ts +++ b/src/core/types/capabilities.ts @@ -47,6 +47,6 @@ export interface Capabilities { /** Catalogue capabilities. Catalogue entries drive the visibility of the OpenSearch Dashboards homepage options. */ catalogue: Record; - /** Custom capabilities, registered by plugins. */ - [key: string]: Record>; + /** Custom capabilities, registered by plugins. undefined if the key does not exist */ + [key: string]: Record> | undefined; } diff --git a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_footer/overview_page_footer.tsx b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_footer/overview_page_footer.tsx index ffa1205a9661..523ade66a1a4 100644 --- a/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_footer/overview_page_footer.tsx +++ b/src/plugins/opensearch_dashboards_react/public/overview_page/overview_page_footer/overview_page_footer.tsx @@ -52,7 +52,8 @@ export const OverviewPageFooter: FC = ({ addBasePath, path }) => { }, } = useOpenSearchDashboards(); - const { show, save } = application.capabilities.advancedSettings; + const { show, save } = application.capabilities.advancedSettings ?? {}; + const isAdvancedSettingsEnabled = show && save; const defaultRoutebutton = diff --git a/src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts b/src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts index 27bd6284e71b..02160f01793d 100644 --- a/src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts +++ b/src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts @@ -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); + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } };