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] Move security plugin from Plugin to Management section on left navigation menu #1495

Merged
merged 1 commit into from
Jun 29, 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
5 changes: 4 additions & 1 deletion opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"navigation",
"savedObjectsManagement"
],
"optionalPlugins": [
"managementOverview"
],
"server": true,
"ui": true
}
}
24 changes: 17 additions & 7 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@

import { BehaviorSubject } from 'rxjs';
import { SavedObjectsManagementColumn } from 'src/plugins/saved_objects_management/public';
import { i18n } from '@osd/i18n';
import {
AppMountParameters,
AppStatus,
AppUpdater,
CoreSetup,
CoreStart,
DEFAULT_APP_CATEGORIES,
Plugin,
PluginInitializerContext,
} from '../../../src/core/public';
import { APP_ID_LOGIN, CUSTOM_ERROR_PAGE_URI, LOGIN_PAGE_URI, PLUGIN_NAME } from '../common';
import { APP_ID_CUSTOMERROR } from '../common/index';
import { APP_ID_CUSTOMERROR } from '../common';
import { setupTopNavButton } from './apps/account/account-app';
import { fetchAccountInfoSafe } from './apps/account/utils';
import {
Expand Down Expand Up @@ -98,7 +100,7 @@ export class SecurityPlugin
core.application.register({
id: PLUGIN_NAME,
title: 'Security',
order: 8000,
order: 9050,
mount: async (params: AppMountParameters) => {
const { renderApp } = await import('./apps/configuration/configuration-app');
const [coreStart, depsStart] = await core.getStartServices();
Expand All @@ -112,12 +114,20 @@ export class SecurityPlugin

return renderApp(coreStart, depsStart as SecurityPluginStartDependencies, params, config);
},
category: {
id: 'opensearch',
label: 'OpenSearch Plugins',
order: 2000,
},
category: DEFAULT_APP_CATEGORIES.management,
});

if (deps.managementOverview) {
deps.managementOverview.register({
id: PLUGIN_NAME,
title: 'Security',
order: 9050,
description: i18n.translate('security.securityDescription', {
defaultMessage:
'Configure how users access data in OpenSearch with authentication, access control and audit logging.',
}),
});
}
}

core.application.register({
Expand Down
2 changes: 2 additions & 0 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
SavedObjectsManagementPluginSetup,
SavedObjectsManagementPluginStart,
} from '../../../src/plugins/saved_objects_management/public';
import { ManagementOverViewPluginSetup } from '../../../src/plugins/management_overview/public';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface SecurityPluginSetup {}
Expand All @@ -26,6 +27,7 @@ export interface SecurityPluginStart {}

export interface SecurityPluginSetupDependencies {
savedObjectsManagement: SavedObjectsManagementPluginSetup;
managementOverview?: ManagementOverViewPluginSetup;
}

export interface SecurityPluginStartDependencies {
Expand Down