mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
Fix Edit Connection behavior that affects multiple areas working with edited connection (#20907)
This commit is contained in:
@@ -177,11 +177,6 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
return;
|
||||
}
|
||||
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
|
||||
|
||||
@@ -498,17 +498,13 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
// a connection management info. See https://github.com/microsoft/azuredatastudio/issues/16556
|
||||
this.tryAddActiveConnection(connectionMgmtInfo, connection, options.saveTheConnection);
|
||||
|
||||
|
||||
|
||||
if (callbacks.onConnectSuccess) {
|
||||
callbacks.onConnectSuccess(options.params, connectionResult.connectionProfile);
|
||||
}
|
||||
if (options.saveTheConnection || isEdit) {
|
||||
let matcher: interfaces.ProfileMatcher;
|
||||
if (isEdit) {
|
||||
matcher = (a: interfaces.IConnectionProfile, b: interfaces.IConnectionProfile) => {
|
||||
return a.id === b.id;
|
||||
};
|
||||
matcher = (a: interfaces.IConnectionProfile, b: interfaces.IConnectionProfile) => a.id === options.params.oldProfileId;
|
||||
}
|
||||
|
||||
await this.saveToSettings(uri, connection, matcher).then(value => {
|
||||
|
||||
@@ -70,6 +70,7 @@ export class ServerTreeActionProvider {
|
||||
*/
|
||||
private getConnectionActions(tree: AsyncServerTree | ITree, profile: ConnectionProfile): IAction[] {
|
||||
let node = new TreeNode(NodeType.Server, NodeType.Server, '', false, '', '', '', undefined, undefined, undefined, undefined);
|
||||
this._connectionManagementService.addSavedPassword(profile);
|
||||
node.connection = profile;
|
||||
return this.getAllActions({
|
||||
tree: tree,
|
||||
|
||||
Reference in New Issue
Block a user