diff --git a/webapp/packages/core-connections/src/NavTree/ConnectionNavNodeService.ts b/webapp/packages/core-connections/src/NavTree/ConnectionNavNodeService.ts index 9786cc9570..c81902ff1b 100644 --- a/webapp/packages/core-connections/src/NavTree/ConnectionNavNodeService.ts +++ b/webapp/packages/core-connections/src/NavTree/ConnectionNavNodeService.ts @@ -8,7 +8,7 @@ import { action, makeObservable } from 'mobx'; import { Dependency, injectable } from '@cloudbeaver/core-di'; -import { ExecutorInterrupter, IAsyncContextLoader, IExecutionContextProvider } from '@cloudbeaver/core-executor'; +import { ExecutorInterrupter, IAsyncContextLoader, IExecutionContextProvider, IExecutorHandler } from '@cloudbeaver/core-executor'; import { INodeNavigationData, NavNodeInfoResource, @@ -23,7 +23,7 @@ import { ServerEventId } from '@cloudbeaver/core-root'; import type { IConnectionInfoParams } from '../CONNECTION_INFO_PARAM_SCHEMA'; import { ConnectionFolderEventHandler, IConnectionFolderEvent } from '../ConnectionFolderEventHandler'; import { Connection, ConnectionInfoActiveProjectKey, ConnectionInfoResource, createConnectionParam } from '../ConnectionInfoResource'; -import { ConnectionsManagerService } from '../ConnectionsManagerService'; +import { ConnectionsManagerService, IConnectionExecutorData } from '../ConnectionsManagerService'; import { ContainerResource } from '../ContainerResource'; import { getConnectionParentId } from './getConnectionParentId'; import { getFolderNodeParents } from './getFolderNodeParents'; @@ -57,6 +57,8 @@ export class ConnectionNavNodeService extends Dependency { this.navNodeManagerService.navigator.addHandler(this.navigateHandler.bind(this)); + this.connectionsManagerService.onDisconnect.addHandler(this.onDisconnectHandle.bind(this)); + this.connectionInfoResource.connect(this.navTreeResource); this.connectionFolderEventHandler.onEvent( @@ -99,6 +101,10 @@ export class ConnectionNavNodeService extends Dependency { ); } + onDisconnectHandle: IExecutorHandler = async (data, contexts) => { + this.navTreeResource.markOutdated(resourceKeyList(data.connections.map(connection => connection.connectionId))); + }; + navigationNavNodeConnectionContext: IAsyncContextLoader = async (context, { nodeId }) => { await this.connectionInfoResource.load(ConnectionInfoActiveProjectKey); const connection = this.connectionInfoResource.getConnectionForNode(nodeId); diff --git a/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectPropertyTable/ObjectPropertyTable.tsx b/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectPropertyTable/ObjectPropertyTable.tsx index 02c594797a..8523bdc955 100644 --- a/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectPropertyTable/ObjectPropertyTable.tsx +++ b/webapp/packages/plugin-object-viewer/src/ObjectPropertiesPage/ObjectPropertyTable/ObjectPropertyTable.tsx @@ -45,7 +45,7 @@ export const ObjectPropertyTable = observer(function O return ( <> - {nodes.length === 0 ? ( + {objects.length === 0 ? ( {translate('plugin_object_viewer_table_no_items')} ) : (