From e8e0ad65ef5e64aea390a86c5a88eba5b95e1b4c Mon Sep 17 00:00:00 2001 From: "s.teleshev" Date: Thu, 8 Feb 2024 14:10:00 +0100 Subject: [PATCH] CB-4422 fix: after reconnect connection info does not reset settings on edit connection --- .../src/ConnectionAuthService.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/webapp/packages/plugin-connections/src/ConnectionAuthService.ts b/webapp/packages/plugin-connections/src/ConnectionAuthService.ts index 79e610752d..4c648a371f 100644 --- a/webapp/packages/plugin-connections/src/ConnectionAuthService.ts +++ b/webapp/packages/plugin-connections/src/ConnectionAuthService.ts @@ -5,6 +5,8 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ +import React from 'react'; + import { AuthProviderService } from '@cloudbeaver/core-authentication'; import { Connection, @@ -15,11 +17,13 @@ import { } from '@cloudbeaver/core-connections'; import { Dependency, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs'; -import { NotificationService } from '@cloudbeaver/core-events'; import type { IExecutionContextProvider } from '@cloudbeaver/core-executor'; import { AuthenticationService } from '@cloudbeaver/plugin-authentication'; -import { DatabaseAuthDialog } from './DatabaseAuthDialog/DatabaseAuthDialog'; +const DatabaseAuthDialog = React.lazy(async () => { + const { DatabaseAuthDialog } = await import('./DatabaseAuthDialog/DatabaseAuthDialog'); + return { default: DatabaseAuthDialog }; +}); @injectable() export class ConnectionAuthService extends Dependency { @@ -28,7 +32,6 @@ export class ConnectionAuthService extends Dependency { private readonly commonDialogService: CommonDialogService, private readonly authProviderService: AuthProviderService, private readonly connectionsManagerService: ConnectionsManagerService, - private readonly notificationService: NotificationService, private readonly authenticationService: AuthenticationService, ) { super(); @@ -77,7 +80,14 @@ export class ConnectionAuthService extends Dependency { } } - connection = await this.connectionInfoResource.load(key, ['includeAuthNeeded', 'includeNetworkHandlersConfig', 'includeCredentialsSaved']); + connection = await this.connectionInfoResource.load(key, [ + 'includeAuthNeeded', + 'includeNetworkHandlersConfig', + 'includeCredentialsSaved', + 'customIncludeOptions', + 'includeAuthProperties', + 'includeProviderProperties', + ]); const networkHandlers = connection .networkHandlersConfig!.filter(handler => handler.enabled && (!handler.savePassword || resetCredentials))