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>
(cherry picked from commit 1068939)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
github-actions[bot] committed Sep 1, 2023
1 parent a47e612 commit bdb86e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
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);

Check warning on line 75 in src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts#L75

Added line #L75 was not covered by tests

// 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);

Check warning on line 80 in src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts#L78-L80

Added lines #L78 - L80 were not covered by tests
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);

Check warning on line 83 in src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/vis_augmenter/public/ui_actions_bootstrap.ts#L83

Added line #L83 was not covered by tests
}
};

0 comments on commit bdb86e0

Please sign in to comment.