diff --git a/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts b/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts index 57cd1dab99..9e0302dccf 100644 --- a/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts @@ -7,7 +7,6 @@ */ import { DATA_CONTEXT_NAV_NODE, EMainMenu, MainMenuService } from '@cloudbeaver/core-app'; -import { AuthInfoService } from '@cloudbeaver/core-authentication'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, ConfirmationDialogDelete, DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { SideBarPanelService } from '@cloudbeaver/core-ui'; @@ -25,7 +24,6 @@ export class PluginBootstrap extends Bootstrap { private readonly resourceManagerService: ResourceManagerService, private readonly sideBarPanelService: SideBarPanelService, private readonly navResourceNodeService: NavResourceNodeService, - private readonly authInfoService: AuthInfoService, private readonly commonDialogService: CommonDialogService, private readonly actionService: ActionService, private readonly menuService: MenuService, @@ -41,7 +39,7 @@ export class PluginBootstrap extends Bootstrap { order: 3, type: 'checkbox', title: 'plugin_resource_manager_title', - isHidden: () => !this.resourceManagerService.enabled || !this.authInfoService.userInfo, + isHidden: () => !this.resourceManagerService.enabled, isChecked: () => this.resourceManagerService.panelEnabled, onClick: this.resourceManagerService.togglePanel, } @@ -51,9 +49,7 @@ export class PluginBootstrap extends Bootstrap { key: 'resource-manager-tab', order: 0, name: 'plugin_resource_manager_title', - isHidden: () => !this.resourceManagerService.enabled - || !this.resourceManagerService.panelEnabled - || !this.authInfoService.userInfo, + isHidden: () => !this.resourceManagerService.enabled || !this.resourceManagerService.panelEnabled, onClose: this.resourceManagerService.togglePanel, panel: () => ResourceManager, }); diff --git a/webapp/packages/plugin-resource-manager/src/ResourceManagerService.ts b/webapp/packages/plugin-resource-manager/src/ResourceManagerService.ts index c23b90a2d0..7870cd264a 100644 --- a/webapp/packages/plugin-resource-manager/src/ResourceManagerService.ts +++ b/webapp/packages/plugin-resource-manager/src/ResourceManagerService.ts @@ -8,6 +8,7 @@ import { computed, makeObservable, observable } from 'mobx'; +import { AuthInfoService } from '@cloudbeaver/core-authentication'; import { injectable } from '@cloudbeaver/core-di'; import { ResourceManagerSettingsService } from './ResourceManagerSettingsService'; @@ -15,13 +16,14 @@ import { ResourceManagerSettingsService } from './ResourceManagerSettingsService @injectable() export class ResourceManagerService { get enabled() { - return !this.resourceManagerSettingsService.settings.getValue('disabled'); + return !this.resourceManagerSettingsService.settings.getValue('disabled') && !!this.authInfoService.userInfo; } panelEnabled: boolean; constructor( - private readonly resourceManagerSettingsService: ResourceManagerSettingsService + private readonly resourceManagerSettingsService: ResourceManagerSettingsService, + private readonly authInfoService: AuthInfoService, ) { this.togglePanel = this.togglePanel.bind(this);