Revert new connection string format (#22997)

This commit is contained in:
Alex Ma
2023-05-05 13:41:40 -07:00
committed by GitHub
parent 27e0d67dec
commit 898bb73a34
34 changed files with 77 additions and 1690 deletions

View File

@@ -121,7 +121,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
// get the full ConnectionProfiles with the server info updated properly
const treeInput = TreeUpdateUtils.getTreeInput(this._connectionManagementService)!;
await this._tree.setInput(treeInput);
await this.refreshConnectionTreeTitles();
this._treeSelectionHandler.onTreeActionStateChange(false);
} else {
if (this._connectionManagementService.hasRegisteredServers()) {
@@ -269,7 +268,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
if (connectionParentGroup) {
connectionParentGroup.addOrReplaceConnection(newConnection);
await this._tree.updateChildren(connectionParentGroup);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(newConnection);
await this._tree.expand(newConnection);
}
@@ -284,7 +282,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
await this._tree.rerender(connectionInTree);
await this._tree.revealSelectFocusElement(connectionInTree);
await this._tree.updateChildren(connectionInTree);
await this.refreshConnectionTreeTitles();
await this._tree.expand(connectionInTree);
}
}
@@ -297,7 +294,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
if (parentGroup) {
parentGroup.removeConnections([e]);
await this._tree.updateChildren(parentGroup);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(parentGroup);
}
}
@@ -315,14 +311,12 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
const newProfileParent = <ConnectionProfileGroup>this._tree.getElementById(e.profile.groupId);
newProfileParent.addOrReplaceConnection(e.profile);
await this._tree.updateChildren(newProfileParent);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(e.profile);
await this._tree.expand(e.profile);
} else {
// If the profile was not moved to a different group then just update the profile in the group.
oldProfileParent.replaceConnection(e.profile, e.oldProfileId);
await this._tree.updateChildren(oldProfileParent)
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(e.profile);
await this._tree.expand(e.profile);
}
@@ -344,7 +338,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
newParent.addOrReplaceConnection(movedConnection);
await this._tree.updateChildren(newParent);
}
await this.refreshConnectionTreeTitles();
const newConnection = this._tree.getElementById(movedConnection.id);
if (newConnection) {
await this._tree.revealSelectFocusElement(newConnection);
@@ -359,7 +352,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
const parent = <ConnectionProfileGroup>this._tree.getElementById(e.parentId);
parent.children = parent.children.filter(c => c.id !== e.id);
await this._tree.updateChildren(parent);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(parent);
}
}));
@@ -382,7 +374,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
e.parent = parent;
e.parentId = parent.id;
await this._tree.updateChildren(parent);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(e);
}
}));
@@ -393,7 +384,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
if (newParent) {
newParent.children[newParent.children.findIndex(c => c.id === e.id)] = e;
await this._tree.updateChildren(newParent);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(e);
}
}
@@ -412,7 +402,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
(<ConnectionProfileGroup>movedGroup).parent = newParent;
(<ConnectionProfileGroup>movedGroup).parentId = newParent.id;
await this._tree.updateChildren(newParent);
await this.refreshConnectionTreeTitles();
await this._tree.revealSelectFocusElement(movedGroup);
// Expanding the previously expanded children of the moved group after the move.
this._tree.expandElements(profileExpandedState);
@@ -652,7 +641,6 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
if (this._tree instanceof AsyncServerTree) {
await this._tree.setInput(treeInput!);
await this._tree.updateChildren(treeInput!);
await this.refreshConnectionTreeTitles();
return;
}
await this._tree.setInput(treeInput!);
@@ -913,11 +901,4 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
}
return actionContext;
}
private async refreshConnectionTreeTitles(): Promise<void> {
let treeInput = TreeUpdateUtils.getTreeInput(this._connectionManagementService);
let treeArray = TreeUpdateUtils.alterTreeChildrenTitles([treeInput]);
treeInput = treeArray[0];
await this._tree!.setInput(treeInput);
}
}