From b519d510523d88adb3611e33391386579f67124c Mon Sep 17 00:00:00 2001 From: Amir Omidi Date: Fri, 15 May 2020 10:48:56 -0700 Subject: [PATCH] Replace the ID of the generated connection profile with the one through edit data (#10413) --- src/sql/platform/connection/common/connectionManagement.ts | 1 + .../services/connection/browser/connectionDialogService.ts | 4 ++++ .../connection/browser/connectionManagementService.ts | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sql/platform/connection/common/connectionManagement.ts b/src/sql/platform/connection/common/connectionManagement.ts index 7992ba2c39..ad6a814ea2 100644 --- a/src/sql/platform/connection/common/connectionManagement.ts +++ b/src/sql/platform/connection/common/connectionManagement.ts @@ -328,6 +328,7 @@ export interface INewConnectionParams { showDashboard?: boolean; providers?: string[]; isEditConnection?: boolean; + oldProfileId?: string; // used for edit connection } export interface IConnectableInput { diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index a3a59d2ebe..66579e4aff 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -166,6 +166,10 @@ export class ConnectionDialogService implements IConnectionDialogService { } profile = result.connection; + if (params.oldProfileId && params.isEditConnection) { + profile.id = params.oldProfileId; + } + profile.serverName = trim(profile.serverName); // append the port to the server name for SQL Server connections diff --git a/src/sql/workbench/services/connection/browser/connectionManagementService.ts b/src/sql/workbench/services/connection/browser/connectionManagementService.ts index 45b1c71bc1..f109b7ee20 100644 --- a/src/sql/workbench/services/connection/browser/connectionManagementService.ts +++ b/src/sql/workbench/services/connection/browser/connectionManagementService.ts @@ -236,7 +236,8 @@ export class ConnectionManagementService extends Disposable implements IConnecti } let params = { connectionType: ConnectionType.default, - isEditConnection: true + isEditConnection: true, + oldProfileId: model.id }; try {