From c74973af03efa8b1139864b3779c63450a64e585 Mon Sep 17 00:00:00 2001 From: Hailong Cui Date: Thu, 29 Jun 2023 21:45:56 +0800 Subject: [PATCH] Move security plugin from Plugin to Management section on left navigation menu (#1474) * move security management section Signed-off-by: Hailong Cui * Fix eslint Signed-off-by: Hailong Cui * Remove plugins pages for management overview registration Signed-off-by: Hailong Cui --------- Signed-off-by: Hailong Cui Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com> Co-authored-by: Craig Perkins --- opensearch_dashboards.json | 5 ++++- public/plugin.ts | 24 +++++++++++++++++------- public/types.ts | 2 ++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 42e148cb1..c5d7cac43 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -9,6 +9,9 @@ "navigation", "savedObjectsManagement" ], + "optionalPlugins": [ + "managementOverview" + ], "server": true, "ui": true -} \ No newline at end of file +} diff --git a/public/plugin.ts b/public/plugin.ts index 991c00834..7ac039fb1 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -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 { @@ -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(); @@ -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({ diff --git a/public/types.ts b/public/types.ts index 5e5a904f5..7169b893a 100644 --- a/public/types.ts +++ b/public/types.ts @@ -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 {} @@ -26,6 +27,7 @@ export interface SecurityPluginStart {} export interface SecurityPluginSetupDependencies { savedObjectsManagement: SavedObjectsManagementPluginSetup; + managementOverview?: ManagementOverViewPluginSetup; } export interface SecurityPluginStartDependencies {