Skip to content

Commit

Permalink
Fixes broken app when management is turned off (#4891)
Browse files Browse the repository at this point in the history
* fixes broken app when management is turned off

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

* updates changelog

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>

---------

Signed-off-by: Ashwin P Chandran <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Sep 1, 2023
1 parent d590df6 commit 1068939
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/core/types/capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ export interface Capabilities {
/** Catalogue capabilities. Catalogue entries drive the visibility of the OpenSearch Dashboards homepage options. */
catalogue: Record<string, boolean>;

/** Custom capabilities, registered by plugins. */
[key: string]: Record<string, boolean | Record<string, boolean>>;
/** Custom capabilities, registered by plugins. undefined if the key does not exist */
[key: string]: Record<string, boolean | Record<string, boolean>> | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export const OverviewPageFooter: FC<Props> = ({ addBasePath, path }) => {
},
} = useOpenSearchDashboards<CoreStart>();

const { show, save } = application.capabilities.advancedSettings;
const { show, save } = application.capabilities.advancedSettings ?? {};

const isAdvancedSettingsEnabled = show && save;

const defaultRoutebutton =
Expand Down
13 changes: 10 additions & 3 deletions src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit 1068939

Please sign in to comment.