Merge remote-tracking branch 'origin/devel' into devel

This commit is contained in:
Serge Rider
2021-09-20 13:45:24 +03:00
5 changed files with 16 additions and 7 deletions
@@ -85,6 +85,9 @@ export function useElementsTree(options: IOptions): IElementsTree {
for (const child of children) {
const nodeState = state.get(child);
if (!nodeState.expanded && child !== options.root) {
if (navNodeInfoResource.isOutdated(child)) {
await navNodeInfoResource.load(child);
}
continue;
}
@@ -28,7 +28,6 @@ import { MetadataMap } from '@cloudbeaver/core-utils';
import { CoreSettingsService } from '../../CoreSettingsService';
import type { NavNode } from './EntityTypes';
import { NavNodeInfoResource, ROOT_NODE_PATH } from './NavNodeInfoResource';
import { NodeManagerUtils } from './NodeManagerUtils';
// TODO: so much dirty
export interface NodePath {
@@ -290,7 +289,7 @@ export class NavTreeResource extends CachedMapResource<string, string[]> {
return;
}
if (!this.has(connectionInfo.nodePath)) {
if (!this.navNodeInfoResource.has(connectionInfo.nodePath)) {
return;
}
+3 -3
View File
@@ -40,9 +40,9 @@ export function useFocus<T extends HTMLElement>({
.querySelectorAll<T>(`
button:not([disabled=disabled]),
[href],
input:not([disabled=disabled],[readonly=readonly]),
select:not([disabled=disabled],[readonly=readonly]),
textarea:not([disabled=disabled],[readonly=readonly]),
input:not([disabled=disabled]):not([readonly=readonly]),
select:not([disabled=disabled]):not([readonly=readonly]),
textarea:not([disabled=disabled]):not([readonly=readonly]),
[tabndex]:not([tabndex="-1"])`);
let tabIndex = -1;
@@ -12,6 +12,7 @@ import { injectable, Bootstrap } from '@cloudbeaver/core-di';
import { NotificationService } from '@cloudbeaver/core-events';
import { SessionDataResource } from '@cloudbeaver/core-root';
import { ConnectionInfoResource } from '../../ConnectionInfoResource';
import { DBDriverResource } from '../../DBDriverResource';
import { NetworkHandlerResource } from '../../NetworkHandlerResource';
import { DatabaseConnection, ConnectionsResource } from '../ConnectionsResource';
@@ -36,6 +37,7 @@ export class ConnectionsAdministrationService extends Bootstrap {
private connectionsResource: ConnectionsResource,
private dbDriverResource: DBDriverResource,
private readonly createConnectionService: CreateConnectionService,
private readonly connectionInfoResource: ConnectionInfoResource,
private readonly sessionDataResource: SessionDataResource,
private readonly networkHandlerResource: NetworkHandlerResource
) {
@@ -73,6 +75,7 @@ export class ConnectionsAdministrationService extends Bootstrap {
private async refreshUserConnections(configuration: boolean, outside: boolean): Promise<void> {
if (outside) {
this.connectionsResource.cleanNewFlags();
await this.connectionInfoResource.refreshUserConnections();
await this.sessionDataResource.refresh();
}
}
@@ -6,7 +6,7 @@
* you may not use this file except in compliance with the License.
*/
import { action, makeObservable, runInAction } from 'mobx';
import { action, makeObservable } from 'mobx';
import { injectable } from '@cloudbeaver/core-di';
import { Executor, ExecutorInterrupter, IExecutor } from '@cloudbeaver/core-executor';
@@ -78,13 +78,17 @@ export class ConnectionInfoResource extends CachedMapResource<string, Connection
sessionDataResource.onDataUpdate.addHandler(() => this.refreshUserConnections(true));
}
async updateSessionConnections(): Promise<boolean> {
return await this.connectionsResource.updateSessionConnections();
}
async refreshUserConnections(sessionUpdate?: boolean): Promise<void> {
this.sessionUpdate = sessionUpdate === true;
try {
const connectionsList = resourceKeyList(Array.from(this.data.keys()));
await this.performUpdate(connectionsList, [], async () => {
if (!sessionUpdate) {
const updated = await this.connectionsResource.updateSessionConnections();
const updated = await this.updateSessionConnections();
if (!updated) {
return;