import { Bootstrap , injectable } from '@cloudbeaver/core-di' ; import { CommonDialogService } from '@cloudbeaver/core-dialogs' ; import { DATA_CONTEXT_MENU , MenuBaseItem , MenuService } from '@cloudbeaver/core-view' ; import { ServerConfigResource } from '@cloudbeaver/core-root' ; import { TOP_NAV_BAR_SETTINGS_MENU } from '@cloudbeaver/plugin-settings-menu' ; import { ProductInfoDialog } from './ProductInfoDialog' ; @ injectable ( ) export class ProductBootstrap extends Bootstrap { constructor ( private readonly serverConfigResource , private readonly commonDialogService , private readonly menuService ) { super ( ) ; } register ( ) { this . menuService . addCreator ( { isApplicable : ( context ) => { return context . get ( DATA_CONTEXT_MENU ) === TOP_NAV_BAR_SETTINGS_MENU && ! ! this . serverConfigResource . data ?. productInfo ; } , getItems : ( context , items ) => [ ... items , new MenuBaseItem ( 'productInfo' , 'app_product_info' , 'app_product_info' , { onSelect : ( ) => this . commonDialogService . open ( ProductInfoDialog , null ) } ) ] } ) ; } load ( ) { } }