diff --git a/webapp/packages/core-app/package.json b/webapp/packages/core-app/package.json index 7915bf8247..917855a652 100644 --- a/webapp/packages/core-app/package.json +++ b/webapp/packages/core-app/package.json @@ -32,6 +32,10 @@ "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", "@cloudbeaver/core-executor": "~0.1.0", + "@cloudbeaver/plugin-tools-panel": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-navigation-tree": "~0.1.0", "@cloudbeaver/plugin-sql-editor": "~0.1.0", "@cloudbeaver/plugin-sql-editor-navigation-tab": "~0.1.0", diff --git a/webapp/packages/core-app/src/AppLocaleService.ts b/webapp/packages/core-app/src/AppLocaleService.ts index 8a36d568f0..1be8341b7f 100644 --- a/webapp/packages/core-app/src/AppLocaleService.ts +++ b/webapp/packages/core-app/src/AppLocaleService.ts @@ -11,7 +11,7 @@ import { LocalizationService } from '@cloudbeaver/core-localization'; @injectable() export class AppLocaleService extends Bootstrap { - constructor(private localizationService: LocalizationService) { + constructor(private readonly localizationService: LocalizationService) { super(); } diff --git a/webapp/packages/core-app/src/AppScreen/AppScreen.tsx b/webapp/packages/core-app/src/AppScreen/AppScreen.tsx index 6a1fd43a53..ecd42da6b1 100644 --- a/webapp/packages/core-app/src/AppScreen/AppScreen.tsx +++ b/webapp/packages/core-app/src/AppScreen/AppScreen.tsx @@ -6,12 +6,18 @@ * you may not use this file except in compliance with the License. */ -import { TopNavBar } from '../TopNavBar/TopNavBar'; +import { Placeholder } from '@cloudbeaver/core-blocks'; +import { useService } from '@cloudbeaver/core-di'; +import { TopNavBar } from '@cloudbeaver/plugin-top-app-bar'; + +import { AppScreenService } from './AppScreenService'; import { Main } from './Main'; export function AppScreen() { + const appScreenService = useService(AppScreenService); return ( <> +
diff --git a/webapp/packages/core-app/src/AppScreen/AppScreenBootstrap.ts b/webapp/packages/core-app/src/AppScreen/AppScreenBootstrap.ts new file mode 100644 index 0000000000..4ecdf94db1 --- /dev/null +++ b/webapp/packages/core-app/src/AppScreen/AppScreenBootstrap.ts @@ -0,0 +1,38 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { injectable, Bootstrap } from '@cloudbeaver/core-di'; +import { Executor, IExecutor } from '@cloudbeaver/core-executor'; +import { ScreenService } from '@cloudbeaver/core-routing'; + +import { AppScreen } from './AppScreen'; + +@injectable() +export class AppScreenBootstrap extends Bootstrap { + static screenName = 'app'; + readonly activation: IExecutor; + + constructor( + private readonly screenService: ScreenService + ) { + super(); + this.activation = new Executor(); + } + + register(): void { + this.screenService.create({ + name: AppScreenBootstrap.screenName, + routes: [{ name: AppScreenBootstrap.screenName, path: '/' }], + component: AppScreen, + root: true, + onActivate: async () => { await this.activation.execute(); }, + }); + } + + load(): void | Promise { } +} diff --git a/webapp/packages/core-app/src/AppScreen/AppScreenService.ts b/webapp/packages/core-app/src/AppScreen/AppScreenService.ts index 61a11236b1..041176cd58 100644 --- a/webapp/packages/core-app/src/AppScreen/AppScreenService.ts +++ b/webapp/packages/core-app/src/AppScreen/AppScreenService.ts @@ -6,33 +6,15 @@ * you may not use this file except in compliance with the License. */ -import { injectable, Bootstrap } from '@cloudbeaver/core-di'; -import { Executor, IExecutor } from '@cloudbeaver/core-executor'; -import { ScreenService } from '@cloudbeaver/core-routing'; +import { PlaceholderContainer } from '@cloudbeaver/core-blocks'; +import { injectable } from '@cloudbeaver/core-di'; -import { AppScreen } from './AppScreen'; @injectable() -export class AppScreenService extends Bootstrap { - static screenName = 'app'; - readonly activation: IExecutor; +export class AppScreenService { + readonly placeholder: PlaceholderContainer; - constructor( - private screenService: ScreenService - ) { - super(); - this.activation = new Executor(); + constructor() { + this.placeholder = new PlaceholderContainer(); } - - register(): void { - this.screenService.create({ - name: AppScreenService.screenName, - routes: [{ name: AppScreenService.screenName, path: '/' }], - component: AppScreen, - root: true, - onActivate: async () => { await this.activation.execute(); }, - }); - } - - load(): void | Promise { } } diff --git a/webapp/packages/core-app/src/AppScreen/RightArea.tsx b/webapp/packages/core-app/src/AppScreen/RightArea.tsx index 53b20fd5db..652c3a7315 100644 --- a/webapp/packages/core-app/src/AppScreen/RightArea.tsx +++ b/webapp/packages/core-app/src/AppScreen/RightArea.tsx @@ -25,10 +25,8 @@ import { import { useService } from '@cloudbeaver/core-di'; import { useStyles } from '@cloudbeaver/core-theming'; import { OptionsPanelService } from '@cloudbeaver/core-ui'; - -import { NavigationTabsBar } from '../shared/NavigationTabs/NavigationTabsBar'; -import { ToolsPanel } from '../shared/ToolsPanel/ToolsPanel'; -import { ToolsPanelService } from '../shared/ToolsPanel/ToolsPanelService'; +import { NavigationTabsBar } from '@cloudbeaver/plugin-navigation-tabs'; +import { ToolsPanelService, ToolsPanel } from '@cloudbeaver/plugin-tools-panel'; const styles = css` Pane { diff --git a/webapp/packages/core-app/src/Body.tsx b/webapp/packages/core-app/src/Body.tsx index aa7d7d8898..fd813c238c 100644 --- a/webapp/packages/core-app/src/Body.tsx +++ b/webapp/packages/core-app/src/Body.tsx @@ -18,8 +18,7 @@ import { SessionPermissionsResource } from '@cloudbeaver/core-root'; import { ScreenService } from '@cloudbeaver/core-routing'; import { ThemeService, useStyles } from '@cloudbeaver/core-theming'; import { DNDProvider } from '@cloudbeaver/core-ui'; - -import { useAppVersion } from './useAppVersion'; +import { useAppVersion } from '@cloudbeaver/plugin-version'; const bodyStyles = css` theme { diff --git a/webapp/packages/core-app/src/index.ts b/webapp/packages/core-app/src/index.ts index 67c961a9bb..f27293437d 100644 --- a/webapp/packages/core-app/src/index.ts +++ b/webapp/packages/core-app/src/index.ts @@ -1,35 +1,12 @@ // Services export * from './CoreSettingsService'; export * from './AppScreen/AppScreenService'; -export * from './TopNavBar/MainMenu/MainMenuService'; -export * from './TopNavBar/shared/TopNavButton'; -export * from './TopNavBar/TopNavBarService'; -export * from './TopNavBar/AdministrationTopAppBarBootstrapService'; -export * from './TopNavBar/shared/topMenuStyles'; -export * from './shared/NavigationTabs/NavigationTabsService'; -export * from './shared/SqlGenerators/SqlGeneratorsResource'; -export * from './shared/SqlGenerators/SqlGeneratorsBootstrap'; -export * from './shared/NavigationTabs/TabNavigationContext'; -export * from './shared/ToolsPanel/ToolsPanelService'; - -export * from './shared/SessionExpireDialog/SessionExpiredDialogService'; -export * from './shared/SessionExpireWarningDialog/SessionExpireWarningDialogService'; +export * from './AppScreen/AppScreenBootstrap'; export * from './AppLocaleService'; -export * from './QuotasService'; - -// Models -export * from './shared/NavigationTabs/ITab'; -export * from './shared/NavigationTabs/TabHandler'; - -// hooks -export * from './shared/NavigationTabs/NavigationTabsBar/Tabs/useTab'; -export * from './shared/InlineEditor/InlineEditor'; -export * from './useAppVersion'; // components export * from './Body'; -export * from './TopNavBar/Logo'; // Interfaces export * from './manifest'; \ No newline at end of file diff --git a/webapp/packages/core-app/src/manifest.ts b/webapp/packages/core-app/src/manifest.ts index 75dba8f837..46e019e336 100644 --- a/webapp/packages/core-app/src/manifest.ts +++ b/webapp/packages/core-app/src/manifest.ts @@ -9,18 +9,9 @@ import type { PluginManifest } from '@cloudbeaver/core-di'; import { AppLocaleService } from './AppLocaleService'; +import { AppScreenBootstrap } from './AppScreen/AppScreenBootstrap'; import { AppScreenService } from './AppScreen/AppScreenService'; import { CoreSettingsService } from './CoreSettingsService'; -import { QuotasService } from './QuotasService'; -import { NavigationTabsService } from './shared/NavigationTabs/NavigationTabsService'; -import { SessionExpiredDialogService } from './shared/SessionExpireDialog/SessionExpiredDialogService'; -import { SessionExpireWarningDialogService } from './shared/SessionExpireWarningDialog/SessionExpireWarningDialogService'; -import { SqlGeneratorsBootstrap } from './shared/SqlGenerators/SqlGeneratorsBootstrap'; -import { SqlGeneratorsResource } from './shared/SqlGenerators/SqlGeneratorsResource'; -import { ToolsPanelService } from './shared/ToolsPanel/ToolsPanelService'; -import { AdministrationTopAppBarBootstrapService } from './TopNavBar/AdministrationTopAppBarBootstrapService'; -import { MainMenuService } from './TopNavBar/MainMenu/MainMenuService'; -import { TopNavService } from './TopNavBar/TopNavBarService'; export const coreAppManifest: PluginManifest = { @@ -29,18 +20,9 @@ export const coreAppManifest: PluginManifest = { }, providers: [ - MainMenuService, - SqlGeneratorsBootstrap, - SqlGeneratorsResource, - NavigationTabsService, - TopNavService, AppScreenService, + AppScreenBootstrap, CoreSettingsService, - AdministrationTopAppBarBootstrapService, AppLocaleService, - SessionExpiredDialogService, - SessionExpireWarningDialogService, - ToolsPanelService, - QuotasService, ], }; diff --git a/webapp/packages/core-blocks/src/Placeholder/PlaceholderContainer.ts b/webapp/packages/core-blocks/src/Placeholder/PlaceholderContainer.ts index 5331ab2b1a..1fb4707f24 100644 --- a/webapp/packages/core-blocks/src/Placeholder/PlaceholderContainer.ts +++ b/webapp/packages/core-blocks/src/Placeholder/PlaceholderContainer.ts @@ -19,7 +19,7 @@ export interface PlaceholderElement = Record = Record> { - private placeholders = observable>([], { deep: false }); + private readonly placeholders = observable>([], { deep: false }); get(): Array> { return this.placeholders; diff --git a/webapp/packages/core-root/mocks/data/defaultProductConfiguration.ts b/webapp/packages/core-root/mocks/data/defaultProductConfiguration.ts new file mode 100644 index 0000000000..85943c46d4 --- /dev/null +++ b/webapp/packages/core-root/mocks/data/defaultProductConfiguration.ts @@ -0,0 +1,36 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0. + * you may not use this file except in compliance with the License. + */ + +export const defaultProductConfiguration: Record = { + 'core_events': { + 'notificationsPool': 5.0, + }, + 'core': { + 'user': { + 'defaultTheme': 'light', + 'defaultLanguage': 'en', + }, + 'app': { + 'logViewer': { + 'refreshTimeout': 3000.0, + 'logBatchSize': 1000.0, + 'maxLogRecords': 2000.0, + 'maxFailedRequests': 3.0, + }, + }, + 'authentication': { + 'primaryAuthProvider': 'local', + }, + }, + 'plugin_data_export': { + 'disabled': false, + }, + 'plugin_data_spreadsheet_new': { + 'hidden': false, + }, +}; \ No newline at end of file diff --git a/webapp/packages/core-root/mocks/data/defaultServerConfig.ts b/webapp/packages/core-root/mocks/data/defaultServerConfig.ts new file mode 100644 index 0000000000..3855e6dbda --- /dev/null +++ b/webapp/packages/core-root/mocks/data/defaultServerConfig.ts @@ -0,0 +1,125 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { ServerConfigQuery } from '@cloudbeaver/core-sdk'; + +import { defaultProductConfiguration } from './defaultProductConfiguration'; + +export const defaultServerConfig: (productConfiguration?: Record) => ServerConfigQuery = ( + productConfiguration = defaultProductConfiguration +) => ({ + 'serverConfig': { + 'name': 'CloudBeaver CE Server', + 'version': '22.1.2.202207140640', + 'workspaceId': 'D14DGNGYNPI71M', + 'serverURL': 'https://test.ce.cloudbeaver.io', + 'rootURI': '/', + 'hostName': '931cdabfc0b3', + 'productConfiguration': productConfiguration, + 'supportsCustomConnections': true, + 'supportsConnectionBrowser': false, + 'supportsWorkspaces': false, + 'sessionExpireTime': 6000000, + 'anonymousAccessEnabled': true, + 'adminCredentialsSaveEnabled': true, + 'publicCredentialsSaveEnabled': true, + 'resourceManagerEnabled': true, + 'licenseRequired': false, + 'licenseValid': false, + 'configurationMode': false, + 'developmentMode': false, + 'redirectOnFederatedAuth': false, + 'enabledFeatures': [], + 'enabledAuthProviders': [ + 'local', + ], + 'supportedLanguages': [ + { + 'isoCode': 'en', + 'displayName': 'English', + 'nativeName': 'English', + }, + { + 'isoCode': 'zh', + 'displayName': 'Simplified chinese', + 'nativeName': '简体中文', + }, + { + 'isoCode': 'ru', + 'displayName': 'Russian', + 'nativeName': 'Русский', + }, + { + 'isoCode': 'fr', + 'displayName': 'French', + 'nativeName': 'Français', + }, + { + 'isoCode': 'de', + 'displayName': 'German', + 'nativeName': 'Deutsch', + }, + { + 'isoCode': 'it', + 'displayName': 'Italian', + 'nativeName': 'Italiano', + }, + { + 'isoCode': 'ja', + 'displayName': 'Japanese', + 'nativeName': 'Japanese', + }, + { + 'isoCode': 'es', + 'displayName': 'Spanish', + 'nativeName': 'Spanish', + }, + { + 'isoCode': 'pt_BR', + 'displayName': 'Portuguese (BR)', + 'nativeName': 'Português Brasil', + }, + { + 'isoCode': 'ko', + 'displayName': 'Korean', + 'nativeName': '한국어', + }, + { + 'isoCode': 'tw', + 'displayName': 'Traditional chinese', + 'nativeName': '繁体中文', + }, + ], + 'defaultNavigatorSettings': { + 'showSystemObjects': true, + 'showUtilityObjects': false, + 'showOnlyEntities': false, + 'mergeEntities': false, + 'hideFolders': false, + 'hideSchemas': false, + 'hideVirtualModel': false, + }, + 'resourceQuotas': { + 'dataExportFileSizeLimit': 1.0E7, + 'sqlMaxRunningQueries': 3.0, + 'sqlResultSetRowsLimit': 100000.0, + 'sqlResultSetMemoryLimit': 2000000.0, + }, + 'disabledDrivers': [], + 'productInfo': { + 'id': 'io.cloudbeaver.product.ce.product', + 'version': '22.1.2.202207140640', + 'latestVersionInfo': 'https://cloudbeaver.io/product/cloudbeaver-ce-version.json', + 'name': 'CloudBeaver CE Server', + 'description': 'Cloudbeaver Web UI Application', + 'buildTime': 'July 14, 2022', + 'releaseTime': 'July 11, 2022', + 'licenseInfo': '', + }, + }, +}); \ No newline at end of file diff --git a/webapp/packages/core-root/mocks/mockAppInit.ts b/webapp/packages/core-root/mocks/mockAppInit.ts index 0cf2352678..7f993a4052 100644 --- a/webapp/packages/core-root/mocks/mockAppInit.ts +++ b/webapp/packages/core-root/mocks/mockAppInit.ts @@ -11,9 +11,9 @@ import type { graphql } from 'msw'; import { mockOpenSession } from './resolvers/mockOpenSession'; import { mockServerConfig } from './resolvers/mockServerConfig'; -export function mockAppInit(endpoint: ReturnType) { +export function mockAppInit(endpoint: ReturnType, productConfiguration?: Record) { return [ - endpoint.query('serverConfig', mockServerConfig), + endpoint.query('serverConfig', mockServerConfig(productConfiguration)), endpoint.mutation('openSession', mockOpenSession), ]; } \ No newline at end of file diff --git a/webapp/packages/core-root/mocks/mockGraphQL.ts b/webapp/packages/core-root/mocks/mockGraphQL.ts index 303b3d8659..90f6939487 100644 --- a/webapp/packages/core-root/mocks/mockGraphQL.ts +++ b/webapp/packages/core-root/mocks/mockGraphQL.ts @@ -18,4 +18,6 @@ export function mockGraphQL( beforeAll(() => server.listen()); afterEach(() => server.resetHandlers()); afterAll(() => server.close()); + + return server; } \ No newline at end of file diff --git a/webapp/packages/core-root/mocks/resolvers/mockServerConfig.ts b/webapp/packages/core-root/mocks/resolvers/mockServerConfig.ts index ea85755080..f3af77afce 100644 --- a/webapp/packages/core-root/mocks/resolvers/mockServerConfig.ts +++ b/webapp/packages/core-root/mocks/resolvers/mockServerConfig.ts @@ -10,149 +10,16 @@ import type { GraphQLContext, GraphQLRequest, ResponseComposition } from 'msw'; import type { ServerConfigQuery, ServerConfigQueryVariables } from '@cloudbeaver/core-sdk'; -export function mockServerConfig( - req: GraphQLRequest, - res: ResponseComposition, - ctx: GraphQLContext -) { - return res( - ctx.data({ - 'serverConfig': { - 'name': 'CloudBeaver CE Server', - 'version': '22.1.2.202207140640', - 'workspaceId': 'D14DGNGYNPI71M', - 'serverURL': 'https://test.ce.cloudbeaver.io', - 'rootURI': '/', - 'hostName': '931cdabfc0b3', - 'productConfiguration': { - 'core_events': { - 'notificationsPool': 5.0, - }, - 'core': { - 'user': { - 'defaultTheme': 'light', - 'defaultLanguage': 'en', - }, - 'app': { - 'logViewer': { - 'refreshTimeout': 3000.0, - 'logBatchSize': 1000.0, - 'maxLogRecords': 2000.0, - 'maxFailedRequests': 3.0, - }, - }, - 'authentication': { - 'primaryAuthProvider': 'local', - }, - }, - 'plugin_data_export': { - 'disabled': false, - }, - 'plugin_data_spreadsheet_new': { - 'hidden': false, - }, - }, - 'supportsCustomConnections': true, - 'supportsConnectionBrowser': false, - 'supportsWorkspaces': false, - 'sessionExpireTime': 6000000, - 'anonymousAccessEnabled': true, - 'adminCredentialsSaveEnabled': true, - 'publicCredentialsSaveEnabled': true, - 'resourceManagerEnabled': true, - 'licenseRequired': false, - 'licenseValid': false, - 'configurationMode': false, - 'developmentMode': false, - 'redirectOnFederatedAuth': false, - 'enabledFeatures': [], - 'enabledAuthProviders': [ - 'local', - ], - 'supportedLanguages': [ - { - 'isoCode': 'en', - 'displayName': 'English', - 'nativeName': 'English', - }, - { - 'isoCode': 'zh', - 'displayName': 'Simplified chinese', - 'nativeName': '简体中文', - }, - { - 'isoCode': 'ru', - 'displayName': 'Russian', - 'nativeName': 'Русский', - }, - { - 'isoCode': 'fr', - 'displayName': 'French', - 'nativeName': 'Français', - }, - { - 'isoCode': 'de', - 'displayName': 'German', - 'nativeName': 'Deutsch', - }, - { - 'isoCode': 'it', - 'displayName': 'Italian', - 'nativeName': 'Italiano', - }, - { - 'isoCode': 'ja', - 'displayName': 'Japanese', - 'nativeName': 'Japanese', - }, - { - 'isoCode': 'es', - 'displayName': 'Spanish', - 'nativeName': 'Spanish', - }, - { - 'isoCode': 'pt_BR', - 'displayName': 'Portuguese (BR)', - 'nativeName': 'Português Brasil', - }, - { - 'isoCode': 'ko', - 'displayName': 'Korean', - 'nativeName': '한국어', - }, - { - 'isoCode': 'tw', - 'displayName': 'Traditional chinese', - 'nativeName': '繁体中文', - }, - ], - 'defaultNavigatorSettings': { - 'showSystemObjects': true, - 'showUtilityObjects': false, - 'showOnlyEntities': false, - 'mergeEntities': false, - 'hideFolders': false, - 'hideSchemas': false, - 'hideVirtualModel': false, - }, - 'resourceQuotas': { - 'dataExportFileSizeLimit': 1.0E7, - 'sqlMaxRunningQueries': 3.0, - 'sqlResultSetRowsLimit': 100000.0, - 'sqlResultSetMemoryLimit': 2000000.0, - }, - 'disabledDrivers': [], - 'productInfo': { - 'id': 'io.cloudbeaver.product.ce.product', - 'version': '22.1.2.202207140640', - 'latestVersionInfo': 'https://cloudbeaver.io/product/cloudbeaver-ce-version.json', - 'name': 'CloudBeaver CE Server', - 'description': 'Cloudbeaver Web UI Application', - 'buildTime': 'July 14, 2022', - 'releaseTime': 'July 11, 2022', - 'licenseInfo': '', - }, - }, - }), - ); +import { defaultServerConfig } from '../data/defaultServerConfig'; + +export function mockServerConfig(productConfiguration?: Record) { + return function mockServerConfig( + req: GraphQLRequest, + res: ResponseComposition, + ctx: GraphQLContext + ) { + return res( + ctx.data(defaultServerConfig(productConfiguration)), + ); + }; } diff --git a/webapp/packages/core-app/src/QuotasService.ts b/webapp/packages/core-root/src/QuotasService.ts similarity index 96% rename from webapp/packages/core-app/src/QuotasService.ts rename to webapp/packages/core-root/src/QuotasService.ts index d89f94c899..c3c3e81dbe 100644 --- a/webapp/packages/core-app/src/QuotasService.ts +++ b/webapp/packages/core-root/src/QuotasService.ts @@ -7,7 +7,8 @@ */ import { injectable } from '@cloudbeaver/core-di'; -import { ServerConfigResource } from '@cloudbeaver/core-root'; + +import { ServerConfigResource } from './ServerConfigResource'; interface IQuotas { dataExportFileSizeLimit: number; diff --git a/webapp/packages/core-root/src/index.ts b/webapp/packages/core-root/src/index.ts index bfdd15bfb8..fb4a39cc60 100644 --- a/webapp/packages/core-root/src/index.ts +++ b/webapp/packages/core-root/src/index.ts @@ -6,6 +6,7 @@ export * from './SessionPermissionsResource'; export * from './PermissionsService'; export * from './ServerConfigResource'; export * from './SessionService'; +export * from './QuotasService'; export * from './SessionResource'; export * from './ServerService'; export * from './ServerSettingsService'; diff --git a/webapp/packages/core-root/src/manifest.ts b/webapp/packages/core-root/src/manifest.ts index 1f9483efb1..7dfcb262bf 100644 --- a/webapp/packages/core-root/src/manifest.ts +++ b/webapp/packages/core-root/src/manifest.ts @@ -11,6 +11,7 @@ import type { PluginManifest } from '@cloudbeaver/core-di'; import { FeaturesResource } from './FeaturesResource'; import { NetworkStateService } from './NetworkStateService'; import { PermissionsService } from './PermissionsService'; +import { QuotasService } from './QuotasService'; import { ServerConfigResource } from './ServerConfigResource'; import { ServerService } from './ServerService'; import { ServerSettingsService } from './ServerSettingsService'; @@ -44,5 +45,6 @@ export const manifest: PluginManifest = { SessionService, SessionSettingsService, WindowEventsService, + QuotasService, ], }; diff --git a/webapp/packages/core-app/src/shared/InlineEditor/EditorDialog.tsx b/webapp/packages/core-ui/src/InlineEditor/EditorDialog.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/InlineEditor/EditorDialog.tsx rename to webapp/packages/core-ui/src/InlineEditor/EditorDialog.tsx diff --git a/webapp/packages/core-app/src/shared/InlineEditor/InlineEditor.tsx b/webapp/packages/core-ui/src/InlineEditor/InlineEditor.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/InlineEditor/InlineEditor.tsx rename to webapp/packages/core-ui/src/InlineEditor/InlineEditor.tsx diff --git a/webapp/packages/core-app/src/shared/InlineEditor/styles.ts b/webapp/packages/core-ui/src/InlineEditor/styles.ts similarity index 100% rename from webapp/packages/core-app/src/shared/InlineEditor/styles.ts rename to webapp/packages/core-ui/src/InlineEditor/styles.ts diff --git a/webapp/packages/core-ui/src/index.ts b/webapp/packages/core-ui/src/index.ts index 92aae208ad..742487adde 100644 --- a/webapp/packages/core-ui/src/index.ts +++ b/webapp/packages/core-ui/src/index.ts @@ -14,6 +14,8 @@ export * from './DragAndDrop/DNDProvider'; export * from './DragAndDrop/useDNDBox'; export * from './DragAndDrop/useDNDData'; +export * from './InlineEditor/InlineEditor'; + export * from './Screens/AppScreen/NavigationService'; export * from './Screens/AppScreen/OptionsPanelService'; @@ -56,4 +58,5 @@ export * from './SideBarPanel/SideBarPanelService'; export * from './AuthenticationProvider'; export * from './useAuthenticationAction'; export * from './WindowsService'; + export { manifest as coreUIManifest } from './manifest'; diff --git a/webapp/packages/plugin-connection-custom/package.json b/webapp/packages/plugin-connection-custom/package.json index b35a2b1841..949d785ddc 100644 --- a/webapp/packages/plugin-connection-custom/package.json +++ b/webapp/packages/plugin-connection-custom/package.json @@ -37,6 +37,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-connections": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnectionPluginBootstrap.ts b/webapp/packages/plugin-connection-custom/src/CustomConnectionPluginBootstrap.ts index 8bea8fac9b..a6393ca249 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnectionPluginBootstrap.ts +++ b/webapp/packages/plugin-connection-custom/src/CustomConnectionPluginBootstrap.ts @@ -6,19 +6,19 @@ * you may not use this file except in compliance with the License. */ -import { MainMenuService, EMainMenu } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { ServerConfigResource } from '@cloudbeaver/core-root'; +import { MainMenuService, EMainMenu } from '@cloudbeaver/plugin-top-app-bar'; import { CustomConnectionDialog } from './CustomConnection/CustomConnectionDialog'; @injectable() export class CustomConnectionPluginBootstrap extends Bootstrap { constructor( - private mainMenuService: MainMenuService, - private commonDialogService: CommonDialogService, - private serverConfigResource: ServerConfigResource + private readonly mainMenuService: MainMenuService, + private readonly commonDialogService: CommonDialogService, + private readonly serverConfigResource: ServerConfigResource ) { super(); } diff --git a/webapp/packages/plugin-connection-template/package.json b/webapp/packages/plugin-connection-template/package.json index 3b0e755c92..c57e827697 100644 --- a/webapp/packages/plugin-connection-template/package.json +++ b/webapp/packages/plugin-connection-template/package.json @@ -15,6 +15,7 @@ "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" }, "peerDependencies": { + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/core-administration": "~0.1.0", "@cloudbeaver/core-app": "~0.1.0", "@cloudbeaver/core-authentication": "~0.1.0", diff --git a/webapp/packages/plugin-connection-template/src/TemplateConnectionPluginBootstrap.ts b/webapp/packages/plugin-connection-template/src/TemplateConnectionPluginBootstrap.ts index 67cce658e1..145bfc217e 100644 --- a/webapp/packages/plugin-connection-template/src/TemplateConnectionPluginBootstrap.ts +++ b/webapp/packages/plugin-connection-template/src/TemplateConnectionPluginBootstrap.ts @@ -6,11 +6,11 @@ * you may not use this file except in compliance with the License. */ -import { MainMenuService, EMainMenu } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; import { PermissionsService, EPermission } from '@cloudbeaver/core-root'; +import { MainMenuService, EMainMenu } from '@cloudbeaver/plugin-top-app-bar'; import { ConnectionDialog } from './ConnectionDialog/ConnectionDialog'; import { TemplateConnectionsResource } from './TemplateConnectionsResource'; @@ -18,11 +18,11 @@ import { TemplateConnectionsResource } from './TemplateConnectionsResource'; @injectable() export class TemplateConnectionPluginBootstrap extends Bootstrap { constructor( - private mainMenuService: MainMenuService, - private templateConnectionsResource: TemplateConnectionsResource, - private commonDialogService: CommonDialogService, - private notificationService: NotificationService, - private permissionsService: PermissionsService + private readonly mainMenuService: MainMenuService, + private readonly templateConnectionsResource: TemplateConnectionsResource, + private readonly commonDialogService: CommonDialogService, + private readonly notificationService: NotificationService, + private readonly permissionsService: PermissionsService ) { super(); } diff --git a/webapp/packages/plugin-connections/package.json b/webapp/packages/plugin-connections/package.json index 247bf89019..fd364bdbaf 100644 --- a/webapp/packages/plugin-connections/package.json +++ b/webapp/packages/plugin-connections/package.json @@ -38,6 +38,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-navigation-tree": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-connections/src/PluginBootstrap.ts b/webapp/packages/plugin-connections/src/PluginBootstrap.ts index be27cff911..065f0d5c3d 100644 --- a/webapp/packages/plugin-connections/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-connections/src/PluginBootstrap.ts @@ -6,9 +6,9 @@ * you may not use this file except in compliance with the License. */ -import { EMainMenu, MainMenuService } from '@cloudbeaver/core-app'; import { ConnectionsManagerService } from '@cloudbeaver/core-connections'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { EMainMenu, MainMenuService } from '@cloudbeaver/plugin-top-app-bar'; @injectable() export class PluginBootstrap extends Bootstrap { diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx index e7ac2ca1b1..64914ebad0 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/CellEditor/CellEditor.tsx @@ -12,8 +12,8 @@ import { createPortal } from 'react-dom'; import { usePopper } from 'react-popper'; import styled, { css } from 'reshadow'; -import { InlineEditor } from '@cloudbeaver/core-app'; import { EventContext, EventStopPropagationFlag } from '@cloudbeaver/core-events'; +import { InlineEditor } from '@cloudbeaver/core-ui'; import type { IResultSetElementKey, IResultSetRowKey } from '@cloudbeaver/plugin-data-viewer'; import type { EditorProps } from '@cloudbeaver/plugin-react-data-grid'; diff --git a/webapp/packages/plugin-data-viewer/package.json b/webapp/packages/plugin-data-viewer/package.json index 3fc19b8dce..3dd134b078 100644 --- a/webapp/packages/plugin-data-viewer/package.json +++ b/webapp/packages/plugin-data-viewer/package.json @@ -40,6 +40,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerDatabaseDataModel.ts b/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerDatabaseDataModel.ts index a864336b3d..d8703f1882 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerDatabaseDataModel.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerPage/useDataViewerDatabaseDataModel.ts @@ -9,12 +9,12 @@ import { action, computed, observable } from 'mobx'; import { useEffect } from 'react'; -import type { ITab } from '@cloudbeaver/core-app'; import { ILoadableState, isContainsException, useMapResource, useObservableRef } from '@cloudbeaver/core-blocks'; import { ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; import { NavNodeManagerService } from '@cloudbeaver/core-navigation-tree'; import { CachedMapAllKey } from '@cloudbeaver/core-sdk'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from '@cloudbeaver/plugin-object-viewer'; import { DataPresentationService } from '../DataPresentationService'; diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerTabService.ts b/webapp/packages/plugin-data-viewer/src/DataViewerTabService.ts index 58d7eff49b..419cf7d494 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerTabService.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerTabService.ts @@ -6,12 +6,12 @@ * you may not use this file except in compliance with the License. */ -import { ITab, NavigationTabsService } from '@cloudbeaver/core-app'; import { ConnectionsManagerService, IConnectionExecutorData } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { ExecutorInterrupter, IExecutionContextProvider } from '@cloudbeaver/core-executor'; import { INodeNavigationData, NavigationType, NavNodeManagerService } from '@cloudbeaver/core-navigation-tree'; +import { ITab, NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { DBObjectPageService, ObjectPage, ObjectViewerTabService, IObjectViewerTabState, isObjectViewerTab } from '@cloudbeaver/plugin-object-viewer'; import { DataViewerPanel } from './DataViewerPage/DataViewerPanel'; diff --git a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts index 45d6f206ce..3a0d6c8be9 100644 --- a/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts +++ b/webapp/packages/plugin-data-viewer/src/DatabaseDataModel/Actions/ResultSet/ResultSetDataContentAction.ts @@ -8,7 +8,7 @@ import { makeObservable, observable } from 'mobx'; -import { QuotasService } from '@cloudbeaver/core-app'; +import { QuotasService } from '@cloudbeaver/core-root'; import { GraphQLService, ResultDataFormat } from '@cloudbeaver/core-sdk'; import { download, GlobalConstants } from '@cloudbeaver/core-utils'; diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts index 9969d72c78..0164aab3eb 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts @@ -10,14 +10,11 @@ import { injectable } from '@cloudbeaver/core-di'; import { ContextMenuService, IMenuContext, IContextMenuItem, IMenuItem } from '@cloudbeaver/core-dialogs'; -import { ResultDataFormat } from '@cloudbeaver/core-sdk'; import { DatabaseEditAction } from '../../../DatabaseDataModel/Actions/DatabaseEditAction'; import { DatabaseSelectAction } from '../../../DatabaseDataModel/Actions/DatabaseSelectAction'; import { DatabaseEditChangeType } from '../../../DatabaseDataModel/Actions/IDatabaseDataEditAction'; import type { IDatabaseDataModel } from '../../../DatabaseDataModel/IDatabaseDataModel'; -import type { IDatabaseDataResult } from '../../../DatabaseDataModel/IDatabaseDataResult'; -import { ScriptPreviewService } from '../../../ScriptPreview/ScriptPreviewService'; export interface ITableFooterMenuContext { model: IDatabaseDataModel; @@ -31,7 +28,6 @@ export class TableFooterMenuService { constructor( private readonly contextMenuService: ContextMenuService, - private readonly scriptPreviewService: ScriptPreviewService, ) { this.contextMenuService.addPanel(this.tableFooterMenuToken); @@ -312,38 +308,6 @@ export class TableFooterMenuService { editor?.clear(); }, }); - - this.registerMenuItem({ - id: 'script', - order: 3, - title: 'data_viewer_script_preview', - tooltip: 'data_viewer_script_preview', - icon: 'sql-script-preview', - isPresent(context) { - return context.contextType === TableFooterMenuService.nodeContextType; - }, - isHidden(context) { - return context.data.model.isReadonly() - || context.data.model.source.getResult(context.data.resultIndex)?.dataFormat !== ResultDataFormat.Resultset; - }, - isDisabled(context) { - if ( - context.data.model.isLoading() - || context.data.model.isDisabled(context.data.resultIndex) - || !context.data.model.source.hasResult(context.data.resultIndex) - ) { - return true; - } - const editor = context.data.model.source.getActionImplementation( - context.data.resultIndex, - DatabaseEditAction - ); - return !editor?.isEdited(); - }, - onClick: async context => { - await this.scriptPreviewService.open(context.data.model, context.data.resultIndex); - }, - }); } constructMenuWithContext(model: IDatabaseDataModel, resultIndex: number): IMenuItem[] { diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableHeader/TableWhereFilter.tsx b/webapp/packages/plugin-data-viewer/src/TableViewer/TableHeader/TableWhereFilter.tsx index 493dad1cd7..09a9951910 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableHeader/TableWhereFilter.tsx +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableHeader/TableWhereFilter.tsx @@ -9,10 +9,10 @@ import { observer } from 'mobx-react-lite'; import styled, { css } from 'reshadow'; -import { InlineEditor } from '@cloudbeaver/core-app'; import type { PlaceholderComponent } from '@cloudbeaver/core-blocks'; import { useTranslate } from '@cloudbeaver/core-localization'; import { useStyles } from '@cloudbeaver/core-theming'; +import { InlineEditor } from '@cloudbeaver/core-ui'; import type { ITableHeaderPlaceholderProps } from './TableHeaderService'; import { useWhereFilter } from './useWhereFilter'; diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx index b240e12c59..9d76447434 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/ImageValue/ImageValuePresentation.tsx @@ -10,11 +10,11 @@ import { action, computed, observable } from 'mobx'; import { observer } from 'mobx-react-lite'; import styled, { css, use } from 'reshadow'; -import { QuotasService } from '@cloudbeaver/core-app'; import { Button, IconOrImage, useObservableRef } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { useTranslate } from '@cloudbeaver/core-localization'; +import { QuotasService } from '@cloudbeaver/core-root'; import { useStyles } from '@cloudbeaver/core-theming'; import type { TabContainerPanelComponent } from '@cloudbeaver/core-ui'; import { bytesToSize, download, getMIME, isImageFormat, isValidUrl } from '@cloudbeaver/core-utils'; diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx index 1cd9393cfa..24b1055d90 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValuePresentation.tsx @@ -10,11 +10,11 @@ import { observable } from 'mobx'; import { observer } from 'mobx-react-lite'; import styled, { css } from 'reshadow'; -import { QuotasService } from '@cloudbeaver/core-app'; import { BASE_CONTAINERS_STYLES, IconOrImage, Textarea, useObservableRef } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { useTranslate } from '@cloudbeaver/core-localization'; +import { QuotasService } from '@cloudbeaver/core-root'; import { useStyles } from '@cloudbeaver/core-theming'; import { BASE_TAB_STYLES, TabContainerPanelComponent, TabList, TabsState, UNDERLINE_TAB_STYLES } from '@cloudbeaver/core-ui'; import { bytesToSize } from '@cloudbeaver/core-utils'; diff --git a/webapp/packages/plugin-data-viewer/src/manifest.ts b/webapp/packages/plugin-data-viewer/src/manifest.ts index 641fb6fdeb..24c7b5d440 100644 --- a/webapp/packages/plugin-data-viewer/src/manifest.ts +++ b/webapp/packages/plugin-data-viewer/src/manifest.ts @@ -16,7 +16,6 @@ import { DataViewerSettingsService } from './DataViewerSettingsService'; import { DataViewerTableService } from './DataViewerTableService'; import { DataViewerTabService } from './DataViewerTabService'; import { LocaleService } from './LocaleService'; -import { ScriptPreviewService } from './ScriptPreview/ScriptPreviewService'; import { TableFooterMenuService } from './TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService'; import { TableHeaderService } from './TableViewer/TableHeader/TableHeaderService'; import { TableViewerStorageService } from './TableViewer/TableViewerStorageService'; @@ -43,7 +42,6 @@ export const manifest: PluginManifest = { LocaleService, DataValuePanelService, TextValuePresentationService, - ScriptPreviewService, DataViewerDataChangeConfirmationService, TextValuePresentationBootstrap, ImageValuePresentationBootstrap, diff --git a/webapp/packages/plugin-datasource-context-switch/package.json b/webapp/packages/plugin-datasource-context-switch/package.json index dfa01dfc2c..7b35115e1c 100644 --- a/webapp/packages/plugin-datasource-context-switch/package.json +++ b/webapp/packages/plugin-datasource-context-switch/package.json @@ -38,6 +38,8 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-connections": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSchemaManagerService.ts b/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSchemaManagerService.ts index 7b87f50a1f..2c1b209f51 100644 --- a/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSchemaManagerService.ts +++ b/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSchemaManagerService.ts @@ -8,7 +8,6 @@ import { computed, observable, makeObservable, action, runInAction } from 'mobx'; -import { ITab, NavigationTabsService } from '@cloudbeaver/core-app'; import { ConnectionInfoResource, ConnectionsManagerService, @@ -21,6 +20,7 @@ import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { ExtensionUtils, IExtension } from '@cloudbeaver/core-extensions'; import { type IObjectNavNodeProvider, type IObjectSchemaProvider, type IObjectCatalogProvider, type IObjectCatalogSetter, type IObjectSchemaSetter, type IDataContextActiveNode, isObjectNavNodeProvider, isObjectCatalogProvider, isObjectSchemaProvider, isObjectCatalogSetter, isObjectSchemaSetter } from '@cloudbeaver/core-navigation-tree'; +import { ITab, NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; export interface IConnectionInfo { diff --git a/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSelector/ConnectionSelector.tsx b/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSelector/ConnectionSelector.tsx index 7352ced1b6..8f26c9f73e 100644 --- a/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSelector/ConnectionSelector.tsx +++ b/webapp/packages/plugin-datasource-context-switch/src/ConnectionSchemaManager/ConnectionSelector/ConnectionSelector.tsx @@ -10,7 +10,6 @@ import { observer } from 'mobx-react-lite'; import { useEffect } from 'react'; import styled, { css, use } from 'reshadow'; -import { topMenuStyles, TopNavButton } from '@cloudbeaver/core-app'; import { getComputed, useDataResource, useMapResource } from '@cloudbeaver/core-blocks'; import { ConnectionInfoResource, ContainerResource, DBDriverResource } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; @@ -20,6 +19,7 @@ import { CachedMapAllKey } from '@cloudbeaver/core-sdk'; import { useStyles } from '@cloudbeaver/core-theming'; import { ContextMenu, OptionsPanelService } from '@cloudbeaver/core-ui'; import { useMenu } from '@cloudbeaver/core-view'; +import { topMenuStyles, TopNavButton } from '@cloudbeaver/plugin-top-app-bar'; import { ConnectionSchemaManagerService } from '../ConnectionSchemaManagerService'; import { MENU_CONNECTION_DATA_CONTAINER_SELECTOR } from '../MENU_CONNECTION_DATA_CONTAINER_SELECTOR'; diff --git a/webapp/packages/plugin-datasource-context-switch/src/PluginBootstrap.ts b/webapp/packages/plugin-datasource-context-switch/src/PluginBootstrap.ts index 09b5be11ad..2a8e8a7d5d 100644 --- a/webapp/packages/plugin-datasource-context-switch/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-datasource-context-switch/src/PluginBootstrap.ts @@ -6,8 +6,8 @@ * you may not use this file except in compliance with the License. */ -import { TopNavService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { TopNavService } from '@cloudbeaver/plugin-top-app-bar'; import { ConnectionSelector } from './ConnectionSchemaManager/ConnectionSelector/ConnectionSelector'; diff --git a/webapp/packages/plugin-help/package.json b/webapp/packages/plugin-help/package.json index d9727074b0..db882191dd 100644 --- a/webapp/packages/plugin-help/package.json +++ b/webapp/packages/plugin-help/package.json @@ -38,6 +38,7 @@ "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-version-update": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", "react": "~18.x.x", diff --git a/webapp/packages/plugin-help/src/PluginBootstrap.ts b/webapp/packages/plugin-help/src/PluginBootstrap.ts index 36b2e2d21e..022f4ce305 100644 --- a/webapp/packages/plugin-help/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-help/src/PluginBootstrap.ts @@ -6,8 +6,8 @@ * you may not use this file except in compliance with the License. */ -import { TopNavService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { TopNavService } from '@cloudbeaver/plugin-top-app-bar'; import { Help } from './Help'; diff --git a/webapp/packages/plugin-log-viewer/package.json b/webapp/packages/plugin-log-viewer/package.json index 52bde9cf92..eac1ab3186 100644 --- a/webapp/packages/plugin-log-viewer/package.json +++ b/webapp/packages/plugin-log-viewer/package.json @@ -37,6 +37,8 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-tools-panel": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-settings-menu": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerBootstrap.ts b/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerBootstrap.ts index ee18678d89..59f52196e9 100644 --- a/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerBootstrap.ts +++ b/webapp/packages/plugin-log-viewer/src/LogViewer/LogViewerBootstrap.ts @@ -6,12 +6,14 @@ * you may not use this file except in compliance with the License. */ -import { MainMenuService, ToolsPanelService, EMainMenu } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { ToolsPanelService } from '@cloudbeaver/plugin-tools-panel'; +import { MainMenuService, EMainMenu } from '@cloudbeaver/plugin-top-app-bar'; import { LogViewer } from './LogViewer'; import { LogViewerService } from './LogViewerService'; + @injectable() export class LogViewerBootstrap extends Bootstrap { constructor( diff --git a/webapp/packages/plugin-navigation-tabs/.gitignore b/webapp/packages/plugin-navigation-tabs/.gitignore new file mode 100644 index 0000000000..15bc16c7c3 --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/.gitignore @@ -0,0 +1,17 @@ +# dependencies +/node_modules + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/plugin-navigation-tabs/package.json b/webapp/packages/plugin-navigation-tabs/package.json new file mode 100644 index 0000000000..f9c6987e6a --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/package.json @@ -0,0 +1,47 @@ +{ + "name": "@cloudbeaver/plugin-navigation-tabs", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "types": "src/index.ts", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config.js", + "postbuild": "tsc", + "lint": "eslint ./src/ --ext .ts,.tsx", + "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" + }, + "peerDependencies": { + "@cloudbeaver/core-administration": "~0.1.0", + "@cloudbeaver/core-app": "~0.1.0", + "@cloudbeaver/core-authentication": "~0.1.0", + "@cloudbeaver/core-blocks": "~0.1.0", + "@cloudbeaver/core-connections": "~0.1.0", + "@cloudbeaver/core-di": "~0.1.0", + "@cloudbeaver/core-dialogs": "~0.1.0", + "@cloudbeaver/core-events": "~0.1.0", + "@cloudbeaver/core-executor": "~0.1.0", + "@cloudbeaver/core-extensions": "~0.1.0", + "@cloudbeaver/core-localization": "~0.1.0", + "@cloudbeaver/core-notifications": "~0.1.0", + "@cloudbeaver/core-plugin": "~0.1.0", + "@cloudbeaver/core-product": "~0.1.0", + "@cloudbeaver/core-root": "~0.1.0", + "@cloudbeaver/core-routing": "~0.1.0", + "@cloudbeaver/core-sdk": "~0.1.0", + "@cloudbeaver/core-settings": "~0.1.0", + "@cloudbeaver/core-theming": "~0.1.0", + "@cloudbeaver/core-ui": "~0.1.0", + "@cloudbeaver/core-utils": "~0.1.0", + "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", + "@cloudbeaver/plugin-settings-menu": "~0.1.0", + "react": "~18.x.x", + "mobx": "~6.x.x", + "mobx-react-lite": "~3.x.x", + "reshadow": "~0.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/ITab.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/ITab.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/ITab.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/ITab.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/NavigationTabsBar.tsx b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/NavigationTabsBar.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/NavigationTabsBar.tsx rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/NavigationTabsBar.tsx diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerPanel.tsx b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerPanel.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerPanel.tsx rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerPanel.tsx diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerTab.tsx b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerTab.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerTab.tsx rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/TabHandlerTab.tsx diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/useTab.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/useTab.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/useTab.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/useTab.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/useTabHandler.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/useTabHandler.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/Tabs/useTabHandler.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/Tabs/useTabHandler.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/index.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/index.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsBar/index.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsBar/index.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsService.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsService.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/NavigationTabsService.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/NavigationTabsService.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/TabHandler.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/TabHandler.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/TabHandler.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/TabHandler.ts diff --git a/webapp/packages/core-app/src/shared/NavigationTabs/TabNavigationContext.ts b/webapp/packages/plugin-navigation-tabs/src/NavigationTabs/TabNavigationContext.ts similarity index 100% rename from webapp/packages/core-app/src/shared/NavigationTabs/TabNavigationContext.ts rename to webapp/packages/plugin-navigation-tabs/src/NavigationTabs/TabNavigationContext.ts diff --git a/webapp/packages/plugin-navigation-tabs/src/PluginBootstrap.ts b/webapp/packages/plugin-navigation-tabs/src/PluginBootstrap.ts new file mode 100644 index 0000000000..9a71470d48 --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/src/PluginBootstrap.ts @@ -0,0 +1,20 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { Bootstrap, injectable } from '@cloudbeaver/core-di'; + +@injectable() +export class PluginBootstrap extends Bootstrap { + constructor() { + super(); + } + + register(): void | Promise { } + + load(): void | Promise { } +} \ No newline at end of file diff --git a/webapp/packages/plugin-navigation-tabs/src/index.ts b/webapp/packages/plugin-navigation-tabs/src/index.ts new file mode 100644 index 0000000000..6be51681e1 --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/src/index.ts @@ -0,0 +1,9 @@ +import { navigationTabsPlugin } from './manifest'; +export * from './NavigationTabs/NavigationTabsService'; +export * from './NavigationTabs/TabNavigationContext'; +export * from './NavigationTabs/ITab'; +export * from './NavigationTabs/TabHandler'; +export * from './NavigationTabs/NavigationTabsBar/Tabs/useTab'; +export * from './NavigationTabs/NavigationTabsBar'; + +export default navigationTabsPlugin; \ No newline at end of file diff --git a/webapp/packages/plugin-navigation-tabs/src/manifest.ts b/webapp/packages/plugin-navigation-tabs/src/manifest.ts new file mode 100644 index 0000000000..7c1d420a19 --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/src/manifest.ts @@ -0,0 +1,20 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 type { PluginManifest } from '@cloudbeaver/core-di'; + +import { NavigationTabsService } from './NavigationTabs/NavigationTabsService'; +import { PluginBootstrap } from './PluginBootstrap'; + +export const navigationTabsPlugin: PluginManifest = { + info: { name: 'Navigation tabs plugin' }, + providers: [ + PluginBootstrap, + NavigationTabsService, + ], +}; \ No newline at end of file diff --git a/webapp/packages/plugin-navigation-tabs/tsconfig.json b/webapp/packages/plugin-navigation-tabs/tsconfig.json new file mode 100644 index 0000000000..ad14f68a20 --- /dev/null +++ b/webapp/packages/plugin-navigation-tabs/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "composite": true + }, + "include": [ + "src" + ], + "exclude": [ + "**/node_modules", + "**/.*/" + ], + "references": [{ "path": "../*" }] +} \ No newline at end of file diff --git a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/NavigationTreeNode/NavigationNode/NavigationNodeEditor.tsx b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/NavigationTreeNode/NavigationNode/NavigationNodeEditor.tsx index 4321f40b66..beceae73dd 100644 --- a/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/NavigationTreeNode/NavigationNode/NavigationNodeEditor.tsx +++ b/webapp/packages/plugin-navigation-tree/src/NavigationTree/ElementsTree/NavigationTreeNode/NavigationNode/NavigationNodeEditor.tsx @@ -9,10 +9,10 @@ import { observer } from 'mobx-react-lite'; import { useState } from 'react'; -import { InlineEditor } from '@cloudbeaver/core-app'; import { useService } from '@cloudbeaver/core-di'; import { EventContext, EventStopPropagationFlag, NotificationService } from '@cloudbeaver/core-events'; import { type NavNode, NavTreeResource } from '@cloudbeaver/core-navigation-tree'; +import { InlineEditor } from '@cloudbeaver/core-ui'; interface Props { diff --git a/webapp/packages/plugin-object-viewer/package.json b/webapp/packages/plugin-object-viewer/package.json index 7a9946ea28..6e17776173 100644 --- a/webapp/packages/plugin-object-viewer/package.json +++ b/webapp/packages/plugin-object-viewer/package.json @@ -38,6 +38,7 @@ "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", "@cloudbeaver/core-navigation-tree": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", "@cloudbeaver/plugin-navigation-tree": "~0.1.0", "@cloudbeaver/plugin-react-data-grid": "~0.1.0", "react": "~18.x.x", diff --git a/webapp/packages/plugin-object-viewer/src/IObjectViewerTabContext.ts b/webapp/packages/plugin-object-viewer/src/IObjectViewerTabContext.ts index 4a17e8a69a..9bc3baf48d 100644 --- a/webapp/packages/plugin-object-viewer/src/IObjectViewerTabContext.ts +++ b/webapp/packages/plugin-object-viewer/src/IObjectViewerTabContext.ts @@ -6,8 +6,8 @@ * you may not use this file except in compliance with the License. */ -import type { ITabNavigationContext, ITab } from '@cloudbeaver/core-app'; import type { INodeNavigationContext } from '@cloudbeaver/core-navigation-tree'; +import type { ITabNavigationContext, ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from './IObjectViewerTabState'; import type { ObjectPage } from './ObjectPage/ObjectPage'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageService.ts b/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageService.ts index 72fc385bde..e57b736165 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageService.ts +++ b/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageService.ts @@ -8,8 +8,8 @@ import { observable, action, computed, makeObservable } from 'mobx'; -import type { ITab } from '@cloudbeaver/core-app'; import { injectable } from '@cloudbeaver/core-di'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from '../IObjectViewerTabState'; import { ObjectPage, ObjectPageOptions, ObjectPageCallback } from './ObjectPage'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageTab.tsx b/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageTab.tsx index 787b9dd05a..feff5144d7 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageTab.tsx +++ b/webapp/packages/plugin-object-viewer/src/ObjectPage/DBObjectPageTab.tsx @@ -9,8 +9,8 @@ import { observer } from 'mobx-react-lite'; import { useCallback } from 'react'; -import type { ITab } from '@cloudbeaver/core-app'; import type { ComponentStyle } from '@cloudbeaver/core-theming'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from '../IObjectViewerTabState'; import type { ObjectPage } from './ObjectPage'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectPage/ObjectPage.ts b/webapp/packages/plugin-object-viewer/src/ObjectPage/ObjectPage.ts index e51e1e1232..aa1528c96b 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectPage/ObjectPage.ts +++ b/webapp/packages/plugin-object-viewer/src/ObjectPage/ObjectPage.ts @@ -8,8 +8,8 @@ import { observable, makeObservable } from 'mobx'; -import type { ITab } from '@cloudbeaver/core-app'; import type { DynamicStyle } from '@cloudbeaver/core-theming'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from '../IObjectViewerTabState'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectFolders.tsx b/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectFolders.tsx index 38ece314e6..c9bd57c39a 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectFolders.tsx +++ b/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectFolders.tsx @@ -10,7 +10,6 @@ import { observer } from 'mobx-react-lite'; import { useEffect } from 'react'; import styled, { css } from 'reshadow'; -import type { ITab } from '@cloudbeaver/core-app'; import { Loader, TextPlaceholder, useMapResource } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { useTranslate } from '@cloudbeaver/core-localization'; @@ -18,6 +17,7 @@ import { NavNodeManagerService, NavTreeResource } from '@cloudbeaver/core-naviga import { useStyles } from '@cloudbeaver/core-theming'; import { BASE_TAB_STYLES, ITabData, TabList, TabPanel, TabsState, useTabLocalState, verticalTabStyles } from '@cloudbeaver/core-ui'; import { MetadataMap } from '@cloudbeaver/core-utils'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import { NavNodeViewService } from '@cloudbeaver/plugin-navigation-tree'; import type { IObjectViewerTabState } from '../IObjectViewerTabState'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectViewerPanel.tsx b/webapp/packages/plugin-object-viewer/src/ObjectViewerPanel.tsx index 32e5234110..2a1b539a07 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectViewerPanel.tsx +++ b/webapp/packages/plugin-object-viewer/src/ObjectViewerPanel.tsx @@ -11,7 +11,6 @@ import { observer } from 'mobx-react-lite'; import { useCallback } from 'react'; import styled, { css } from 'reshadow'; -import type { TabHandlerPanelComponent } from '@cloudbeaver/core-app'; import { Loader, TextPlaceholder, Button, useMapResource, useObservableRef, getComputed } from '@cloudbeaver/core-blocks'; import { ConnectionInfoResource, ConnectionsManagerService } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; @@ -20,6 +19,7 @@ import { NavNodeInfoResource, NavTreeResource } from '@cloudbeaver/core-navigati import { useStyles } from '@cloudbeaver/core-theming'; import { TabsBox, TabPanel, useTabLocalState, BASE_TAB_STYLES } from '@cloudbeaver/core-ui'; import { MetadataMap } from '@cloudbeaver/core-utils'; +import type { TabHandlerPanelComponent } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabState } from './IObjectViewerTabState'; import { DBObjectPagePanel } from './ObjectPage/DBObjectPagePanel'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectViewerTab.tsx b/webapp/packages/plugin-object-viewer/src/ObjectViewerTab.tsx index 8b5dbd21cc..318cf3a75d 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectViewerTab.tsx +++ b/webapp/packages/plugin-object-viewer/src/ObjectViewerTab.tsx @@ -10,10 +10,10 @@ import { observer } from 'mobx-react-lite'; import { useContext } from 'react'; import styled from 'reshadow'; -import type { TabHandlerTabComponent } from '@cloudbeaver/core-app'; import { useStyles } from '@cloudbeaver/core-theming'; import { TabIcon, Tab, TabTitle, ITabData } from '@cloudbeaver/core-ui'; import { CaptureViewContext, useDataContext } from '@cloudbeaver/core-view'; +import type { TabHandlerTabComponent } from '@cloudbeaver/plugin-navigation-tabs'; import { useNode } from '@cloudbeaver/plugin-navigation-tree'; import type { IObjectViewerTabState } from './IObjectViewerTabState'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts b/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts index 54ccf6bfd2..174d62c768 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts +++ b/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts @@ -8,13 +8,13 @@ import { action, makeObservable, runInAction } from 'mobx'; -import { NavigationTabsService, ITab, TabHandler } from '@cloudbeaver/core-app'; import { connectionProvider, ConnectionInfoResource, Connection } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import type { IAsyncContextLoader, IExecutionContextProvider } from '@cloudbeaver/core-executor'; import { NavNodeManagerService, objectNavNodeProvider, objectCatalogProvider, objectSchemaProvider, type INodeNavigationData, NodeManagerUtils, NavigationType } from '@cloudbeaver/core-navigation-tree'; import { CachedMapAllKey, ResourceKey, resourceKeyList, ResourceKeyUtils } from '@cloudbeaver/core-sdk'; +import { NavigationTabsService, ITab, TabHandler } from '@cloudbeaver/plugin-navigation-tabs'; import type { IObjectViewerTabContext } from './IObjectViewerTabContext'; import type { IObjectViewerTabState } from './IObjectViewerTabState'; diff --git a/webapp/packages/plugin-product/package.json b/webapp/packages/plugin-product/package.json index ceedcf0428..6a725af337 100644 --- a/webapp/packages/plugin-product/package.json +++ b/webapp/packages/plugin-product/package.json @@ -37,6 +37,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", diff --git a/webapp/packages/plugin-product/src/ProductInfoDialog.tsx b/webapp/packages/plugin-product/src/ProductInfoDialog.tsx index 9a8033c66c..69377937a3 100644 --- a/webapp/packages/plugin-product/src/ProductInfoDialog.tsx +++ b/webapp/packages/plugin-product/src/ProductInfoDialog.tsx @@ -9,13 +9,13 @@ import { observer } from 'mobx-react-lite'; import styled, { css } from 'reshadow'; -import { useAppVersion } from '@cloudbeaver/core-app'; import { BASE_CONTAINERS_STYLES, Button, ColoredContainer, FormFieldDescription, Group, IconOrImage, Link, TextPlaceholder } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { CommonDialogWrapper, DialogComponentProps } from '@cloudbeaver/core-dialogs'; import { useTranslate } from '@cloudbeaver/core-localization'; import { ServerConfigResource } from '@cloudbeaver/core-root'; import { ThemeService, useStyles } from '@cloudbeaver/core-theming'; +import { useAppVersion } from '@cloudbeaver/plugin-version'; const dialogStyles = css` footer { diff --git a/webapp/packages/plugin-resource-manager/package.json b/webapp/packages/plugin-resource-manager/package.json index bd830ca393..e037b805f1 100644 --- a/webapp/packages/plugin-resource-manager/package.json +++ b/webapp/packages/plugin-resource-manager/package.json @@ -39,6 +39,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "@cloudbeaver/plugin-navigation-tree": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts b/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts index 336c55bc9b..0dc6b9626c 100644 --- a/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-resource-manager/src/PluginBootstrap.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ -import { EMainMenu, MainMenuService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, ConfirmationDialogDelete, DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; @@ -15,6 +14,7 @@ import { DATA_CONTEXT_NAV_NODE } from '@cloudbeaver/core-navigation-tree'; import { SideBarPanelService } from '@cloudbeaver/core-ui'; import { ActionService, ACTION_DELETE, MenuService } from '@cloudbeaver/core-view'; import { isScript } from '@cloudbeaver/plugin-sql-editor-navigation-tab-resource'; +import { EMainMenu, MainMenuService } from '@cloudbeaver/plugin-top-app-bar'; import { NavResourceNodeService, PROJECT_NODE_TYPE, RESOURCE_NODE_TYPE } from './NavResourceNodeService'; import { ResourceManager } from './ResourceManager'; diff --git a/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.ts b/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.ts index f3aa4525ca..12cb2371c3 100644 --- a/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.ts +++ b/webapp/packages/plugin-resource-manager/src/ResourceManagerSettingsService.ts @@ -13,11 +13,13 @@ const defaultSettings = { disabled: false, }; +export type ResourceManagerSettings = typeof defaultSettings; + @injectable() export class ResourceManagerSettingsService { - readonly settings: PluginSettings; + readonly settings: PluginSettings; /** @deprecated Use settings instead, will be removed in 23.0.0 */ - readonly deprecatedSettings: PluginSettings; + readonly deprecatedSettings: PluginSettings; constructor(private readonly pluginManagerService: PluginManagerService) { this.settings = this.pluginManagerService.getPluginSettings('resource-manager', defaultSettings); diff --git a/webapp/packages/plugin-root/.gitignore b/webapp/packages/plugin-root/.gitignore new file mode 100644 index 0000000000..15bc16c7c3 --- /dev/null +++ b/webapp/packages/plugin-root/.gitignore @@ -0,0 +1,17 @@ +# dependencies +/node_modules + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/plugin-root/package.json b/webapp/packages/plugin-root/package.json new file mode 100644 index 0000000000..54bc3c7aa7 --- /dev/null +++ b/webapp/packages/plugin-root/package.json @@ -0,0 +1,47 @@ +{ + "name": "@cloudbeaver/plugin-root", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "types": "src/index.ts", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config.js", + "postbuild": "tsc", + "lint": "eslint ./src/ --ext .ts,.tsx", + "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" + }, + "peerDependencies": { + "@cloudbeaver/core-administration": "~0.1.0", + "@cloudbeaver/core-app": "~0.1.0", + "@cloudbeaver/core-authentication": "~0.1.0", + "@cloudbeaver/core-blocks": "~0.1.0", + "@cloudbeaver/core-connections": "~0.1.0", + "@cloudbeaver/core-di": "~0.1.0", + "@cloudbeaver/core-dialogs": "~0.1.0", + "@cloudbeaver/core-events": "~0.1.0", + "@cloudbeaver/core-executor": "~0.1.0", + "@cloudbeaver/core-extensions": "~0.1.0", + "@cloudbeaver/core-localization": "~0.1.0", + "@cloudbeaver/core-notifications": "~0.1.0", + "@cloudbeaver/core-plugin": "~0.1.0", + "@cloudbeaver/core-product": "~0.1.0", + "@cloudbeaver/core-root": "~0.1.0", + "@cloudbeaver/core-routing": "~0.1.0", + "@cloudbeaver/core-sdk": "~0.1.0", + "@cloudbeaver/core-settings": "~0.1.0", + "@cloudbeaver/core-theming": "~0.1.0", + "@cloudbeaver/core-ui": "~0.1.0", + "@cloudbeaver/core-utils": "~0.1.0", + "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", + "@cloudbeaver/plugin-settings-menu": "~0.1.0", + "react": "~18.x.x", + "mobx": "~6.x.x", + "mobx-react-lite": "~3.x.x", + "reshadow": "~0.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/plugin-root/src/PluginBootstrap.ts b/webapp/packages/plugin-root/src/PluginBootstrap.ts new file mode 100644 index 0000000000..9a71470d48 --- /dev/null +++ b/webapp/packages/plugin-root/src/PluginBootstrap.ts @@ -0,0 +1,20 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { Bootstrap, injectable } from '@cloudbeaver/core-di'; + +@injectable() +export class PluginBootstrap extends Bootstrap { + constructor() { + super(); + } + + register(): void | Promise { } + + load(): void | Promise { } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/shared/SessionExpireDialog/SessionExpiredDialog.tsx b/webapp/packages/plugin-root/src/SessionExpireDialog/SessionExpiredDialog.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/SessionExpireDialog/SessionExpiredDialog.tsx rename to webapp/packages/plugin-root/src/SessionExpireDialog/SessionExpiredDialog.tsx diff --git a/webapp/packages/core-app/src/shared/SessionExpireDialog/SessionExpiredDialogService.ts b/webapp/packages/plugin-root/src/SessionExpireDialog/SessionExpiredDialogService.ts similarity index 100% rename from webapp/packages/core-app/src/shared/SessionExpireDialog/SessionExpiredDialogService.ts rename to webapp/packages/plugin-root/src/SessionExpireDialog/SessionExpiredDialogService.ts diff --git a/webapp/packages/core-app/src/shared/SessionExpireWarningDialog/SessionExpireWarningDialog.tsx b/webapp/packages/plugin-root/src/SessionExpireWarningDialog/SessionExpireWarningDialog.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/SessionExpireWarningDialog/SessionExpireWarningDialog.tsx rename to webapp/packages/plugin-root/src/SessionExpireWarningDialog/SessionExpireWarningDialog.tsx diff --git a/webapp/packages/core-app/src/shared/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts b/webapp/packages/plugin-root/src/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts similarity index 96% rename from webapp/packages/core-app/src/shared/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts rename to webapp/packages/plugin-root/src/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts index 0b6e62ec44..ee750d9ede 100644 --- a/webapp/packages/core-app/src/shared/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts +++ b/webapp/packages/plugin-root/src/SessionExpireWarningDialog/SessionExpireWarningDialogService.ts @@ -13,7 +13,7 @@ import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dial import { ServerConfigResource, SessionExpireService, SessionResource } from '@cloudbeaver/core-root'; import { getCookies } from '@cloudbeaver/core-utils'; -import { SessionExpireWarningDialog } from '../SessionExpireWarningDialog/SessionExpireWarningDialog'; +import { SessionExpireWarningDialog } from './SessionExpireWarningDialog'; const SESSION_COOKIE_NAME = 'cb-session'; const WARN_IN = 5 * 1000 * 60; diff --git a/webapp/packages/plugin-root/src/index.ts b/webapp/packages/plugin-root/src/index.ts new file mode 100644 index 0000000000..84c9f80dc5 --- /dev/null +++ b/webapp/packages/plugin-root/src/index.ts @@ -0,0 +1,5 @@ +import { rootPlugin } from './manifest'; +export * from './SessionExpireDialog/SessionExpiredDialogService'; +export * from './SessionExpireWarningDialog/SessionExpireWarningDialogService'; + +export default rootPlugin; \ No newline at end of file diff --git a/webapp/packages/plugin-root/src/manifest.ts b/webapp/packages/plugin-root/src/manifest.ts new file mode 100644 index 0000000000..4ae168f8bd --- /dev/null +++ b/webapp/packages/plugin-root/src/manifest.ts @@ -0,0 +1,22 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 type { PluginManifest } from '@cloudbeaver/core-di'; + +import { PluginBootstrap } from './PluginBootstrap'; +import { SessionExpiredDialogService } from './SessionExpireDialog/SessionExpiredDialogService'; +import { SessionExpireWarningDialogService } from './SessionExpireWarningDialog/SessionExpireWarningDialogService'; + +export const rootPlugin: PluginManifest = { + info: { name: 'Root plugin' }, + providers: [ + PluginBootstrap, + SessionExpiredDialogService, + SessionExpireWarningDialogService, + ], +}; \ No newline at end of file diff --git a/webapp/packages/plugin-root/tsconfig.json b/webapp/packages/plugin-root/tsconfig.json new file mode 100644 index 0000000000..ad14f68a20 --- /dev/null +++ b/webapp/packages/plugin-root/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "composite": true + }, + "include": [ + "src" + ], + "exclude": [ + "**/node_modules", + "**/.*/" + ], + "references": [{ "path": "../*" }] +} \ No newline at end of file diff --git a/webapp/packages/plugin-settings-menu/package.json b/webapp/packages/plugin-settings-menu/package.json index 615e8eee32..affe6f8908 100644 --- a/webapp/packages/plugin-settings-menu/package.json +++ b/webapp/packages/plugin-settings-menu/package.json @@ -37,6 +37,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", diff --git a/webapp/packages/plugin-settings-menu/src/PluginBootstrap.ts b/webapp/packages/plugin-settings-menu/src/PluginBootstrap.ts index 27486d6f96..818497441c 100644 --- a/webapp/packages/plugin-settings-menu/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-settings-menu/src/PluginBootstrap.ts @@ -6,8 +6,8 @@ * you may not use this file except in compliance with the License. */ -import { TopNavService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { TopNavService } from '@cloudbeaver/plugin-top-app-bar'; import { SettingsMenu } from './SettingsMenu/SettingsMenu'; diff --git a/webapp/packages/plugin-settings-menu/src/SettingsMenu/SettingsMenu.tsx b/webapp/packages/plugin-settings-menu/src/SettingsMenu/SettingsMenu.tsx index 8651dcbf22..d942ea065e 100644 --- a/webapp/packages/plugin-settings-menu/src/SettingsMenu/SettingsMenu.tsx +++ b/webapp/packages/plugin-settings-menu/src/SettingsMenu/SettingsMenu.tsx @@ -9,11 +9,11 @@ import { observer } from 'mobx-react-lite'; import styled from 'reshadow'; -import { topMenuStyles } from '@cloudbeaver/core-app'; import { Icon } from '@cloudbeaver/core-blocks'; import { useStyles } from '@cloudbeaver/core-theming'; import { ContextMenu } from '@cloudbeaver/core-ui'; import { useMenu } from '@cloudbeaver/core-view'; +import { topMenuStyles } from '@cloudbeaver/plugin-top-app-bar'; import { settingsMenuStyles } from './settingsMenuStyles'; import { TOP_NAV_BAR_SETTINGS_MENU } from './TOP_NAV_BAR_SETTINGS_MENU'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-resource/package.json b/webapp/packages/plugin-sql-editor-navigation-tab-resource/package.json index 80b91ba8b7..5fbaeb5680 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-resource/package.json +++ b/webapp/packages/plugin-sql-editor-navigation-tab-resource/package.json @@ -15,9 +15,6 @@ "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" }, "peerDependencies": { - "@cloudbeaver/plugin-sql-editor": "~0.1.0", - "@cloudbeaver/plugin-codemirror": "~0.1.0", - "@cloudbeaver/plugin-data-viewer": "~0.1.0", "@cloudbeaver/core-navigation-tree": "~0.1.0", "@cloudbeaver/core-administration": "~0.1.0", "@cloudbeaver/core-app": "~0.1.0", @@ -41,6 +38,10 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", + "@cloudbeaver/plugin-sql-editor": "~0.1.0", + "@cloudbeaver/plugin-codemirror": "~0.1.0", + "@cloudbeaver/plugin-data-viewer": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/PluginBootstrap.ts b/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/PluginBootstrap.ts index dafdb18957..0414d65a84 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/PluginBootstrap.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ -import { NavigationTabsService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; @@ -16,6 +15,7 @@ import { ProjectsResource } from '@cloudbeaver/core-projects'; import { DATA_CONTEXT_TAB_ID } from '@cloudbeaver/core-ui'; import { createPath } from '@cloudbeaver/core-utils'; import { ActionService, ACTION_SAVE, DATA_CONTEXT_MENU, MenuService } from '@cloudbeaver/core-view'; +import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { NavResourceNodeService, RESOURCE_NODE_TYPE, SaveScriptDialog, ResourceManagerService, RESOURCES_NODE_PATH } from '@cloudbeaver/plugin-resource-manager'; import { DATA_CONTEXT_SQL_EDITOR_STATE, getSqlEditorName, SqlDataSourceService, SqlEditorService, SqlEditorSettingsService, SQL_EDITOR_ACTIONS_MENU } from '@cloudbeaver/plugin-sql-editor'; import { isSQLEditorTab, SqlEditorNavigatorService } from '@cloudbeaver/plugin-sql-editor-navigation-tab'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/ResourceSqlDataSourceBootstrap.ts b/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/ResourceSqlDataSourceBootstrap.ts index 59d1985920..e103c06e8f 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/ResourceSqlDataSourceBootstrap.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-resource/src/ResourceSqlDataSourceBootstrap.ts @@ -8,7 +8,6 @@ import { action, makeObservable, observable } from 'mobx'; -import { NavigationTabsService } from '@cloudbeaver/core-app'; import type { IConnectionExecutionContextInfo } from '@cloudbeaver/core-connections'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, ConfirmationDialog, DialogueStateResult } from '@cloudbeaver/core-dialogs'; @@ -18,6 +17,7 @@ import { WindowEventsService } from '@cloudbeaver/core-root'; import { ResourceKey, resourceKeyList, ResourceKeyUtils } from '@cloudbeaver/core-sdk'; import { LocalStorageSaveService } from '@cloudbeaver/core-settings'; import { throttle } from '@cloudbeaver/core-utils'; +import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { NavResourceNodeService, ResourceManagerService } from '@cloudbeaver/plugin-resource-manager'; import { getSqlEditorName, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor'; import { SqlEditorTabService } from '@cloudbeaver/plugin-sql-editor-navigation-tab'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/package.json b/webapp/packages/plugin-sql-editor-navigation-tab/package.json index d1810b0016..2e35af8b6f 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/package.json +++ b/webapp/packages/plugin-sql-editor-navigation-tab/package.json @@ -41,6 +41,8 @@ "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", "@cloudbeaver/core-navigation-tree": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", "@cloudbeaver/plugin-datasource-context-switch": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorBootstrap.ts b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorBootstrap.ts index 6c5b694cc0..0add0128f8 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorBootstrap.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorBootstrap.ts @@ -6,7 +6,6 @@ * you may not use this file except in compliance with the License. */ -import { MainMenuService, NavigationTabsService } from '@cloudbeaver/core-app'; import { ConnectionInfoResource, isConnectionProvider } from '@cloudbeaver/core-connections'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult, RenameDialog } from '@cloudbeaver/core-dialogs'; @@ -17,7 +16,9 @@ import { ISessionAction, sessionActionContext, SessionActionService } from '@clo import { ActionService, ACTION_RENAME, DATA_CONTEXT_MENU_NESTED, menuExtractActions, MenuService, ViewService } from '@cloudbeaver/core-view'; import { DATA_CONTEXT_CONNECTION } from '@cloudbeaver/plugin-connections'; import { ConnectionSchemaManagerService } from '@cloudbeaver/plugin-datasource-context-switch'; +import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { DATA_CONTEXT_SQL_EDITOR_STATE, ESqlDataSourceFeatures, getSqlEditorName, LocalStorageSqlDataSource, SqlDataSourceService, SqlEditorService } from '@cloudbeaver/plugin-sql-editor'; +import { MainMenuService } from '@cloudbeaver/plugin-top-app-bar'; import { ACTION_SQL_EDITOR_OPEN } from './ACTION_SQL_EDITOR_OPEN'; import { DATA_CONTEXT_SQL_EDITOR_TAB } from './DATA_CONTEXT_SQL_EDITOR_TAB'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorNavigatorService.ts b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorNavigatorService.ts index ec56bdc901..191599991b 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorNavigatorService.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorNavigatorService.ts @@ -6,12 +6,12 @@ * you may not use this file except in compliance with the License. */ -import { ITab, NavigationTabsService } from '@cloudbeaver/core-app'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { IExecutor, Executor, IExecutionContextProvider } from '@cloudbeaver/core-executor'; import { NavigationService } from '@cloudbeaver/core-ui'; import { uuid } from '@cloudbeaver/core-utils'; +import { ITab, NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { ISqlEditorTabState, MemorySqlDataSource, SqlDataSourceService, SqlResultTabsService } from '@cloudbeaver/plugin-sql-editor'; import { isSQLEditorTab } from './isSQLEditorTab'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorPanel.tsx b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorPanel.tsx index 3651e8e87c..4a2dbd49ae 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorPanel.tsx +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorPanel.tsx @@ -6,9 +6,9 @@ * you may not use this file except in compliance with the License. */ -import type { TabHandlerPanelComponent } from '@cloudbeaver/core-app'; import { DATA_CONTEXT_TAB_ID, useTab } from '@cloudbeaver/core-ui'; import { useCaptureViewContext } from '@cloudbeaver/core-view'; +import type { TabHandlerPanelComponent } from '@cloudbeaver/plugin-navigation-tabs'; import { DATA_CONTEXT_SQL_EDITOR_STATE, ISqlEditorTabState, SqlEditor } from '@cloudbeaver/plugin-sql-editor'; export const SqlEditorPanel: TabHandlerPanelComponent = function SqlEditorPanel({ tab }) { diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTab.tsx b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTab.tsx index 93c7de56b3..7f79a44117 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTab.tsx +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTab.tsx @@ -10,12 +10,12 @@ import { observer } from 'mobx-react-lite'; import { useContext } from 'react'; import styled from 'reshadow'; -import type { TabHandlerTabComponent } from '@cloudbeaver/core-app'; import { ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; import { useStyles } from '@cloudbeaver/core-theming'; import { TabIcon, Tab, TabTitle, ITabData } from '@cloudbeaver/core-ui'; import { CaptureViewContext, useDataContext } from '@cloudbeaver/core-view'; +import type { TabHandlerTabComponent } from '@cloudbeaver/plugin-navigation-tabs'; import { DATA_CONTEXT_SQL_EDITOR_STATE, getSqlEditorName, ISqlEditorTabState, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor'; import { DATA_CONTEXT_SQL_EDITOR_TAB } from './DATA_CONTEXT_SQL_EDITOR_TAB'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTabService.ts b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTabService.ts index 063daf060f..483782f2a5 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTabService.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/SqlEditorTabService.ts @@ -8,7 +8,6 @@ import { computed, makeObservable } from 'mobx'; -import { NavigationTabsService, TabHandler, ITab, ITabOptions } from '@cloudbeaver/core-app'; import { ConnectionExecutionContextResource, ConnectionExecutionContextService, @@ -25,6 +24,7 @@ import { NotificationService } from '@cloudbeaver/core-events'; import { Executor, ExecutorInterrupter, IExecutionContextProvider } from '@cloudbeaver/core-executor'; import { NavNodeManagerService, objectNavNodeProvider, objectCatalogProvider, objectSchemaProvider, objectCatalogSetter, objectSchemaSetter, NodeManagerUtils } from '@cloudbeaver/core-navigation-tree'; import { CachedMapAllKey, NavNodeInfoFragment, ResourceKey, ResourceKeyUtils } from '@cloudbeaver/core-sdk'; +import { NavigationTabsService, TabHandler, ITab, ITabOptions } from '@cloudbeaver/plugin-navigation-tabs'; import { SqlResultTabsService, ISqlEditorTabState, SqlEditorService, SqlDataSourceService } from '@cloudbeaver/plugin-sql-editor'; import { isSQLEditorTab } from './isSQLEditorTab'; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab/src/isSQLEditorTab.ts b/webapp/packages/plugin-sql-editor-navigation-tab/src/isSQLEditorTab.ts index 73ee3e175d..d5ef4154f6 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab/src/isSQLEditorTab.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab/src/isSQLEditorTab.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ -import type { ITab } from '@cloudbeaver/core-app'; +import type { ITab } from '@cloudbeaver/plugin-navigation-tabs'; import type { ISqlEditorTabState } from '@cloudbeaver/plugin-sql-editor'; import { sqlEditorTabHandlerKey } from './sqlEditorTabHandlerKey'; diff --git a/webapp/packages/plugin-sql-editor/package.json b/webapp/packages/plugin-sql-editor/package.json index a8b1077f68..d541dc752a 100644 --- a/webapp/packages/plugin-sql-editor/package.json +++ b/webapp/packages/plugin-sql-editor/package.json @@ -39,6 +39,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-navigation-tabs": "~0.1.0", "@cloudbeaver/core-navigation-tree": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", diff --git a/webapp/packages/plugin-sql-editor/src/MenuBootstrap.ts b/webapp/packages/plugin-sql-editor/src/MenuBootstrap.ts index 2612bd9999..6a5bbff7b0 100644 --- a/webapp/packages/plugin-sql-editor/src/MenuBootstrap.ts +++ b/webapp/packages/plugin-sql-editor/src/MenuBootstrap.ts @@ -7,7 +7,9 @@ */ import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { ResultDataFormat } from '@cloudbeaver/core-sdk'; import { ActionService, KeyBindingService, MenuService, IAction, IDataContextProvider } from '@cloudbeaver/core-view'; +import { DatabaseEditAction, TableFooterMenuService } from '@cloudbeaver/plugin-data-viewer'; import { ACTION_SQL_EDITOR_EXECUTE } from './actions/ACTION_SQL_EDITOR_EXECUTE'; import { ACTION_SQL_EDITOR_EXECUTE_NEW } from './actions/ACTION_SQL_EDITOR_EXECUTE_NEW'; @@ -19,6 +21,7 @@ import { KEY_BINDING_SQL_EDITOR_EXECUTE_NEW } from './actions/bindings/KEY_BINDI import { KEY_BINDING_SQL_EDITOR_EXECUTE_SCRIPT } from './actions/bindings/KEY_BINDING_SQL_EDITOR_EXECUTE_SCRIPT'; import { KEY_BINDING_SQL_EDITOR_FORMAT } from './actions/bindings/KEY_BINDING_SQL_EDITOR_FORMAT'; import { KEY_BINDING_SQL_EDITOR_SHOW_EXECUTION_PLAN } from './actions/bindings/KEY_BINDING_SQL_EDITOR_SHOW_EXECUTION_PLAN'; +import { ScriptPreviewService } from './ScriptPreview/ScriptPreviewService'; import { DATA_CONTEXT_SQL_EDITOR_DATA } from './SqlEditor/DATA_CONTEXT_SQL_EDITOR_DATA'; @injectable() @@ -26,6 +29,8 @@ export class MenuBootstrap extends Bootstrap { constructor( private readonly actionService: ActionService, private readonly keyBindingService: KeyBindingService, + private readonly scriptPreviewService: ScriptPreviewService, + private readonly tableFooterMenuService: TableFooterMenuService, private readonly menuService: MenuService ) { super(); @@ -93,6 +98,38 @@ export class MenuBootstrap extends Bootstrap { // ...items, // ], // }); + + this.tableFooterMenuService.registerMenuItem({ + id: 'script', + order: 3, + title: 'data_viewer_script_preview', + tooltip: 'data_viewer_script_preview', + icon: 'sql-script-preview', + isPresent(context) { + return context.contextType === TableFooterMenuService.nodeContextType; + }, + isHidden(context) { + return context.data.model.isReadonly() + || context.data.model.source.getResult(context.data.resultIndex)?.dataFormat !== ResultDataFormat.Resultset; + }, + isDisabled(context) { + if ( + context.data.model.isLoading() + || context.data.model.isDisabled(context.data.resultIndex) + || !context.data.model.source.hasResult(context.data.resultIndex) + ) { + return true; + } + const editor = context.data.model.source.getActionImplementation( + context.data.resultIndex, + DatabaseEditAction + ); + return !editor?.isEdited(); + }, + onClick: async context => { + await this.scriptPreviewService.open(context.data.model, context.data.resultIndex); + }, + }); } private sqlEditorActionHandler(context: IDataContextProvider, action: IAction): void { diff --git a/webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewDialog.tsx b/webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewDialog.tsx similarity index 97% rename from webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewDialog.tsx rename to webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewDialog.tsx index f5d96628b4..160ddf54bb 100644 --- a/webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewDialog.tsx +++ b/webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewDialog.tsx @@ -17,10 +17,9 @@ import { useService } from '@cloudbeaver/core-di'; import { CommonDialogWrapper, DialogComponentProps } from '@cloudbeaver/core-dialogs'; import { useTranslate } from '@cloudbeaver/core-localization'; import type { SqlDialectInfo } from '@cloudbeaver/core-sdk'; +import type { IDatabaseDataModel } from '@cloudbeaver/plugin-data-viewer'; import { SQLCodeEditorLoader, SqlDialectInfoService } from '@cloudbeaver/plugin-sql-editor'; -import type { IDatabaseDataModel } from '../DatabaseDataModel/IDatabaseDataModel'; - export const dialogStyle = css` footer { gap: 24px; diff --git a/webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewService.ts b/webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewService.ts similarity index 81% rename from webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewService.ts rename to webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewService.ts index 304aa2f1de..7947b0a09e 100644 --- a/webapp/packages/plugin-data-viewer/src/ScriptPreview/ScriptPreviewService.ts +++ b/webapp/packages/plugin-sql-editor/src/ScriptPreview/ScriptPreviewService.ts @@ -10,11 +10,8 @@ import { injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; import { GraphQLService, ResultDataFormat, UpdateResultsDataBatchScriptMutationVariables } from '@cloudbeaver/core-sdk'; +import { type IDatabaseDataModel, ResultSetEditAction, DocumentEditAction } from '@cloudbeaver/plugin-data-viewer'; -import { DocumentEditAction } from '../DatabaseDataModel/Actions/Document/DocumentEditAction'; -import { ResultSetEditAction } from '../DatabaseDataModel/Actions/ResultSet/ResultSetEditAction'; -import type { IDatabaseDataModel } from '../DatabaseDataModel/IDatabaseDataModel'; -import type { IDatabaseDataResult } from '../DatabaseDataModel/IDatabaseDataResult'; import { ScriptPreviewDialog } from './ScriptPreviewDialog'; @injectable() @@ -25,7 +22,7 @@ export class ScriptPreviewService { private readonly notificationService: NotificationService, ) { } - async open(model: IDatabaseDataModel, resultIndex: number): Promise { + async open(model: IDatabaseDataModel, resultIndex: number): Promise { try { const script = await model.source.runTask(() => this.tryGetScript(model, resultIndex)); @@ -39,7 +36,7 @@ export class ScriptPreviewService { } private async tryGetScript( - model: IDatabaseDataModel, + model: IDatabaseDataModel, resultIndex: number ): Promise { const executionContext = model.source.executionContext; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.ts index 4c4a47548f..b9acb8d7c8 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorSettingsService.ts @@ -13,11 +13,13 @@ const defaultSettings = { maxFileSize: 100, // kilobyte }; +export type SqlEditorSettings = typeof defaultSettings; + @injectable() export class SqlEditorSettingsService { - readonly settings: PluginSettings; + readonly settings: PluginSettings; /** @deprecated Use settings instead, will be removed in 23.0.0 */ - readonly deprecatedSettings: PluginSettings; + readonly deprecatedSettings: PluginSettings; constructor(private readonly pluginManagerService: PluginManagerService) { this.settings = this.pluginManagerService.getPluginSettings('sql-editor', defaultSettings); diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorView.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorView.ts index e8c65c04c5..a5440281f5 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorView.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorView.ts @@ -6,9 +6,9 @@ * you may not use this file except in compliance with the License. */ -import { ITab, NavigationTabsService } from '@cloudbeaver/core-app'; import { injectable } from '@cloudbeaver/core-di'; import { IActiveView, View } from '@cloudbeaver/core-view'; +import { ITab, NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { ACTION_SQL_EDITOR_EXECUTE } from './actions/ACTION_SQL_EDITOR_EXECUTE'; import { ACTION_SQL_EDITOR_EXECUTE_NEW } from './actions/ACTION_SQL_EDITOR_EXECUTE_NEW'; diff --git a/webapp/packages/core-app/src/shared/SqlGenerators/GeneratedSqlDialog.tsx b/webapp/packages/plugin-sql-editor/src/SqlGenerators/GeneratedSqlDialog.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/SqlGenerators/GeneratedSqlDialog.tsx rename to webapp/packages/plugin-sql-editor/src/SqlGenerators/GeneratedSqlDialog.tsx diff --git a/webapp/packages/core-app/src/shared/SqlGenerators/MENU_SQL_GENERATORS.ts b/webapp/packages/plugin-sql-editor/src/SqlGenerators/MENU_SQL_GENERATORS.ts similarity index 100% rename from webapp/packages/core-app/src/shared/SqlGenerators/MENU_SQL_GENERATORS.ts rename to webapp/packages/plugin-sql-editor/src/SqlGenerators/MENU_SQL_GENERATORS.ts diff --git a/webapp/packages/core-app/src/shared/SqlGenerators/SqlGeneratorsBootstrap.ts b/webapp/packages/plugin-sql-editor/src/SqlGenerators/SqlGeneratorsBootstrap.ts similarity index 100% rename from webapp/packages/core-app/src/shared/SqlGenerators/SqlGeneratorsBootstrap.ts rename to webapp/packages/plugin-sql-editor/src/SqlGenerators/SqlGeneratorsBootstrap.ts diff --git a/webapp/packages/core-app/src/shared/SqlGenerators/SqlGeneratorsResource.ts b/webapp/packages/plugin-sql-editor/src/SqlGenerators/SqlGeneratorsResource.ts similarity index 100% rename from webapp/packages/core-app/src/shared/SqlGenerators/SqlGeneratorsResource.ts rename to webapp/packages/plugin-sql-editor/src/SqlGenerators/SqlGeneratorsResource.ts diff --git a/webapp/packages/plugin-sql-editor/src/index.ts b/webapp/packages/plugin-sql-editor/src/index.ts index 72198a70b5..a77cd6ddd5 100644 --- a/webapp/packages/plugin-sql-editor/src/index.ts +++ b/webapp/packages/plugin-sql-editor/src/index.ts @@ -33,5 +33,7 @@ export * from './SqlEditorModeService'; export * from './SqlEditorService'; export * from './SqlEditorSettingsService'; export * from './SqlEditor/SQL_EDITOR_ACTIONS_MENU'; +export * from './SqlGenerators/SqlGeneratorsResource'; +export * from './SqlGenerators/SqlGeneratorsBootstrap'; export default sqlEditorPluginManifest; diff --git a/webapp/packages/plugin-sql-editor/src/manifest.ts b/webapp/packages/plugin-sql-editor/src/manifest.ts index 42d1b91c8e..72f36e0a3e 100644 --- a/webapp/packages/plugin-sql-editor/src/manifest.ts +++ b/webapp/packages/plugin-sql-editor/src/manifest.ts @@ -10,6 +10,7 @@ import type { PluginManifest } from '@cloudbeaver/core-di'; import { LocaleService } from './LocaleService'; import { MenuBootstrap } from './MenuBootstrap'; +import { ScriptPreviewService } from './ScriptPreview/ScriptPreviewService'; import { LocalStorageSqlDataSourceBootstrap } from './SqlDataSource/LocalStorage/LocalStorageSqlDataSourceBootstrap'; import { SqlDataSourceService } from './SqlDataSource/SqlDataSourceService'; import { SqlDialectInfoService } from './SqlDialectInfoService'; @@ -18,6 +19,8 @@ import { SqlEditorModeService } from './SqlEditorModeService'; import { SqlEditorService } from './SqlEditorService'; import { SqlEditorSettingsService } from './SqlEditorSettingsService'; import { SqlEditorView } from './SqlEditorView'; +import { SqlGeneratorsBootstrap } from './SqlGenerators/SqlGeneratorsBootstrap'; +import { SqlGeneratorsResource } from './SqlGenerators/SqlGeneratorsResource'; import { SqlExecutionPlanService } from './SqlResultTabs/ExecutionPlan/SqlExecutionPlanService'; import { SqlQueryResultService } from './SqlResultTabs/SqlQueryResultService'; import { SqlQueryService } from './SqlResultTabs/SqlQueryService'; @@ -43,5 +46,8 @@ export const sqlEditorPluginManifest: PluginManifest = { MenuBootstrap, SqlDataSourceService, LocalStorageSqlDataSourceBootstrap, + SqlGeneratorsBootstrap, + SqlGeneratorsResource, + ScriptPreviewService, ], }; diff --git a/webapp/packages/plugin-tools-panel/.gitignore b/webapp/packages/plugin-tools-panel/.gitignore new file mode 100644 index 0000000000..15bc16c7c3 --- /dev/null +++ b/webapp/packages/plugin-tools-panel/.gitignore @@ -0,0 +1,17 @@ +# dependencies +/node_modules + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/plugin-tools-panel/package.json b/webapp/packages/plugin-tools-panel/package.json new file mode 100644 index 0000000000..2c29fd89cd --- /dev/null +++ b/webapp/packages/plugin-tools-panel/package.json @@ -0,0 +1,47 @@ +{ + "name": "@cloudbeaver/plugin-tools-panel", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "types": "src/index.ts", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config.js", + "postbuild": "tsc", + "lint": "eslint ./src/ --ext .ts,.tsx", + "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" + }, + "peerDependencies": { + "@cloudbeaver/core-administration": "~0.1.0", + "@cloudbeaver/core-app": "~0.1.0", + "@cloudbeaver/core-authentication": "~0.1.0", + "@cloudbeaver/core-blocks": "~0.1.0", + "@cloudbeaver/core-connections": "~0.1.0", + "@cloudbeaver/core-di": "~0.1.0", + "@cloudbeaver/core-dialogs": "~0.1.0", + "@cloudbeaver/core-events": "~0.1.0", + "@cloudbeaver/core-executor": "~0.1.0", + "@cloudbeaver/core-extensions": "~0.1.0", + "@cloudbeaver/core-localization": "~0.1.0", + "@cloudbeaver/core-notifications": "~0.1.0", + "@cloudbeaver/core-plugin": "~0.1.0", + "@cloudbeaver/core-product": "~0.1.0", + "@cloudbeaver/core-root": "~0.1.0", + "@cloudbeaver/core-routing": "~0.1.0", + "@cloudbeaver/core-sdk": "~0.1.0", + "@cloudbeaver/core-settings": "~0.1.0", + "@cloudbeaver/core-theming": "~0.1.0", + "@cloudbeaver/core-ui": "~0.1.0", + "@cloudbeaver/core-utils": "~0.1.0", + "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", + "@cloudbeaver/plugin-settings-menu": "~0.1.0", + "react": "~18.x.x", + "mobx": "~6.x.x", + "mobx-react-lite": "~3.x.x", + "reshadow": "~0.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/plugin-tools-panel/src/PluginBootstrap.ts b/webapp/packages/plugin-tools-panel/src/PluginBootstrap.ts new file mode 100644 index 0000000000..9a71470d48 --- /dev/null +++ b/webapp/packages/plugin-tools-panel/src/PluginBootstrap.ts @@ -0,0 +1,20 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { Bootstrap, injectable } from '@cloudbeaver/core-di'; + +@injectable() +export class PluginBootstrap extends Bootstrap { + constructor() { + super(); + } + + register(): void | Promise { } + + load(): void | Promise { } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/shared/ToolsPanel/ToolsPanel.tsx b/webapp/packages/plugin-tools-panel/src/ToolsPanel/ToolsPanel.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/ToolsPanel/ToolsPanel.tsx rename to webapp/packages/plugin-tools-panel/src/ToolsPanel/ToolsPanel.tsx diff --git a/webapp/packages/core-app/src/shared/ToolsPanel/ToolsPanelService.ts b/webapp/packages/plugin-tools-panel/src/ToolsPanel/ToolsPanelService.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ToolsPanel/ToolsPanelService.ts rename to webapp/packages/plugin-tools-panel/src/ToolsPanel/ToolsPanelService.ts diff --git a/webapp/packages/plugin-tools-panel/src/index.ts b/webapp/packages/plugin-tools-panel/src/index.ts new file mode 100644 index 0000000000..9accda035f --- /dev/null +++ b/webapp/packages/plugin-tools-panel/src/index.ts @@ -0,0 +1,6 @@ +export * from './ToolsPanel/ToolsPanelService'; +export * from './ToolsPanel/ToolsPanel'; + +import { toolsPanelPlugin } from './manifest'; + +export default toolsPanelPlugin; \ No newline at end of file diff --git a/webapp/packages/plugin-tools-panel/src/manifest.ts b/webapp/packages/plugin-tools-panel/src/manifest.ts new file mode 100644 index 0000000000..78c0818c7d --- /dev/null +++ b/webapp/packages/plugin-tools-panel/src/manifest.ts @@ -0,0 +1,21 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 type { PluginManifest } from '@cloudbeaver/core-di'; + +import { PluginBootstrap } from './PluginBootstrap'; +import { ToolsPanelService } from './ToolsPanel/ToolsPanelService'; + + +export const toolsPanelPlugin: PluginManifest = { + info: { name: 'Tools panel plugin' }, + providers: [ + ToolsPanelService, + PluginBootstrap, + ], +}; \ No newline at end of file diff --git a/webapp/packages/plugin-tools-panel/tsconfig.json b/webapp/packages/plugin-tools-panel/tsconfig.json new file mode 100644 index 0000000000..ad14f68a20 --- /dev/null +++ b/webapp/packages/plugin-tools-panel/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "composite": true + }, + "include": [ + "src" + ], + "exclude": [ + "**/node_modules", + "**/.*/" + ], + "references": [{ "path": "../*" }] +} \ No newline at end of file diff --git a/webapp/packages/plugin-top-app-bar/.gitignore b/webapp/packages/plugin-top-app-bar/.gitignore new file mode 100644 index 0000000000..15bc16c7c3 --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/.gitignore @@ -0,0 +1,17 @@ +# dependencies +/node_modules + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/plugin-top-app-bar/package.json b/webapp/packages/plugin-top-app-bar/package.json new file mode 100644 index 0000000000..7780c27cd8 --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/package.json @@ -0,0 +1,46 @@ +{ + "name": "@cloudbeaver/plugin-top-app-bar", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "types": "src/index.ts", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config.js", + "postbuild": "tsc", + "lint": "eslint ./src/ --ext .ts,.tsx", + "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" + }, + "peerDependencies": { + "@cloudbeaver/core-administration": "~0.1.0", + "@cloudbeaver/core-authentication": "~0.1.0", + "@cloudbeaver/core-blocks": "~0.1.0", + "@cloudbeaver/core-connections": "~0.1.0", + "@cloudbeaver/core-di": "~0.1.0", + "@cloudbeaver/core-dialogs": "~0.1.0", + "@cloudbeaver/core-events": "~0.1.0", + "@cloudbeaver/core-executor": "~0.1.0", + "@cloudbeaver/core-extensions": "~0.1.0", + "@cloudbeaver/core-localization": "~0.1.0", + "@cloudbeaver/core-notifications": "~0.1.0", + "@cloudbeaver/core-plugin": "~0.1.0", + "@cloudbeaver/core-product": "~0.1.0", + "@cloudbeaver/core-root": "~0.1.0", + "@cloudbeaver/core-routing": "~0.1.0", + "@cloudbeaver/core-sdk": "~0.1.0", + "@cloudbeaver/core-settings": "~0.1.0", + "@cloudbeaver/core-theming": "~0.1.0", + "@cloudbeaver/core-ui": "~0.1.0", + "@cloudbeaver/core-utils": "~0.1.0", + "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-version": "~0.1.0", + "@cloudbeaver/plugin-settings-menu": "~0.1.0", + "react": "~18.x.x", + "mobx": "~6.x.x", + "mobx-react-lite": "~3.x.x", + "reshadow": "~0.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/plugin-top-app-bar/src/PluginBootstrap.ts b/webapp/packages/plugin-top-app-bar/src/PluginBootstrap.ts new file mode 100644 index 0000000000..e2c3c8696c --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/src/PluginBootstrap.ts @@ -0,0 +1,21 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { Bootstrap, injectable } from '@cloudbeaver/core-di'; + +@injectable() +export class PluginBootstrap extends Bootstrap { + constructor() { + super(); + } + + register(): void | Promise { + } + + load(): void | Promise { } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts b/webapp/packages/plugin-top-app-bar/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts similarity index 83% rename from webapp/packages/core-app/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts index 31505214b7..3feef98d55 100644 --- a/webapp/packages/core-app/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/AdministrationTopAppBarBootstrapService.ts @@ -14,8 +14,8 @@ import { Logo } from './Logo'; @injectable() export class AdministrationTopAppBarBootstrapService extends Bootstrap { constructor( - private administrationTopAppBarService: AdministrationTopAppBarService, - private wizardTopAppBarService: WizardTopAppBarService + private readonly administrationTopAppBarService: AdministrationTopAppBarService, + private readonly wizardTopAppBarService: WizardTopAppBarService ) { super(); } diff --git a/webapp/packages/core-app/src/TopNavBar/Fill.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Fill.tsx similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/Fill.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/Fill.tsx diff --git a/webapp/packages/core-app/src/TopNavBar/Logo.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx similarity index 95% rename from webapp/packages/core-app/src/TopNavBar/Logo.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx index 09de182d10..c735100b50 100644 --- a/webapp/packages/core-app/src/TopNavBar/Logo.tsx +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/Logo.tsx @@ -12,8 +12,7 @@ import { AppLogo } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { ServerService } from '@cloudbeaver/core-root'; import { ScreenService } from '@cloudbeaver/core-routing'; - -import { useAppVersion } from '../useAppVersion'; +import { useAppVersion } from '@cloudbeaver/plugin-version'; export const Logo = observer(function Logo() { const serverService = useService(ServerService); diff --git a/webapp/packages/core-app/src/TopNavBar/MainMenu/MainMenu.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/MainMenu/MainMenu.tsx similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/MainMenu/MainMenu.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/MainMenu/MainMenu.tsx diff --git a/webapp/packages/core-app/src/TopNavBar/MainMenu/MainMenuService.ts b/webapp/packages/plugin-top-app-bar/src/TopNavBar/MainMenu/MainMenuService.ts similarity index 94% rename from webapp/packages/core-app/src/TopNavBar/MainMenu/MainMenuService.ts rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/MainMenu/MainMenuService.ts index f6f9b05c32..bd535ca40d 100644 --- a/webapp/packages/core-app/src/TopNavBar/MainMenu/MainMenuService.ts +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/MainMenu/MainMenuService.ts @@ -19,8 +19,8 @@ export enum EMainMenu { export class MainMenuService { readonly onConnectionClick: ISyncExecutor; - private menuOptions = new StaticMenu(); - private mainMenuToken = 'mainMenu'; + private readonly menuOptions = new StaticMenu(); + private readonly mainMenuToken = 'mainMenu'; constructor() { this.onConnectionClick = new SyncExecutor(); diff --git a/webapp/packages/core-app/src/TopNavBar/TopNavBar.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/TopNavBar.tsx similarity index 72% rename from webapp/packages/core-app/src/TopNavBar/TopNavBar.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/TopNavBar.tsx index e99b0e0a85..05e6666be8 100644 --- a/webapp/packages/core-app/src/TopNavBar/TopNavBar.tsx +++ b/webapp/packages/plugin-top-app-bar/src/TopNavBar/TopNavBar.tsx @@ -9,14 +9,14 @@ import { Placeholder, TopAppBar } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; -import { TopNavService } from './TopNavBarService'; +import { TopNavService } from './TopNavService'; export const TopNavBar = function TopNavBar() { - const topNavBarService = useService(TopNavService); + const topNavService = useService(TopNavService); return ( - + ); }; \ No newline at end of file diff --git a/webapp/packages/core-app/src/TopNavBar/TopNavBarService.ts b/webapp/packages/plugin-top-app-bar/src/TopNavBar/TopNavService.ts similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/TopNavBarService.ts rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/TopNavService.ts diff --git a/webapp/packages/core-app/src/TopNavBar/shared/TopMenuItem.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/TopMenuItem.tsx similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/shared/TopMenuItem.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/TopMenuItem.tsx diff --git a/webapp/packages/core-app/src/TopNavBar/shared/TopNavButton.tsx b/webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/TopNavButton.tsx similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/shared/TopNavButton.tsx rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/TopNavButton.tsx diff --git a/webapp/packages/core-app/src/TopNavBar/shared/topMenuStyles.ts b/webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/topMenuStyles.ts similarity index 100% rename from webapp/packages/core-app/src/TopNavBar/shared/topMenuStyles.ts rename to webapp/packages/plugin-top-app-bar/src/TopNavBar/shared/topMenuStyles.ts diff --git a/webapp/packages/plugin-top-app-bar/src/index.ts b/webapp/packages/plugin-top-app-bar/src/index.ts new file mode 100644 index 0000000000..3ec739bd09 --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/src/index.ts @@ -0,0 +1,11 @@ +export * from './TopNavBar/MainMenu/MainMenuService'; +export * from './TopNavBar/shared/TopNavButton'; +export * from './TopNavBar/TopNavService'; +export * from './TopNavBar/AdministrationTopAppBarBootstrapService'; +export * from './TopNavBar/shared/topMenuStyles'; +export * from './TopNavBar/Logo'; +export * from './TopNavBar/TopNavBar'; + +import { topAppBarPlugin } from './manifest'; + +export default topAppBarPlugin; \ No newline at end of file diff --git a/webapp/packages/plugin-top-app-bar/src/manifest.ts b/webapp/packages/plugin-top-app-bar/src/manifest.ts new file mode 100644 index 0000000000..c3ec12bc9d --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/src/manifest.ts @@ -0,0 +1,24 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 type { PluginManifest } from '@cloudbeaver/core-di'; + +import { PluginBootstrap } from './PluginBootstrap'; +import { AdministrationTopAppBarBootstrapService } from './TopNavBar/AdministrationTopAppBarBootstrapService'; +import { MainMenuService } from './TopNavBar/MainMenu/MainMenuService'; +import { TopNavService } from './TopNavBar/TopNavService'; + +export const topAppBarPlugin: PluginManifest = { + info: { name: 'Top App Bar plugin' }, + providers: [ + PluginBootstrap, + MainMenuService, + TopNavService, + AdministrationTopAppBarBootstrapService, + ], +}; \ No newline at end of file diff --git a/webapp/packages/plugin-top-app-bar/tsconfig.json b/webapp/packages/plugin-top-app-bar/tsconfig.json new file mode 100644 index 0000000000..ad14f68a20 --- /dev/null +++ b/webapp/packages/plugin-top-app-bar/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "composite": true + }, + "include": [ + "src" + ], + "exclude": [ + "**/node_modules", + "**/.*/" + ], + "references": [{ "path": "../*" }] +} \ No newline at end of file diff --git a/webapp/packages/plugin-user-profile/package.json b/webapp/packages/plugin-user-profile/package.json index 463cb6916f..ba26ff2ddb 100644 --- a/webapp/packages/plugin-user-profile/package.json +++ b/webapp/packages/plugin-user-profile/package.json @@ -37,6 +37,7 @@ "@cloudbeaver/core-ui": "~0.1.0", "@cloudbeaver/core-utils": "~0.1.0", "@cloudbeaver/core-view": "~0.1.0", + "@cloudbeaver/plugin-top-app-bar": "~0.1.0", "react": "~18.x.x", "mobx": "~6.x.x", "mobx-react-lite": "~3.x.x", diff --git a/webapp/packages/plugin-user-profile/src/PluginBootstrap.ts b/webapp/packages/plugin-user-profile/src/PluginBootstrap.ts index 8c28886ed7..d27d52d71a 100644 --- a/webapp/packages/plugin-user-profile/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-user-profile/src/PluginBootstrap.ts @@ -6,8 +6,8 @@ * you may not use this file except in compliance with the License. */ -import { TopNavService } from '@cloudbeaver/core-app'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; +import { TopNavService } from '@cloudbeaver/plugin-top-app-bar'; import { UserMenu } from './UserMenu/UserMenu'; diff --git a/webapp/packages/plugin-user-profile/src/UserMenu/UserMenu.tsx b/webapp/packages/plugin-user-profile/src/UserMenu/UserMenu.tsx index a7022e07b4..54d5de2d8c 100644 --- a/webapp/packages/plugin-user-profile/src/UserMenu/UserMenu.tsx +++ b/webapp/packages/plugin-user-profile/src/UserMenu/UserMenu.tsx @@ -9,13 +9,13 @@ import { observer } from 'mobx-react-lite'; import styled from 'reshadow'; -import { topMenuStyles } from '@cloudbeaver/core-app'; import { AuthInfoService, DATA_CONTEXT_USER } from '@cloudbeaver/core-authentication'; import { Icon } from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { useStyles } from '@cloudbeaver/core-theming'; import { ContextMenu } from '@cloudbeaver/core-ui'; import { useMenu } from '@cloudbeaver/core-view'; +import { topMenuStyles } from '@cloudbeaver/plugin-top-app-bar'; import { UserInfo } from '../UserInfo'; import { MENU_USER_PROFILE } from './MENU_USER_PROFILE'; diff --git a/webapp/packages/plugin-version/.gitignore b/webapp/packages/plugin-version/.gitignore new file mode 100644 index 0000000000..15bc16c7c3 --- /dev/null +++ b/webapp/packages/plugin-version/.gitignore @@ -0,0 +1,17 @@ +# dependencies +/node_modules + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/plugin-version/package.json b/webapp/packages/plugin-version/package.json new file mode 100644 index 0000000000..c6ca99093f --- /dev/null +++ b/webapp/packages/plugin-version/package.json @@ -0,0 +1,25 @@ +{ + "name": "@cloudbeaver/plugin-version", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "types": "src/index.ts", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config.js", + "postbuild": "tsc", + "lint": "eslint ./src/ --ext .ts,.tsx", + "lint-fix": "eslint ./src/ --ext .ts,.tsx --fix" + }, + "peerDependencies": { + "@cloudbeaver/core-di": "~0.1.0", + "@cloudbeaver/core-version": "~0.1.0", + "react": "~18.x.x", + "mobx": "~6.x.x", + "mobx-react-lite": "~3.x.x", + "reshadow": "~0.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/plugin-version/src/PluginBootstrap.ts b/webapp/packages/plugin-version/src/PluginBootstrap.ts new file mode 100644 index 0000000000..9a71470d48 --- /dev/null +++ b/webapp/packages/plugin-version/src/PluginBootstrap.ts @@ -0,0 +1,20 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 { Bootstrap, injectable } from '@cloudbeaver/core-di'; + +@injectable() +export class PluginBootstrap extends Bootstrap { + constructor() { + super(); + } + + register(): void | Promise { } + + load(): void | Promise { } +} \ No newline at end of file diff --git a/webapp/packages/plugin-version/src/index.ts b/webapp/packages/plugin-version/src/index.ts new file mode 100644 index 0000000000..dac9cafe44 --- /dev/null +++ b/webapp/packages/plugin-version/src/index.ts @@ -0,0 +1,5 @@ +export * from './useAppVersion'; + +import { versionPlugin } from './manifest'; + +export default versionPlugin; \ No newline at end of file diff --git a/webapp/packages/plugin-version/src/manifest.ts b/webapp/packages/plugin-version/src/manifest.ts new file mode 100644 index 0000000000..ee8856d6b9 --- /dev/null +++ b/webapp/packages/plugin-version/src/manifest.ts @@ -0,0 +1,18 @@ +/* + * CloudBeaver - Cloud Database Manager + * Copyright (C) 2020-2022 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 type { PluginManifest } from '@cloudbeaver/core-di'; + +import { PluginBootstrap } from './PluginBootstrap'; + +export const versionPlugin: PluginManifest = { + info: { name: 'Version plugin' }, + providers: [ + PluginBootstrap, + ], +}; \ No newline at end of file diff --git a/webapp/packages/core-app/src/useAppVersion.tsx b/webapp/packages/plugin-version/src/useAppVersion.tsx similarity index 100% rename from webapp/packages/core-app/src/useAppVersion.tsx rename to webapp/packages/plugin-version/src/useAppVersion.tsx diff --git a/webapp/packages/plugin-version/tsconfig.json b/webapp/packages/plugin-version/tsconfig.json new file mode 100644 index 0000000000..ad14f68a20 --- /dev/null +++ b/webapp/packages/plugin-version/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "lib", + "composite": true + }, + "include": [ + "src" + ], + "exclude": [ + "**/node_modules", + "**/.*/" + ], + "references": [{ "path": "../*" }] +} \ No newline at end of file diff --git a/webapp/packages/product-default/package.json b/webapp/packages/product-default/package.json index 10f061f846..cc223dc9c9 100644 --- a/webapp/packages/product-default/package.json +++ b/webapp/packages/product-default/package.json @@ -22,6 +22,8 @@ "@cloudbeaver/core-bootstrap": "0.1.0", "@cloudbeaver/core-di": "0.1.0", "@cloudbeaver/core-product": "0.1.0", + "@cloudbeaver/plugin-top-app-bar": "0.1.0", + "@cloudbeaver/plugin-version": "0.1.0", "@cloudbeaver/plugin-datasource-context-switch": "0.1.0", "@cloudbeaver/plugin-log-viewer": "0.1.0", "@cloudbeaver/plugin-navigation-tree": "0.1.0", diff --git a/webapp/packages/product-default/src/index.ts b/webapp/packages/product-default/src/index.ts index bc5bdc5d54..0b75ef65e3 100644 --- a/webapp/packages/product-default/src/index.ts +++ b/webapp/packages/product-default/src/index.ts @@ -18,11 +18,13 @@ import gisViewer from '@cloudbeaver/plugin-gis-viewer'; import help from '@cloudbeaver/plugin-help'; import localization from '@cloudbeaver/plugin-localization'; import logViewer from '@cloudbeaver/plugin-log-viewer'; +import navigationTabs from '@cloudbeaver/plugin-navigation-tabs'; import navigationTree from '@cloudbeaver/plugin-navigation-tree'; import objectViewer from '@cloudbeaver/plugin-object-viewer'; import productPlugin from '@cloudbeaver/plugin-product'; import resourceManager from '@cloudbeaver/plugin-resource-manager'; import resourceManagerAdministration from '@cloudbeaver/plugin-resource-manager-administration'; +import root from '@cloudbeaver/plugin-root'; import settingsMenu from '@cloudbeaver/plugin-settings-menu'; import settingsMenuAdministration from '@cloudbeaver/plugin-settings-menu-administration'; import sqlEditor from '@cloudbeaver/plugin-sql-editor'; @@ -30,8 +32,11 @@ import sqlEditorTab from '@cloudbeaver/plugin-sql-editor-navigation-tab'; import sqlEditorResource from '@cloudbeaver/plugin-sql-editor-navigation-tab-resource'; import sqlEditorScreen from '@cloudbeaver/plugin-sql-editor-screen'; import theme from '@cloudbeaver/plugin-theme'; +import toolsPanel from '@cloudbeaver/plugin-tools-panel'; +import topAppBar from '@cloudbeaver/plugin-top-app-bar'; import userProfile from '@cloudbeaver/plugin-user-profile'; import userProfileAdministration from '@cloudbeaver/plugin-user-profile-administration'; +import version from '@cloudbeaver/plugin-version'; import versionUpdate from '@cloudbeaver/plugin-version-update-administration'; import { defaultProductManifest } from './manifest'; @@ -69,6 +74,11 @@ const PLUGINS: PluginManifest[] = [ logViewer, navigationTree, datasourceContextSwitch, + topAppBar, + version, + navigationTabs, + root, + toolsPanel, ]; bootstrap(PLUGINS);