mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Merge remote-tracking branch 'origin/devel' into devel
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
+8
-6
@@ -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';
|
||||
|
||||
+5
-2
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
+10
-8
@@ -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<NavNode>) => {
|
||||
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<NavNode>) => {
|
||||
const node = context.data;
|
||||
this.connectionsManagerService.deleteNavNodeConnectionAsync(node.id);
|
||||
this.connectionsManagerService.deleteConnection(
|
||||
NodeManagerUtils.connectionNodeIdToConnectionId(node.id)
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
@@ -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';
|
||||
|
||||
@@ -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<INodeNavigationData>;
|
||||
|
||||
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<INodeNavigationData>(
|
||||
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<string>) {
|
||||
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<string>) {
|
||||
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<INodeNavigationData>) {
|
||||
const nodeInfo = await contexts.getContext(this.navigationNavNodeContext);
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
/**
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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*
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
-47
@@ -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<void> {
|
||||
await this.deleteConnection(NodeManagerUtils.connectionNodeIdToConnectionId(navNodeId));
|
||||
}
|
||||
|
||||
async closeNavNodeConnectionAsync(navNodeId: string): Promise<void> {
|
||||
const connectionId = NodeManagerUtils.connectionNodeIdToConnectionId(navNodeId);
|
||||
await this.closeConnectionAsync(connectionId);
|
||||
}
|
||||
|
||||
async loadObjectContainer(connectionId: string, catalogId?: string): Promise<ObjectContainer[]> {
|
||||
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) {
|
||||
+1
-1
@@ -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';
|
||||
|
||||
+1
-2
@@ -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';
|
||||
@@ -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';
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
// "@cloudbeaver/**"
|
||||
],
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -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*
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './NotificationsItem/Snackbar/styles';
|
||||
export * from './NotificationsItem/Snackbar/NotificationMark';
|
||||
export * from './NotificationsItem/ErrorDetailsDialog/ErrorDetailsDialog';
|
||||
export * from './Notifications';
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
// "@cloudbeaver/**"
|
||||
],
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
} from '@cloudbeaver/core-sdk';
|
||||
|
||||
export type SessionState = Pick<SessionInfo, 'createTime' | 'cacheExpired' | 'lastAccessTime' | 'locale'> & {
|
||||
connections: Array<Pick<ConnectionInfo, 'id' | 'name' | 'connected' | 'driverId' | 'features' | 'authNeeded' | 'authModel'>>;
|
||||
connections: Array<Pick<ConnectionInfo, 'id' | 'name' | 'connected' | 'readOnly' | 'driverId' | 'features' | 'authNeeded' | 'authModel'>>;
|
||||
};
|
||||
|
||||
@injectable()
|
||||
|
||||
@@ -9,6 +9,8 @@ mutation openSession {
|
||||
name
|
||||
driverId
|
||||
connected
|
||||
readOnly
|
||||
|
||||
features
|
||||
|
||||
authNeeded
|
||||
|
||||
@@ -1123,7 +1123,7 @@ export type OpenSessionMutationVariables = Exact<{ [key: string]: never }>;
|
||||
|
||||
export type OpenSessionMutation = { session: (
|
||||
Pick<SessionInfo, 'createTime' | 'lastAccessTime' | 'cacheExpired' | 'locale'>
|
||||
& { connections: Array<Pick<ConnectionInfo, 'id' | 'name' | 'driverId' | 'connected' | 'features' | 'authNeeded' | 'authModel'>> }
|
||||
& { connections: Array<Pick<ConnectionInfo, 'id' | 'name' | 'driverId' | 'connected' | 'readOnly' | 'features' | 'authNeeded' | 'authModel'>> }
|
||||
); };
|
||||
|
||||
export type ReadSessionLogQueryVariables = Exact<{
|
||||
@@ -1814,6 +1814,7 @@ export const OpenSessionDocument = `
|
||||
name
|
||||
driverId
|
||||
connected
|
||||
readOnly
|
||||
features
|
||||
authNeeded
|
||||
authModel
|
||||
|
||||
@@ -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",
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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",
|
||||
|
||||
+4
-2
@@ -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';
|
||||
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
+2
-1
@@ -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';
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
+3
-2
@@ -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';
|
||||
|
||||
+1
-2
@@ -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';
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
+2
-1
@@ -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';
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
+2
-1
@@ -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 {
|
||||
|
||||
@@ -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<SqlExecuteInfo> {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user