Skip to content

Commit

Permalink
Move security plugin from Plugin to Management section on left naviga…
Browse files Browse the repository at this point in the history
…tion menu (#1474)

* move security management section

Signed-off-by: Hailong Cui <[email protected]>

* Fix eslint

Signed-off-by: Hailong Cui <[email protected]>

* Remove plugins pages for management overview registration

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
Co-authored-by: Darshit Chanpura <[email protected]>
Co-authored-by: Craig Perkins <[email protected]>
  • Loading branch information
3 people authored Jun 29, 2023
1 parent e9f9576 commit c74973a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
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

0 comments on commit c74973a

Please sign in to comment.