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

[Backport 2.x] Fixes broken app when management is turned off #4904

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
}
};
Loading