diff --git a/webapp/packages/core-app/package.json b/webapp/packages/core-app/package.json index 6b0219891b..6c7568c96a 100644 --- a/webapp/packages/core-app/package.json +++ b/webapp/packages/core-app/package.json @@ -19,6 +19,7 @@ }, "peerDependencies": { "@cloudbeaver/core-di": "^0.1.0", + "@cloudbeaver/core-connections": "^0.1.0", "@cloudbeaver/core-plugin": "^0.1.0", "@cloudbeaver/core-localization": "^0.1.0", "@cloudbeaver/core-blocks": "^0.1.0", diff --git a/webapp/packages/core-app/src/Body.tsx b/webapp/packages/core-app/src/Body.tsx index df47c16ee6..93460c9ac0 100644 --- a/webapp/packages/core-app/src/Body.tsx +++ b/webapp/packages/core-app/src/Body.tsx @@ -11,9 +11,9 @@ import styled, { css } from 'reshadow'; import { useService } from '@cloudbeaver/core-di'; import { DialogsPortal } from '@cloudbeaver/core-dialogs'; +import { Notifications } from '@cloudbeaver/core-notifications'; import { useStyles, useTheme } from '@cloudbeaver/core-theming'; -import { Notifications } from './Notifications/Notifications'; import { ScreenService } from './Screen/ScreenService'; const bodyStyles = css` diff --git a/webapp/packages/core-app/src/NavigationTree/NavigationTreeNode/useNavigationTree.ts b/webapp/packages/core-app/src/NavigationTree/NavigationTreeNode/useNavigationTree.ts index 0c7c4d6770..1a51aa1cf2 100644 --- a/webapp/packages/core-app/src/NavigationTree/NavigationTreeNode/useNavigationTree.ts +++ b/webapp/packages/core-app/src/NavigationTree/NavigationTreeNode/useNavigationTree.ts @@ -8,9 +8,9 @@ import { useState, useCallback, useEffect } from 'react'; +import { useConnectionInfo } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; -import { useConnectionInfo } from '../../shared/ConnectionsManager/useConnectionInfo'; import { NavNode } from '../../shared/NodesManager/EntityTypes'; import { EObjectFeature } from '../../shared/NodesManager/EObjectFeature'; import { NodeManagerUtils } from '../../shared/NodesManager/NodeManagerUtils'; diff --git a/webapp/packages/core-app/src/NavigationTree/NavigationTreeService.ts b/webapp/packages/core-app/src/NavigationTree/NavigationTreeService.ts index 690b3e00d6..5228962b8e 100644 --- a/webapp/packages/core-app/src/NavigationTree/NavigationTreeService.ts +++ b/webapp/packages/core-app/src/NavigationTree/NavigationTreeService.ts @@ -9,11 +9,11 @@ import { observable } from 'mobx'; import { Subject, Observable } from 'rxjs'; +import { ConnectionAuthService } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { IActiveView } from '@cloudbeaver/core-view'; -import { ConnectionAuthService } from '../shared/ConnectionsManager/ConnectionAuthService'; import { EObjectFeature } from '../shared/NodesManager/EObjectFeature'; import { NavNodeExtensionsService } from '../shared/NodesManager/NavNodeExtensionsService'; import { ROOT_NODE_PATH } from '../shared/NodesManager/NavNodeInfoResource'; diff --git a/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSchemaManagerService.ts b/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSchemaManagerService.ts index 3f73ff61b4..ff3f4ee0b7 100644 --- a/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSchemaManagerService.ts +++ b/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSchemaManagerService.ts @@ -8,16 +8,18 @@ import { computed, observable } from 'mobx'; +import { + ConnectionInfoResource, + ConnectionsManagerService, + ObjectContainer, + DBDriverResource, + isConnectionProvider, IConnectionProvider, + isConnectionSetter, IConnectionSetter +} from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { IExtension } from '@cloudbeaver/core-extensions'; -import { ConnectionInfoResource } from '../../shared/ConnectionsManager/ConnectionInfoResource'; -import { ConnectionsManagerService } from '../../shared/ConnectionsManager/ConnectionsManagerService'; -import { ObjectContainer } from '../../shared/ConnectionsManager/ContainerResource'; -import { DBDriverResource } from '../../shared/ConnectionsManager/DBDriverResource'; -import { isConnectionProvider, IConnectionProvider } from '../../shared/ConnectionsManager/extensions/IConnectionProvider'; -import { isConnectionSetter, IConnectionSetter } from '../../shared/ConnectionsManager/extensions/IConnectionSetter'; import { ITab } from '../../shared/NavigationTabs/ITab'; import { NavigationTabsService } from '../../shared/NavigationTabs/NavigationTabsService'; import { IObjectCatalogProvider, isObjectCatalogProvider } from '../../shared/NodesManager/extensions/IObjectCatalogProvider'; diff --git a/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSelector/ConnectionSelectorController.ts b/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSelector/ConnectionSelectorController.ts index 27e7fcdb2f..3bd058a8a6 100644 --- a/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSelector/ConnectionSelectorController.ts +++ b/webapp/packages/core-app/src/TopNavBar/ConnectionSchemaManager/ConnectionSelector/ConnectionSelectorController.ts @@ -8,11 +8,14 @@ import { computed } from 'mobx'; +import { + ConnectionInfoResource, + DBDriverResource, + Connection +} from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { ComputedMenuItemModel, ComputedMenuPanelModel, IMenuItem } from '@cloudbeaver/core-dialogs'; -import { Connection, ConnectionInfoResource } from '../../../shared/ConnectionsManager/ConnectionInfoResource'; -import { DBDriverResource } from '../../../shared/ConnectionsManager/DBDriverResource'; import { EObjectFeature } from '../../../shared/NodesManager/EObjectFeature'; import { NodeManagerUtils } from '../../../shared/NodesManager/NodeManagerUtils'; import { ConnectionSchemaManagerService } from '../ConnectionSchemaManagerService'; diff --git a/webapp/packages/core-app/src/index.ts b/webapp/packages/core-app/src/index.ts index bb12afe2a9..1e522c3f08 100644 --- a/webapp/packages/core-app/src/index.ts +++ b/webapp/packages/core-app/src/index.ts @@ -8,15 +8,7 @@ export * from './TopNavBar/MainMenu/MainMenuService'; export * from './TopNavBar/SettingsMenu/SettingsMenuService'; export * from './TopNavBar/ConnectionSchemaManager/ConnectionSchemaManagerService'; export * from './TopNavBar/TopNavBarService'; -export * from './shared/ConnectionsManager/ConnectionAuthService'; -export * from './shared/ConnectionsManager/ConnectionInfoResource'; -export * from './shared/ConnectionsManager/ConnectionsManagerService'; -export * from './shared/ConnectionsManager/ContainerResource'; -export * from './shared/ConnectionsManager/DatabaseAuthModelsResource'; -export * from './shared/ConnectionsManager/DBDriverResource'; -export * from './shared/ConnectionsManager/ConnectionDialogsService'; -export * from './shared/ConnectionsManager/extensions/IConnectionProvider'; -export * from './shared/ConnectionsManager/extensions/IConnectionSetter'; +export * from './shared/NodesManager/ConnectionDialogsService'; export * from './shared/NodesManager/extensions/IObjectCatalogProvider'; export * from './shared/NodesManager/extensions/IObjectCatalogSetter'; export * from './shared/NodesManager/extensions/IObjectSchemaProvider'; @@ -30,13 +22,10 @@ export * from './shared/NodesManager/NodeManagerUtils'; export * from './shared/Navigation/NavigationService'; export * from './shared/NavigationTabs/NavigationTabsService'; export * from './shared/NavigationTabs/TabNavigationContext'; -export * from './shared/ObjectPropertyInfoForm/ObjectPropertyInfoForm'; export * from './shared/ToolsPanel/LogViewTab/LogViewerMenuService'; export * from './shared/ToolsPanel/LogViewTab/LogViewerService'; export * from './NavigationTree/NavigationTreeService'; export * from './NavigationTree/NavigationTreeContextMenuService'; -export * from './Notifications/NotificationsItem/Snackbar/styles'; -export * from './Notifications/NotificationsItem/Snackbar/NotificationMark'; // Models export * from './shared/NavigationTabs/ITab'; @@ -46,12 +35,9 @@ export * from './shared/TabEntity/TabEntity'; // Enums export * from './shared/NodesManager/ENodeFeature'; export * from './shared/NodesManager/EObjectFeature'; -export * from './shared/ConnectionsManager/EConnectionFeature'; // hooks export * from './shared/useChildren'; -export * from './shared/ConnectionsManager/useConnectionInfo'; -export * from './shared/ConnectionsManager/useDBDriver'; export * from './shared/NavigationTabs/NavigationTabsBar/Tabs/useTab'; export * from './shared/NodesManager/useDatabaseObjectInfo'; export * from './shared/NodesManager/useNode'; @@ -59,7 +45,6 @@ export * from './shared/InlineEditor/InlineEditor'; // components export * from './Body'; -export * from './Notifications/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog'; export * from './TopNavBar/SettingsMenu/SettingsMenu'; export * from './TopNavBar/Logo'; diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionDialogsService.ts b/webapp/packages/core-app/src/shared/NodesManager/ConnectionDialogsService.ts similarity index 85% rename from webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionDialogsService.ts rename to webapp/packages/core-app/src/shared/NodesManager/ConnectionDialogsService.ts index d1254e5e8c..518be18daf 100644 --- a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionDialogsService.ts +++ b/webapp/packages/core-app/src/shared/NodesManager/ConnectionDialogsService.ts @@ -6,17 +6,15 @@ * you may not use this file except in compliance with the License. */ +import { ConnectionInfoResource, ConnectionsManagerService, EConnectionFeature } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { ContextMenuService, IMenuContext } from '@cloudbeaver/core-dialogs'; import { NavigationTreeContextMenuService } from '../../NavigationTree/NavigationTreeContextMenuService'; import { EMainMenu, MainMenuService } from '../../TopNavBar/MainMenu/MainMenuService'; -import { NavNode } from '../NodesManager/EntityTypes'; -import { EObjectFeature } from '../NodesManager/EObjectFeature'; -import { NodeManagerUtils } from '../NodesManager/NodeManagerUtils'; -import { ConnectionInfoResource } from './ConnectionInfoResource'; -import { ConnectionsManagerService } from './ConnectionsManagerService'; -import { EConnectionFeature } from './EConnectionFeature'; +import { NavNode } from './EntityTypes'; +import { EObjectFeature } from './EObjectFeature'; +import { NodeManagerUtils } from './NodeManagerUtils'; @injectable() export class ConnectionDialogsService { @@ -67,7 +65,9 @@ export class ConnectionDialogsService { title: 'Disconnect', onClick: (context: IMenuContext) => { const node = context.data; - this.connectionsManagerService.closeNavNodeConnectionAsync(node.id); + this.connectionsManagerService.closeConnectionAsync( + NodeManagerUtils.connectionNodeIdToConnectionId(node.id) + ); }, } ); @@ -88,7 +88,9 @@ export class ConnectionDialogsService { title: 'Delete', onClick: (context: IMenuContext) => { const node = context.data; - this.connectionsManagerService.deleteNavNodeConnectionAsync(node.id); + this.connectionsManagerService.deleteConnection( + NodeManagerUtils.connectionNodeIdToConnectionId(node.id) + ); }, } ); diff --git a/webapp/packages/core-app/src/shared/NodesManager/NavNodeExtensionsService.ts b/webapp/packages/core-app/src/shared/NodesManager/NavNodeExtensionsService.ts index cb92e5ef2d..23d27b7e2b 100644 --- a/webapp/packages/core-app/src/shared/NodesManager/NavNodeExtensionsService.ts +++ b/webapp/packages/core-app/src/shared/NodesManager/NavNodeExtensionsService.ts @@ -6,10 +6,10 @@ * you may not use this file except in compliance with the License. */ +import { connectionProvider } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { IExtension } from '@cloudbeaver/core-extensions'; -import { connectionProvider } from '../ConnectionsManager/extensions/IConnectionProvider'; import { objectCatalogProvider } from './extensions/IObjectCatalogProvider'; import { objectSchemaProvider } from './extensions/IObjectSchemaProvider'; import { NavNodeManagerService } from './NavNodeManagerService'; diff --git a/webapp/packages/core-app/src/shared/NodesManager/NavNodeManagerService.ts b/webapp/packages/core-app/src/shared/NodesManager/NavNodeManagerService.ts index c0f41742ec..3d62bdd3f9 100644 --- a/webapp/packages/core-app/src/shared/NodesManager/NavNodeManagerService.ts +++ b/webapp/packages/core-app/src/shared/NodesManager/NavNodeManagerService.ts @@ -6,13 +6,16 @@ * you may not use this file except in compliance with the License. */ -import { injectable } from '@cloudbeaver/core-di'; +import { + ConnectionAuthService, Connection, ConnectionInfoResource, EConnectionFeature +} from '@cloudbeaver/core-connections'; +import { injectable, Bootstrap } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; -import { PermissionsService, EPermission } from '@cloudbeaver/core-root'; -import { GraphQLService, resourceKeyList } from '@cloudbeaver/core-sdk'; +import { PermissionsService, EPermission, SessionResource } from '@cloudbeaver/core-root'; +import { + GraphQLService, resourceKeyList, isResourceKeyList, ResourceKey +} from '@cloudbeaver/core-sdk'; -import { ConnectionAuthService } from '../ConnectionsManager/ConnectionAuthService'; -import { Connection } from '../ConnectionsManager/ConnectionInfoResource'; import { INavigator } from '../Navigation/INavigator'; import { IContextProvider } from '../Navigation/NavigationContext'; import { NavigationService } from '../Navigation/NavigationService'; @@ -84,19 +87,21 @@ export interface INodeNavigationData { } @injectable() -export class NavNodeManagerService { +export class NavNodeManagerService extends Bootstrap { readonly navigator!: INavigator; constructor( private graphQLService: GraphQLService, private navigationService: NavigationService, private permissionsService: PermissionsService, + readonly connectionInfo: ConnectionInfoResource, readonly navTree: NavTreeResource, readonly navNodeInfoResource: NavNodeInfoResource, private connectionAuthService: ConnectionAuthService, private notificationService: NotificationService, + private sessionResource: SessionResource, ) { - + super(); this.navigator = this.navigationService.createNavigator( data => data.nodeId, this.navigateHandler.bind(this), @@ -108,6 +113,14 @@ export class NavNodeManagerService { ); } + register() { + this.connectionInfo.onItemAdd.subscribe(this.connectionUpdateHandler.bind(this)); + this.connectionInfo.onItemDelete.subscribe(this.connectionRemoveHandler.bind(this)); + this.sessionResource.onDataUpdate.subscribe(this.updateRootChildren.bind(this)); + } + + load() {} + async navToNode(nodeId: string, parentId: string, folderId?: string) { await this.navigator.navigateTo({ type: NavigationType.open, @@ -311,6 +324,48 @@ export class NavNodeManagerService { }; } + private async connectionUpdateHandler(key: ResourceKey) { + const keys = isResourceKeyList(key) ? key.list : [key]; + + for (const id of keys) { + const nodeId = NodeManagerUtils.connectionIdToConnectionNodeId(id); + this.markTreeOutdated(nodeId); + + // addOpenedConnection + const connectionInfo = this.connectionInfo.get(id); + + if (!connectionInfo?.connected) { + this.removeTree(nodeId); + } + + await this.refreshNode(nodeId); + + if (connectionInfo?.features.includes(EConnectionFeature.temporary)) { + + const tree = this.navTree.get(ROOT_NODE_PATH); + + if (!tree?.includes(nodeId)) { + this.navTree.unshiftToNode(ROOT_NODE_PATH, [nodeId]); + } + } + } + } + + private async connectionRemoveHandler(key: ResourceKey) { + const keys = isResourceKeyList(key) ? key.list : [key]; + + for (const id of keys) { + // deleteConnection + const navNodeId = NodeManagerUtils.connectionIdToConnectionNodeId(id); + + const node = this.getNode(navNodeId); + if (!node) { + return; + } + this.navTree.deleteInNode(node.parentId, [navNodeId]); + } + } + private async navigateHandler(contexts: IContextProvider) { const nodeInfo = await contexts.getContext(this.navigationNavNodeContext); diff --git a/webapp/packages/core-app/src/shared/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx b/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx rename to webapp/packages/core-blocks/src/ObjectPropertyInfoForm/ObjectPropertyInfoForm.tsx diff --git a/webapp/packages/core-app/src/shared/ObjectPropertyInfoForm/formStyles.ts b/webapp/packages/core-blocks/src/ObjectPropertyInfoForm/formStyles.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ObjectPropertyInfoForm/formStyles.ts rename to webapp/packages/core-blocks/src/ObjectPropertyInfoForm/formStyles.ts diff --git a/webapp/packages/core-blocks/src/index.ts b/webapp/packages/core-blocks/src/index.ts index 2ed8414288..0dceba52e6 100644 --- a/webapp/packages/core-blocks/src/index.ts +++ b/webapp/packages/core-blocks/src/index.ts @@ -4,6 +4,7 @@ export * from './ItemList'; export * from './layout/AppLogo'; export * from './layout/TopAppBar'; export * from './Loader/Loader'; +export * from './ObjectPropertyInfoForm/ObjectPropertyInfoForm'; export * from './Placeholder/Placeholder'; export * from './Placeholder/PlaceholderContainer'; export * from './PropertiesTable'; diff --git a/webapp/packages/core-bootstrap/package.json b/webapp/packages/core-bootstrap/package.json index dba30cd31f..2efa4dea51 100644 --- a/webapp/packages/core-bootstrap/package.json +++ b/webapp/packages/core-bootstrap/package.json @@ -16,11 +16,13 @@ "dependencies": { "@cloudbeaver/core-app": "^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-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", diff --git a/webapp/packages/core-bootstrap/src/AppBootstrap.ts b/webapp/packages/core-bootstrap/src/AppBootstrap.ts index 82173f6e09..a2c42d4e0c 100644 --- a/webapp/packages/core-bootstrap/src/AppBootstrap.ts +++ b/webapp/packages/core-bootstrap/src/AppBootstrap.ts @@ -18,7 +18,6 @@ import { import { injectable } from '@cloudbeaver/core-di'; import { SessionExpireService } from '@cloudbeaver/core-dialogs'; import { ExceptionsCatcherService } from '@cloudbeaver/core-events'; -import { LocalizationService } from '@cloudbeaver/core-localization'; import { ThemeService } from '@cloudbeaver/core-theming'; /** diff --git a/webapp/packages/core-bootstrap/src/manifest.ts b/webapp/packages/core-bootstrap/src/manifest.ts index ae82ecd7b6..c28ef6fe43 100644 --- a/webapp/packages/core-bootstrap/src/manifest.ts +++ b/webapp/packages/core-bootstrap/src/manifest.ts @@ -7,15 +7,22 @@ */ import { - ConnectionDialogsService, ConnectionsManagerService, + ConnectionDialogsService, MainMenuService, NavigationService, NavigationTreeService, NavNodeManagerService, DBObjectService, NavNodeExtensionsService, NavNodeInfoResource, NavTreeResource, - ConnectionSchemaManagerService, ConnectionInfoResource, ContainerResource, - DBDriverResource, NavigationTabsService, DatabaseAuthModelsResource, ConnectionAuthService, - NavigationTreeContextMenuService, + ConnectionSchemaManagerService, + NavigationTabsService, NavigationTreeContextMenuService, SettingsMenuService, LogViewerService, LogViewerMenuService, TopNavService, RouterService, ScreenService, AppScreenService, CoreSettingsService } from '@cloudbeaver/core-app'; +import { + ConnectionsManagerService, + ConnectionInfoResource, + ContainerResource, + DBDriverResource, + DatabaseAuthModelsResource, + ConnectionAuthService +} from '@cloudbeaver/core-connections'; import { PluginManifest } from '@cloudbeaver/core-di'; import { CommonDialogService, ContextMenuService, SessionExpireService } from '@cloudbeaver/core-dialogs'; import { NotificationService, ExceptionsCatcherService, EventsSettingsService } from '@cloudbeaver/core-events'; diff --git a/webapp/packages/core-connections/.gitignore b/webapp/packages/core-connections/.gitignore new file mode 100644 index 0000000000..99902db863 --- /dev/null +++ b/webapp/packages/core-connections/.gitignore @@ -0,0 +1,21 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/core-connections/package.json b/webapp/packages/core-connections/package.json new file mode 100644 index 0000000000..99a88947fa --- /dev/null +++ b/webapp/packages/core-connections/package.json @@ -0,0 +1,36 @@ +{ + "name": "@cloudbeaver/core-connections", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config", + "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-plugin": "^0.1.0", + "@cloudbeaver/core-localization": "^0.1.0", + "@cloudbeaver/core-notifications": "^0.1.0", + "@cloudbeaver/core-blocks": "^0.1.0", + "@cloudbeaver/core-sdk": "^0.1.0", + "@cloudbeaver/core-theming": "^0.1.0", + "@cloudbeaver/core-dialogs": "^0.1.0", + "@cloudbeaver/core-extensions": "^0.1.0", + "@cloudbeaver/core-settings": "^0.1.0", + "@cloudbeaver/core-utils": "^0.1.0", + "@cloudbeaver/core-view": "^0.1.0", + "react": "^16.x.x", + "react-dom": "^16.x.x", + "reakit": "^1.1.1", + "rxjs": "^6.x.x", + "mobx": "^5.x.x", + "mobx-react": "^6.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionAuthService.ts b/webapp/packages/core-connections/src/ConnectionAuthService.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionAuthService.ts rename to webapp/packages/core-connections/src/ConnectionAuthService.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionInfoResource.ts b/webapp/packages/core-connections/src/ConnectionInfoResource.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionInfoResource.ts rename to webapp/packages/core-connections/src/ConnectionInfoResource.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionsManagerService.ts b/webapp/packages/core-connections/src/ConnectionsManagerService.ts similarity index 66% rename from webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionsManagerService.ts rename to webapp/packages/core-connections/src/ConnectionsManagerService.ts index cb7b82edcd..8f4eef9d7a 100644 --- a/webapp/packages/core-app/src/shared/ConnectionsManager/ConnectionsManagerService.ts +++ b/webapp/packages/core-connections/src/ConnectionsManagerService.ts @@ -11,11 +11,7 @@ import { Subject } from 'rxjs'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { SessionResource } from '@cloudbeaver/core-root'; -import { isResourceKeyList } from '@cloudbeaver/core-sdk'; -import { ROOT_NODE_PATH } from '../NodesManager/NavNodeInfoResource'; -import { NavNodeManagerService } from '../NodesManager/NavNodeManagerService'; -import { NodeManagerUtils } from '../NodesManager/NodeManagerUtils'; import { ConnectionInfoResource, Connection } from './ConnectionInfoResource'; import { ContainerResource, ObjectContainer } from './ContainerResource'; import { EConnectionFeature } from './EConnectionFeature'; @@ -28,33 +24,14 @@ export class ConnectionsManagerService { constructor( readonly connectionInfo: ConnectionInfoResource, readonly connectionObjectContainers: ContainerResource, - private navNodeManagerService: NavNodeManagerService, private sessionResource: SessionResource, private notificationService: NotificationService ) { this.sessionResource.onDataUpdate.subscribe(this.restoreConnections.bind(this)); - this.connectionInfo.onItemAdd.subscribe(async (key) => { - if (isResourceKeyList(key)) { - for (const id of key.list) { - const nodeId = NodeManagerUtils.connectionIdToConnectionNodeId(id); - this.navNodeManagerService - .markTreeOutdated(nodeId); - } - return; - } - const nodeId = NodeManagerUtils.connectionIdToConnectionNodeId(key); - this.navNodeManagerService - .markTreeOutdated(nodeId); - }); } async addOpenedConnection(connection: Connection) { this.addConnection(connection); - - const nodeId = NodeManagerUtils.connectionIdToConnectionNodeId(connection.id); - await this.navNodeManagerService.refreshNode(nodeId); - - this.navNodeManagerService.navTree.unshiftToNode(ROOT_NODE_PATH, [nodeId]); } getObjectContainerById( @@ -80,14 +57,6 @@ export class ConnectionsManagerService { await this.connectionInfo.deleteConnection(id); await this.afterConnectionClose(id); - - const navNodeId = NodeManagerUtils.connectionIdToConnectionNodeId(id); - - const node = this.navNodeManagerService.getNode(navNodeId); - if (!node) { - return; - } - this.navNodeManagerService.navTree.deleteInNode(node.parentId, [navNodeId]); } hasAnyConnection(): boolean { @@ -109,25 +78,11 @@ export class ConnectionsManagerService { try { await this.connectionInfo.close(id); await this.afterConnectionClose(id); - - const navNodeId = NodeManagerUtils.connectionIdToConnectionNodeId(id); - - this.navNodeManagerService.removeTree(navNodeId); - await this.navNodeManagerService.refreshNode(navNodeId); } catch (exception) { this.notificationService.logException(exception, `Can't close connection: ${connection.name}`); } } - async deleteNavNodeConnectionAsync(navNodeId: string): Promise { - await this.deleteConnection(NodeManagerUtils.connectionNodeIdToConnectionId(navNodeId)); - } - - async closeNavNodeConnectionAsync(navNodeId: string): Promise { - const connectionId = NodeManagerUtils.connectionNodeIdToConnectionId(navNodeId); - await this.closeConnectionAsync(connectionId); - } - async loadObjectContainer(connectionId: string, catalogId?: string): Promise { await this.connectionObjectContainers.load({ connectionId, catalogId }); return this.connectionObjectContainers.data.get(connectionId)!; @@ -159,8 +114,6 @@ export class ConnectionsManagerService { await this.afterConnectionClose(connectionId); this.connectionInfo.delete(connectionId); } - - await this.navNodeManagerService.updateRootChildren(); } private addConnection(connection: Connection) { diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/ContainerResource.ts b/webapp/packages/core-connections/src/ContainerResource.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/ContainerResource.ts rename to webapp/packages/core-connections/src/ContainerResource.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/DBDriverResource.ts b/webapp/packages/core-connections/src/DBDriverResource.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/DBDriverResource.ts rename to webapp/packages/core-connections/src/DBDriverResource.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DBAuthDialogController.ts b/webapp/packages/core-connections/src/DatabaseAuthDialog/DBAuthDialogController.ts similarity index 95% rename from webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DBAuthDialogController.ts rename to webapp/packages/core-connections/src/DatabaseAuthDialog/DBAuthDialogController.ts index 7ef3ce6546..a193d4a325 100644 --- a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DBAuthDialogController.ts +++ b/webapp/packages/core-connections/src/DatabaseAuthDialog/DBAuthDialogController.ts @@ -11,9 +11,9 @@ import { observable } from 'mobx'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLErrorCatcher } from '@cloudbeaver/core-sdk'; -import { ErrorDetailsDialog } from '../../../Notifications/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog'; import { ConnectionInfoResource } from '../ConnectionInfoResource'; import { DBDriverResource } from '../DBDriverResource'; diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DBAuthDialogFooter.tsx b/webapp/packages/core-connections/src/DatabaseAuthDialog/DBAuthDialogFooter.tsx similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DBAuthDialogFooter.tsx rename to webapp/packages/core-connections/src/DatabaseAuthDialog/DBAuthDialogFooter.tsx diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DatabaseAuthDialog.tsx b/webapp/packages/core-connections/src/DatabaseAuthDialog/DatabaseAuthDialog.tsx similarity index 95% rename from webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DatabaseAuthDialog.tsx rename to webapp/packages/core-connections/src/DatabaseAuthDialog/DatabaseAuthDialog.tsx index a9d21cb388..a8effa4255 100644 --- a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthDialog/DatabaseAuthDialog.tsx +++ b/webapp/packages/core-connections/src/DatabaseAuthDialog/DatabaseAuthDialog.tsx @@ -10,13 +10,12 @@ import { observer } from 'mobx-react'; import styled, { css } from 'reshadow'; import { - SubmittingForm, ErrorMessage, Loader, useFocus + SubmittingForm, ErrorMessage, Loader, useFocus, ObjectPropertyInfoForm } from '@cloudbeaver/core-blocks'; import { useController } from '@cloudbeaver/core-di'; import { CommonDialogWrapper, DialogComponentProps } from '@cloudbeaver/core-dialogs'; import { composes, useStyles } from '@cloudbeaver/core-theming'; -import { ObjectPropertyInfoForm } from '../../ObjectPropertyInfoForm/ObjectPropertyInfoForm'; import { useConnectionInfo } from '../useConnectionInfo'; import { useDBDriver } from '../useDBDriver'; import { DBAuthDialogController } from './DBAuthDialogController'; diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthModelsResource.ts b/webapp/packages/core-connections/src/DatabaseAuthModelsResource.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/DatabaseAuthModelsResource.ts rename to webapp/packages/core-connections/src/DatabaseAuthModelsResource.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/EConnectionFeature.ts b/webapp/packages/core-connections/src/EConnectionFeature.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/EConnectionFeature.ts rename to webapp/packages/core-connections/src/EConnectionFeature.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/extensions/IConnectionProvider.ts b/webapp/packages/core-connections/src/extensions/IConnectionProvider.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/extensions/IConnectionProvider.ts rename to webapp/packages/core-connections/src/extensions/IConnectionProvider.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/extensions/IConnectionSetter.ts b/webapp/packages/core-connections/src/extensions/IConnectionSetter.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/extensions/IConnectionSetter.ts rename to webapp/packages/core-connections/src/extensions/IConnectionSetter.ts diff --git a/webapp/packages/core-connections/src/index.ts b/webapp/packages/core-connections/src/index.ts new file mode 100644 index 0000000000..df8b697068 --- /dev/null +++ b/webapp/packages/core-connections/src/index.ts @@ -0,0 +1,11 @@ +export * from './extensions/IConnectionProvider'; +export * from './extensions/IConnectionSetter'; +export * from './ConnectionsManagerService'; +export * from './ConnectionInfoResource'; +export * from './ConnectionAuthService'; +export * from './EConnectionFeature'; +export * from './ContainerResource'; +export * from './DatabaseAuthModelsResource'; +export * from './DBDriverResource'; +export * from './useConnectionInfo'; +export * from './useDBDriver'; diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/useConnectionInfo.ts b/webapp/packages/core-connections/src/useConnectionInfo.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/useConnectionInfo.ts rename to webapp/packages/core-connections/src/useConnectionInfo.ts diff --git a/webapp/packages/core-app/src/shared/ConnectionsManager/useDBDriver.ts b/webapp/packages/core-connections/src/useDBDriver.ts similarity index 100% rename from webapp/packages/core-app/src/shared/ConnectionsManager/useDBDriver.ts rename to webapp/packages/core-connections/src/useDBDriver.ts diff --git a/webapp/packages/core-connections/tsconfig.json b/webapp/packages/core-connections/tsconfig.json new file mode 100644 index 0000000000..b352fb539e --- /dev/null +++ b/webapp/packages/core-connections/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "exclude": [ + "node_modules", + // "@cloudbeaver/**" + ], + "include": ["src/**/*"] +} diff --git a/webapp/packages/core-notifications/.gitignore b/webapp/packages/core-notifications/.gitignore new file mode 100644 index 0000000000..99902db863 --- /dev/null +++ b/webapp/packages/core-notifications/.gitignore @@ -0,0 +1,21 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/lib + +# misc +.DS_Store +.env* + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/webapp/packages/core-notifications/package.json b/webapp/packages/core-notifications/package.json new file mode 100644 index 0000000000..4c2f823dbe --- /dev/null +++ b/webapp/packages/core-notifications/package.json @@ -0,0 +1,32 @@ +{ + "name": "@cloudbeaver/core-notifications", + "sideEffects": false, + "version": "0.1.0", + "description": "", + "license": "Apache-2.0", + "main": "lib/index.js", + "module": "lib/index.js", + "scripts": { + "prebuild": "rimraf lib/*", + "build": "webpack --config ../../configs/webpack.plugin.config", + "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-localization": "^0.1.0", + "@cloudbeaver/core-blocks": "^0.1.0", + "@cloudbeaver/core-sdk": "^0.1.0", + "@cloudbeaver/core-events": "^0.1.0", + "@cloudbeaver/core-theming": "^0.1.0", + "@cloudbeaver/core-dialogs": "^0.1.0", + "reshadow": "^0.0.1-alpha.78", + "react": "^16.x.x", + "react-dom": "^16.x.x", + "reakit": "^1.1.1", + "rxjs": "^6.x.x", + "mobx": "^5.x.x", + "mobx-react": "^6.x.x" + } +} \ No newline at end of file diff --git a/webapp/packages/core-app/src/Notifications/Notifications.tsx b/webapp/packages/core-notifications/src/Notifications.tsx similarity index 100% rename from webapp/packages/core-app/src/Notifications/Notifications.tsx rename to webapp/packages/core-notifications/src/Notifications.tsx diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog.tsx b/webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog.tsx similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog.tsx rename to webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog.tsx diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/ErrorModel.ts b/webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/ErrorModel.ts similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/ErrorModel.ts rename to webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/ErrorModel.ts diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/styles.ts b/webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/styles.ts similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/ErrorDetailsDialog/styles.ts rename to webapp/packages/core-notifications/src/NotificationsItem/ErrorDetailsDialog/styles.ts diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/NotificationItemController.ts b/webapp/packages/core-notifications/src/NotificationsItem/NotificationItemController.ts similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/NotificationItemController.ts rename to webapp/packages/core-notifications/src/NotificationsItem/NotificationItemController.ts diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/NotificationsItem.tsx b/webapp/packages/core-notifications/src/NotificationsItem/NotificationsItem.tsx similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/NotificationsItem.tsx rename to webapp/packages/core-notifications/src/NotificationsItem/NotificationsItem.tsx diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/NotificationMark.tsx b/webapp/packages/core-notifications/src/NotificationsItem/Snackbar/NotificationMark.tsx similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/NotificationMark.tsx rename to webapp/packages/core-notifications/src/NotificationsItem/Snackbar/NotificationMark.tsx diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/Snackbar.tsx b/webapp/packages/core-notifications/src/NotificationsItem/Snackbar/Snackbar.tsx similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/Snackbar.tsx rename to webapp/packages/core-notifications/src/NotificationsItem/Snackbar/Snackbar.tsx diff --git a/webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/styles.ts b/webapp/packages/core-notifications/src/NotificationsItem/Snackbar/styles.ts similarity index 100% rename from webapp/packages/core-app/src/Notifications/NotificationsItem/Snackbar/styles.ts rename to webapp/packages/core-notifications/src/NotificationsItem/Snackbar/styles.ts diff --git a/webapp/packages/core-notifications/src/index.ts b/webapp/packages/core-notifications/src/index.ts new file mode 100644 index 0000000000..5afabefcd1 --- /dev/null +++ b/webapp/packages/core-notifications/src/index.ts @@ -0,0 +1,4 @@ +export * from './NotificationsItem/Snackbar/styles'; +export * from './NotificationsItem/Snackbar/NotificationMark'; +export * from './NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog'; +export * from './Notifications'; diff --git a/webapp/packages/core-notifications/tsconfig.json b/webapp/packages/core-notifications/tsconfig.json new file mode 100644 index 0000000000..b352fb539e --- /dev/null +++ b/webapp/packages/core-notifications/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "exclude": [ + "node_modules", + // "@cloudbeaver/**" + ], + "include": ["src/**/*"] +} diff --git a/webapp/packages/core-root/src/SessionResource.ts b/webapp/packages/core-root/src/SessionResource.ts index fb75e67ff0..091d6b065c 100644 --- a/webapp/packages/core-root/src/SessionResource.ts +++ b/webapp/packages/core-root/src/SessionResource.ts @@ -15,7 +15,7 @@ import { } from '@cloudbeaver/core-sdk'; export type SessionState = Pick & { - connections: Array>; + connections: Array>; }; @injectable() diff --git a/webapp/packages/core-sdk/src/queries/session/openSession.gql b/webapp/packages/core-sdk/src/queries/session/openSession.gql index ef074eb63e..708d938c1e 100644 --- a/webapp/packages/core-sdk/src/queries/session/openSession.gql +++ b/webapp/packages/core-sdk/src/queries/session/openSession.gql @@ -9,6 +9,8 @@ mutation openSession { name driverId connected + readOnly + features authNeeded diff --git a/webapp/packages/core-sdk/src/sdk.ts b/webapp/packages/core-sdk/src/sdk.ts index 5fa9c09074..6e157c4d9a 100644 --- a/webapp/packages/core-sdk/src/sdk.ts +++ b/webapp/packages/core-sdk/src/sdk.ts @@ -1123,7 +1123,7 @@ export type OpenSessionMutationVariables = Exact<{ [key: string]: never }>; export type OpenSessionMutation = { session: ( Pick - & { connections: Array> } + & { connections: Array> } ); }; export type ReadSessionLogQueryVariables = Exact<{ @@ -1814,6 +1814,7 @@ export const OpenSessionDocument = ` name driverId connected + readOnly features authNeeded authModel diff --git a/webapp/packages/plugin-authentication/package.json b/webapp/packages/plugin-authentication/package.json index cd1106ce75..85b2e5fae3 100644 --- a/webapp/packages/plugin-authentication/package.json +++ b/webapp/packages/plugin-authentication/package.json @@ -22,6 +22,7 @@ "@cloudbeaver/core-events": "^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", diff --git a/webapp/packages/plugin-authentication/src/Administration/Users/CreateUser/CreateUserController.ts b/webapp/packages/plugin-authentication/src/Administration/Users/CreateUser/CreateUserController.ts index 483152b69b..c2d67e7b00 100644 --- a/webapp/packages/plugin-authentication/src/Administration/Users/CreateUser/CreateUserController.ts +++ b/webapp/packages/plugin-authentication/src/Administration/Users/CreateUser/CreateUserController.ts @@ -8,10 +8,10 @@ import { observable } from 'mobx'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLErrorCatcher } from '@cloudbeaver/core-sdk'; import { AdministrationScreenService } from '@cloudbeaver/plugin-administration'; diff --git a/webapp/packages/plugin-authentication/src/Administration/Users/CreateUserDialog/CreateUserDialogController.ts b/webapp/packages/plugin-authentication/src/Administration/Users/CreateUserDialog/CreateUserDialogController.ts index 6f1748ecbb..42d4fbc749 100644 --- a/webapp/packages/plugin-authentication/src/Administration/Users/CreateUserDialog/CreateUserDialogController.ts +++ b/webapp/packages/plugin-authentication/src/Administration/Users/CreateUserDialog/CreateUserDialogController.ts @@ -8,10 +8,10 @@ import { observable, computed } from 'mobx'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLErrorCatcher } from '@cloudbeaver/core-sdk'; import { RolesManagerService } from '../../RolesManagerService'; diff --git a/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts b/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts index eb012888c8..672d0e7be7 100644 --- a/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts +++ b/webapp/packages/plugin-authentication/src/Administration/Users/UsersAdministrationController.ts @@ -8,10 +8,10 @@ import { observable } from 'mobx'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, ConfirmationDialog } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLErrorCatcher } from '@cloudbeaver/core-sdk'; import { UsersManagerService } from '../UsersManagerService'; diff --git a/webapp/packages/plugin-authentication/src/Dialog/AuthDialogController.ts b/webapp/packages/plugin-authentication/src/Dialog/AuthDialogController.ts index 6b59c1835d..3665946bad 100644 --- a/webapp/packages/plugin-authentication/src/Dialog/AuthDialogController.ts +++ b/webapp/packages/plugin-authentication/src/Dialog/AuthDialogController.ts @@ -8,10 +8,10 @@ import { observable, computed } from 'mobx'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLErrorCatcher } from '@cloudbeaver/core-sdk'; import { AuthInfoService } from '../AuthInfoService'; diff --git a/webapp/packages/plugin-connection-custom/package.json b/webapp/packages/plugin-connection-custom/package.json index 316a8604e7..5f40c47d14 100644 --- a/webapp/packages/plugin-connection-custom/package.json +++ b/webapp/packages/plugin-connection-custom/package.json @@ -16,6 +16,7 @@ "peerDependencies": { "@cloudbeaver/core-app": "^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", diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionForm/ConnectionForm.tsx b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionForm/ConnectionForm.tsx index df47405e4d..e07e522b81 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionForm/ConnectionForm.tsx +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionForm/ConnectionForm.tsx @@ -9,8 +9,10 @@ import { observer } from 'mobx-react'; import styled from 'reshadow'; -import { DBDriver, ObjectPropertyInfoForm } from '@cloudbeaver/core-app'; -import { Radio, InputField, useFocus } from '@cloudbeaver/core-blocks'; +import { + Radio, InputField, useFocus, ObjectPropertyInfoForm +} from '@cloudbeaver/core-blocks'; +import { DBDriver } from '@cloudbeaver/core-connections'; import { useTranslate } from '@cloudbeaver/core-localization'; import { useStyles } from '@cloudbeaver/core-theming'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialog.tsx b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialog.tsx index a2238a8871..cdf3347253 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialog.tsx +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialog.tsx @@ -10,10 +10,10 @@ import { observer } from 'mobx-react'; import { useState } from 'react'; import styled, { css } from 'reshadow'; -import { DBDriver } from '@cloudbeaver/core-app'; import { SubmittingForm, ErrorMessage, TabsState, TabList, Tab, TabTitle, TabPanel, Loader } from '@cloudbeaver/core-blocks'; +import { DBDriver } from '@cloudbeaver/core-connections'; import { useController } from '@cloudbeaver/core-di'; import { CommonDialogWrapper } from '@cloudbeaver/core-dialogs'; import { useTranslate } from '@cloudbeaver/core-localization'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialogController.ts b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialogController.ts index 6eee2498f9..33af008bcd 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialogController.ts +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/ConnectionFormDialogController.ts @@ -8,10 +8,11 @@ import { observable, action } from 'mobx'; -import { DBDriver, ErrorDetailsDialog, DatabaseAuthModelsResource } from '@cloudbeaver/core-app'; +import { DBDriver, DatabaseAuthModelsResource } from '@cloudbeaver/core-connections'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { ConnectionConfig, GQLErrorCatcher, DatabaseAuthModel } from '@cloudbeaver/core-sdk'; import { CustomConnectionService } from '../../CustomConnectionService'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverProperties.tsx b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverProperties.tsx index 566d5a5e08..e5b4b2714a 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverProperties.tsx +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverProperties.tsx @@ -10,8 +10,8 @@ import { observer } from 'mobx-react'; import { useEffect } from 'react'; import styled, { css } from 'reshadow'; -import { DBDriver } from '@cloudbeaver/core-app'; import { Loader, PropertiesTable } from '@cloudbeaver/core-blocks'; +import { DBDriver } from '@cloudbeaver/core-connections'; import { useController } from '@cloudbeaver/core-di'; import { useStyles } from '@cloudbeaver/core-theming'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverPropertiesController.ts b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverPropertiesController.ts index 9b56015312..7bf51f93aa 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverPropertiesController.ts +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/ConnectionFormDialog/DriverProperties/DriverPropertiesController.ts @@ -8,8 +8,8 @@ import { observable } from 'mobx'; -import { DBDriver } from '@cloudbeaver/core-app'; import { IProperty } from '@cloudbeaver/core-blocks'; +import { DBDriver } from '@cloudbeaver/core-connections'; import { injectable, IInitializableController } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { ObjectPropertyInfo } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnection/CustomConnectionController.ts b/webapp/packages/plugin-connection-custom/src/CustomConnection/CustomConnectionController.ts index 1c6d0dd3d9..61ae93df96 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnection/CustomConnectionController.ts +++ b/webapp/packages/plugin-connection-custom/src/CustomConnection/CustomConnectionController.ts @@ -8,7 +8,7 @@ import { observable, computed } from 'mobx'; -import { DBDriver, DBDriverResource } from '@cloudbeaver/core-app'; +import { DBDriver, DBDriverResource } from '@cloudbeaver/core-connections'; import { injectable, IInitializableController } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; diff --git a/webapp/packages/plugin-connection-custom/src/CustomConnectionService.ts b/webapp/packages/plugin-connection-custom/src/CustomConnectionService.ts index 4b814d83aa..f9a119f557 100644 --- a/webapp/packages/plugin-connection-custom/src/CustomConnectionService.ts +++ b/webapp/packages/plugin-connection-custom/src/CustomConnectionService.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ -import { ConnectionsManagerService, Connection } from '@cloudbeaver/core-app'; +import { ConnectionsManagerService, Connection } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { ConnectionConfig, GraphQLService, ObjectPropertyInfo } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-connection-template/package.json b/webapp/packages/plugin-connection-template/package.json index 4f36f7258a..c0fd94684e 100644 --- a/webapp/packages/plugin-connection-template/package.json +++ b/webapp/packages/plugin-connection-template/package.json @@ -16,6 +16,7 @@ "peerDependencies": { "@cloudbeaver/core-app": "^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", diff --git a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionController.ts b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionController.ts index fd30a34930..9508f15052 100644 --- a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionController.ts +++ b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionController.ts @@ -9,11 +9,12 @@ import { observable, action } from 'mobx'; import { - DBDriverResource, Connection, ErrorDetailsDialog, DatabaseAuthModelsResource -} from '@cloudbeaver/core-app'; + DBDriverResource, Connection, DatabaseAuthModelsResource +} from '@cloudbeaver/core-connections'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { ConnectionConfig, GQLError, DatabaseAuthModel } from '@cloudbeaver/core-sdk'; import { TemplateConnectionService } from '../TemplateConnectionService'; diff --git a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx index 88763d14a5..0a1a20327f 100644 --- a/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx +++ b/webapp/packages/plugin-connection-template/src/ConnectionDialog/ConnectionDialog.tsx @@ -9,9 +9,8 @@ import { observer } from 'mobx-react'; import styled, { css } from 'reshadow'; -import { ObjectPropertyInfoForm } from '@cloudbeaver/core-app'; import { - ErrorMessage, SubmittingForm, Loader, useFocus + ErrorMessage, SubmittingForm, Loader, useFocus, ObjectPropertyInfoForm } from '@cloudbeaver/core-blocks'; import { useController } from '@cloudbeaver/core-di'; import { CommonDialogWrapper, DialogComponentProps } from '@cloudbeaver/core-dialogs'; diff --git a/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionItem.tsx b/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionItem.tsx index dc3381af2a..2873ab99b7 100644 --- a/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionItem.tsx +++ b/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionItem.tsx @@ -9,8 +9,8 @@ import { observer } from 'mobx-react'; import { useCallback } from 'react'; -import { DBDriver, Connection } from '@cloudbeaver/core-app'; import { ListItem } from '@cloudbeaver/core-blocks'; +import { DBDriver, Connection } from '@cloudbeaver/core-connections'; type Props = { template: Connection; diff --git a/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionSelector.tsx b/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionSelector.tsx index 575b3e9da6..ad7112c287 100644 --- a/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionSelector.tsx +++ b/webapp/packages/plugin-connection-template/src/ConnectionDialog/TemplateConnectionSelector/TemplateConnectionSelector.tsx @@ -9,8 +9,8 @@ import { observer } from 'mobx-react'; import { useState, useMemo } from 'react'; -import { DBDriver, Connection } from '@cloudbeaver/core-app'; import { ItemList, ItemListSearch } from '@cloudbeaver/core-blocks'; +import { DBDriver, Connection } from '@cloudbeaver/core-connections'; import { TemplateConnectionItem } from './TemplateConnectionItem'; diff --git a/webapp/packages/plugin-connection-template/src/TemplateConnectionService.ts b/webapp/packages/plugin-connection-template/src/TemplateConnectionService.ts index aa78063dc1..c6ad9ba2ca 100644 --- a/webapp/packages/plugin-connection-template/src/TemplateConnectionService.ts +++ b/webapp/packages/plugin-connection-template/src/TemplateConnectionService.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ -import { Connection, ConnectionsManagerService } from '@cloudbeaver/core-app'; +import { Connection, ConnectionsManagerService } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { ConnectionConfig, GraphQLService } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-connection-template/src/TemplateConnectionsResource.ts b/webapp/packages/plugin-connection-template/src/TemplateConnectionsResource.ts index c16eb6140c..1afc48f4a2 100644 --- a/webapp/packages/plugin-connection-template/src/TemplateConnectionsResource.ts +++ b/webapp/packages/plugin-connection-template/src/TemplateConnectionsResource.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ -import { Connection } from '@cloudbeaver/core-app'; +import { Connection } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { EPermission, PermissionsService } from '@cloudbeaver/core-root'; import { GraphQLService, CachedDataResource } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-data-export/src/Dialog/DataExportController.ts b/webapp/packages/plugin-data-export/src/Dialog/DataExportController.ts index 2382fa00d1..1afd63d563 100644 --- a/webapp/packages/plugin-data-export/src/Dialog/DataExportController.ts +++ b/webapp/packages/plugin-data-export/src/Dialog/DataExportController.ts @@ -8,11 +8,11 @@ import { observable, computed } from 'mobx'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { IProperty } from '@cloudbeaver/core-blocks'; import { injectable, IInitializableController, IDestructibleController } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { DataTransferProcessorInfo, GQLErrorCatcher } from '@cloudbeaver/core-sdk'; import { DataExportService } from '../DataExportService'; diff --git a/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotification.tsx b/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotification.tsx index 7dd745e176..806580dfd6 100644 --- a/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotification.tsx +++ b/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotification.tsx @@ -10,11 +10,11 @@ import { observer } from 'mobx-react'; import { useEffect, useState } from 'react'; import styled, { use, css } from 'reshadow'; -import { SNACKBAR_STYLES } from '@cloudbeaver/core-app'; import { Button, Loader, IconButton } from '@cloudbeaver/core-blocks'; import { useController } from '@cloudbeaver/core-di'; import { NotificationComponentProps } from '@cloudbeaver/core-events'; import { useTranslate } from '@cloudbeaver/core-localization'; +import { SNACKBAR_STYLES } from '@cloudbeaver/core-notifications'; import { useStyles } from '@cloudbeaver/core-theming'; import { EDeferredState } from '@cloudbeaver/core-utils'; diff --git a/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotificationController.ts b/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotificationController.ts index 07af0cfc72..4c1e58eb87 100644 --- a/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotificationController.ts +++ b/webapp/packages/plugin-data-export/src/ExportNotification/ExportNotificationController.ts @@ -8,11 +8,12 @@ import { observable, computed } from 'mobx'; -import { ErrorDetailsDialog, NavNodeManagerService } from '@cloudbeaver/core-app'; +import { NavNodeManagerService } from '@cloudbeaver/core-app'; import { IInitializableController, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { INotification } from '@cloudbeaver/core-events'; import { LocalizationService } from '@cloudbeaver/core-localization'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { EDeferredState } from '@cloudbeaver/core-utils'; import { DataExportProcessService } from '../DataExportProcessService'; diff --git a/webapp/packages/plugin-data-viewer/package.json b/webapp/packages/plugin-data-viewer/package.json index dc87817d0a..56dbb4aa7b 100644 --- a/webapp/packages/plugin-data-viewer/package.json +++ b/webapp/packages/plugin-data-viewer/package.json @@ -17,11 +17,13 @@ "@cloudbeaver/plugin-object-viewer": "^0.1.0", "@cloudbeaver/core-app": "^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-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", diff --git a/webapp/packages/plugin-data-viewer/src/DataViewerTableService.ts b/webapp/packages/plugin-data-viewer/src/DataViewerTableService.ts index 0c638887fc..814bced59b 100644 --- a/webapp/packages/plugin-data-viewer/src/DataViewerTableService.ts +++ b/webapp/packages/plugin-data-viewer/src/DataViewerTableService.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ -import { ConnectionInfoResource } from '@cloudbeaver/core-app'; +import { ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { GraphQLService } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableViewerModel.ts b/webapp/packages/plugin-data-viewer/src/TableViewer/TableViewerModel.ts index 6c442dd761..1d48a52130 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableViewerModel.ts +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableViewerModel.ts @@ -9,8 +9,8 @@ import { action, observable } from 'mobx'; import { Subject, Observable } from 'rxjs'; -import { ErrorDetailsDialog } from '@cloudbeaver/core-app'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLError, SqlDataFilterConstraint } from '@cloudbeaver/core-sdk'; import { uuid, MetadataMap } from '@cloudbeaver/core-utils'; diff --git a/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts b/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts index 11454c7661..ab7bcb77af 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts +++ b/webapp/packages/plugin-object-viewer/src/ObjectViewerTabService.ts @@ -14,13 +14,12 @@ import { TabHandler, NavigationType, NodeManagerUtils, - connectionProvider, objectCatalogProvider, objectSchemaProvider, NavNodeManagerService, DBObjectService, - ConnectionInfoResource, } from '@cloudbeaver/core-app'; +import { connectionProvider, ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { ResourceKey, resourceKeyList, isResourceKeyList } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorBootstrap.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorBootstrap.ts index 46b322a9ac..7cb038824b 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorBootstrap.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorBootstrap.ts @@ -11,9 +11,10 @@ import { NavigationTreeContextMenuService, EObjectFeature, NodeManagerUtils, - NavNode, ConnectionsManagerService, ConnectionSchemaManagerService, - isConnectionProvider, isObjectCatalogProvider, isObjectSchemaProvider, + NavNode, ConnectionSchemaManagerService, + isObjectCatalogProvider, isObjectSchemaProvider, } from '@cloudbeaver/core-app'; +import { ConnectionsManagerService, isConnectionProvider } from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { ContextMenuService, IContextMenuItem, IMenuContext } from '@cloudbeaver/core-dialogs'; import { ActiveViewService } from '@cloudbeaver/core-view'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorNavigatorService.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorNavigatorService.ts index 280f78e565..9672a2ba64 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorNavigatorService.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorNavigatorService.ts @@ -9,14 +9,16 @@ import { NavigationTabsService, ITab, - ConnectionsManagerService, - ConnectionInfoResource, INavigator, NavigationService, IContextProvider, ITabOptions, - ConnectionAuthService, } from '@cloudbeaver/core-app'; +import { + ConnectionsManagerService, + ConnectionInfoResource, + ConnectionAuthService, +} from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { GraphQLService } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorTab.tsx b/webapp/packages/plugin-sql-editor/src/SqlEditorTab.tsx index 4bd2008638..d60361b8e5 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorTab.tsx +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorTab.tsx @@ -8,8 +8,9 @@ import styled from 'reshadow'; -import { TabHandlerTabProps, ConnectionInfoResource } from '@cloudbeaver/core-app'; +import { TabHandlerTabProps } from '@cloudbeaver/core-app'; import { TabIcon, Tab, TabTitle } from '@cloudbeaver/core-blocks'; +import { ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { useService } from '@cloudbeaver/core-di'; import { useStyles } from '@cloudbeaver/core-theming'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlEditorTabService.ts b/webapp/packages/plugin-sql-editor/src/SqlEditorTabService.ts index 5d08d6781f..fd990ba2da 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlEditorTabService.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlEditorTabService.ts @@ -10,15 +10,17 @@ import { NavigationTabsService, TabHandler, ITab, - ConnectionInfoResource, - connectionProvider, - connectionSetter, objectSchemaProvider, objectCatalogProvider, objectCatalogSetter, objectSchemaSetter, - ConnectionAuthService, } from '@cloudbeaver/core-app'; +import { + ConnectionInfoResource, + connectionProvider, + connectionSetter, + ConnectionAuthService, +} from '@cloudbeaver/core-connections'; import { injectable } from '@cloudbeaver/core-di'; import { NotificationService } from '@cloudbeaver/core-events'; import { GraphQLService } from '@cloudbeaver/core-sdk'; diff --git a/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultPanel/SqlResultPanelController.ts b/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultPanel/SqlResultPanelController.ts index 56102181e6..e65e22b5e9 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultPanel/SqlResultPanelController.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultPanel/SqlResultPanelController.ts @@ -8,10 +8,11 @@ import { observable } from 'mobx'; -import { ErrorDetailsDialog, ConnectionInfoResource } from '@cloudbeaver/core-app'; +import { ConnectionInfoResource } from '@cloudbeaver/core-connections'; import { IDestructibleController, IInitializableController, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; +import { ErrorDetailsDialog } from '@cloudbeaver/core-notifications'; import { GQLError, ServerInternalError } from '@cloudbeaver/core-sdk'; import { PromiseCancelledError } from '@cloudbeaver/core-utils'; import { diff --git a/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultService.ts b/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultService.ts index cbc108fbcd..ec8c3b71f5 100644 --- a/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultService.ts +++ b/webapp/packages/plugin-sql-editor/src/SqlResultTabs/SqlResultService.ts @@ -12,7 +12,6 @@ import { GraphQLService, SqlExecuteInfo, SqlDataFilter, - SqlDataFilterConstraint, } from '@cloudbeaver/core-sdk'; import { IRequestDataResult, RowDiff } from '@cloudbeaver/plugin-data-viewer'; @@ -22,31 +21,10 @@ import { SQLQueryExecutionProcess } from './SQLQueryExecutionProcess'; @injectable() export class SqlResultService { - constructor(private graphQLService: GraphQLService, - private notificationService: NotificationService) { } - - /** - * @deprecated use asyncSqlQuery - */ - async fetchData( - sqlQueryParams: ISqlQueryParams, - rowOffset: number, - count: number, - constraints?: SqlDataFilterConstraint[] - ): Promise { - const response = await this.graphQLService.gql.executeSqlQuery({ - connectionId: sqlQueryParams.connectionId, - contextId: sqlQueryParams.contextId, - query: sqlQueryParams.query, - - filter: { - offset: rowOffset, - limit: count, - constraints, - }, - }); - return response.result!; - } + constructor( + private graphQLService: GraphQLService, + private notificationService: NotificationService + ) { } asyncSqlQuery( sqlQueryParams: ISqlQueryParams,