mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
* dbeaver/pro#6744 fix: elements order * fix: fixate position of elements --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
/*
|
|
* CloudBeaver - Cloud Database Manager
|
|
* Copyright (C) 2020-2025 DBeaver Corp and others
|
|
*
|
|
* Licensed under the Apache License, Version 2.0.
|
|
* you may not use this file except in compliance with the License.
|
|
*/
|
|
|
|
import { AppScreenService } from '@cloudbeaver/core-app';
|
|
import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
|
import { MenuService } from '@cloudbeaver/core-view';
|
|
import { MENU_APP_ACTIONS } from '@cloudbeaver/plugin-top-app-bar';
|
|
import { importLazyComponent } from '@cloudbeaver/core-blocks';
|
|
|
|
import { MENU_TOOLS } from './Menu/MENU_TOOLS.js';
|
|
import { ToolsPanelService } from './ToolsPanel/ToolsPanelService.js';
|
|
|
|
const ToolsPanel = importLazyComponent(() => import('./ToolsPanel/ToolsPanel.js').then(module => module.ToolsPanel));
|
|
|
|
@injectable(() => [AppScreenService, MenuService, ToolsPanelService])
|
|
export class PluginBootstrap extends Bootstrap {
|
|
constructor(
|
|
private readonly appScreenService: AppScreenService,
|
|
private readonly menuService: MenuService,
|
|
private readonly toolsPanelService: ToolsPanelService,
|
|
) {
|
|
super();
|
|
}
|
|
|
|
override register(): void {
|
|
this.appScreenService.rightAreaBottom.add(
|
|
ToolsPanel,
|
|
undefined,
|
|
() => this.toolsPanelService.disabled || this.toolsPanelService.tabsContainer.getDisplayed().length === 0,
|
|
);
|
|
this.menuService.addCreator({
|
|
menus: [MENU_APP_ACTIONS],
|
|
getItems: (context, items) => [...items, MENU_TOOLS],
|
|
});
|
|
this.menuService.setHandler({
|
|
id: 'tools-menu-base',
|
|
menus: [MENU_TOOLS],
|
|
isLabelVisible: () => false,
|
|
isHidden: () => this.toolsPanelService.disabled,
|
|
});
|
|
}
|
|
}
|