Skip to content

Commit

Permalink
fix: remove extra import
Browse files Browse the repository at this point in the history
Signed-off-by: tygao <tygao@amazon.com>
  • Loading branch information
raintygao committed Sep 12, 2023
1 parent d76effb commit c0da9a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 56 deletions.
55 changes: 2 additions & 53 deletions src/plugins/saved_objects_management/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,10 @@
*/

import { i18n } from '@osd/i18n';
import {
AppMountParameters,
CoreSetup,
CoreStart,
Plugin,
ChromeBreadcrumb,
ScopedHistory,
} from 'src/core/public';
import { AppMountParameters, CoreSetup, CoreStart, Plugin } from 'src/core/public';

import { VisBuilderStart } from '../../vis_builder/public';
import { ManagementSetup, ManagementAppMountParams } from '../../management/public';
import { ManagementSetup } from '../../management/public';
import { UiActionsSetup, UiActionsStart } from '../../ui_actions/public';
import { DataPublicPluginStart } from '../../data/public';
import { DashboardStart } from '../../dashboard/public';
Expand All @@ -65,18 +58,15 @@ import { bootstrap } from './ui_actions_bootstrap';
import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
import {
MANAGE_LIBRARY_TITLE_WORDINGS,
SAVED_OBJECT_MANAGEMENT_TITLE_WORDINGS,
SAVED_QUERIES_WORDINGS,
SAVED_SEARCHES_WORDINGS,
} from './constants';
import { reactRouterNavigate } from '../../opensearch_dashboards_react/public';

export interface SavedObjectsManagementPluginSetup {
actions: SavedObjectsManagementActionServiceSetup;
columns: SavedObjectsManagementColumnServiceSetup;
namespaces: SavedObjectsManagementNamespaceServiceSetup;
serviceRegistry: ISavedObjectsManagementServiceRegistry;
registerLibrarySubApp: () => void;
}

export interface SavedObjectsManagementPluginStart {
Expand Down Expand Up @@ -201,46 +191,6 @@ export class SavedObjectsManagementPlugin
});
}

core.application.register({
id: 'objects',
title: i18n.translate('savedObjectsManagement.managementSectionLabel', {
defaultMessage: 'Saved objects',
}),
category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
mount: async (params: AppMountParameters) => {
const { mountManagementSection } = await import('./management_section');
const [coreStart] = await core.getStartServices();

const setBreadcrumbsScope = (
crumbs: ChromeBreadcrumb[] = [],
appHistory?: ScopedHistory
) => {
const wrapBreadcrumb = (item: ChromeBreadcrumb, scopedHistory: ScopedHistory) => ({
...item,
...(item.href ? reactRouterNavigate(scopedHistory, item.href) : {}),
});

coreStart.chrome.setBreadcrumbs([
...crumbs.map((item) => wrapBreadcrumb(item, appHistory || params.history)),
]);
};

const managementParams: ManagementAppMountParams = {
element: params.element,
history: params.history,
setBreadcrumbs: setBreadcrumbsScope,
basePath: params.appBasePath,
};

return mountManagementSection({
core,
serviceRegistry: this.serviceRegistry,
mountParams: managementParams,
title: SAVED_OBJECT_MANAGEMENT_TITLE_WORDINGS,
});
},
});

// sets up the context mappings and registers any triggers/actions for the plugin
bootstrap(uiActions);

Expand All @@ -254,7 +204,6 @@ export class SavedObjectsManagementPlugin
columns: columnSetup,
namespaces: namespaceSetup,
serviceRegistry: this.serviceRegistry,
registerLibrarySubApp: () => {},
};
}

Expand Down
3 changes: 0 additions & 3 deletions src/plugins/workspace/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ export class WorkspacePlugin implements Plugin<{}, {}, WorkspacePluginSetupDeps>
*/
savedObjectsManagement?.columns.register(getWorkspaceColumn(core));

// register apps for library object management
savedObjectsManagement?.registerLibrarySubApp();

type WorkspaceAppType = (params: AppMountParameters, services: Services) => () => void;
const mountWorkspaceApp = async (params: AppMountParameters, renderApp: WorkspaceAppType) => {
const [coreStart] = await core.getStartServices();
Expand Down

0 comments on commit c0da9a1

Please sign in to comment.