Skip to content

Commit

Permalink
CB-4422 fix: after reconnect connection info does not reset settings …
Browse files Browse the repository at this point in the history
…on edit connection
  • Loading branch information
s.teleshev committed Feb 8, 2024
1 parent 9e051d5 commit e8e0ad6
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions webapp/packages/plugin-connections/src/ConnectionAuthService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand All @@ -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();
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit e8e0ad6

Please sign in to comment.