mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Changed connection title generation to use getConnections (including recent and saved). (#22954)
* remove advanced options for table designer and notebook Actions title (unnecessary in usage context)
* Revert "remove advanced options for table designer and notebook Actions title (unnecessary in usage context)"
This reverts commit e30aee5151319863aebbb4738fb30354c179c2c5.
* added changes based on feedback
* added null check and updated tests
* WIP change to connection title generation
* WIP connection management service update
* fix to connectionManagementService test
* fix editorConnectionTitles
* renamed nondefault to distinguishing options
* use stored connections for options
* removed erroneous connection name set to null
* added title by ID search for title generation
* Add recent connection title
* added fix for stub bug
* added child title options appended
* WIP rework of getEditorTitle
* more work done
* WIP changes for 5-2-2023
* moved server info to generate titles.
* added reworked title generation
* added working active connection title generation and cleanup
* added comments to argument
* remove unnecessary spaces
* added id fix assign
* added fromEditor save
* Revert "Revert new connection string format (#22997)"
This reverts commit 898bb73a34.
* added small fix to tests and exclude empty properties
* made small fixes for tests
* update expected ID
* added support for old password key and removed empty options
* added in authenticationType core property
* fix for whitespace indentation
* added connection save profile to thing
* made some small fixes to connection options
* added small change to connectionDialogService
* added nullcheck for saveProfile
* added negation for connection saveProfile
* remove duplicate editor title generation
* added edit profile handling for titles
* Cleanup serverCapabilities property
* fixed dependency issues
* removed connectionproviderproperties
* added fix for treeupdateutils
* made update to title generation
* added recent connections change
* Revert "Cleanup serverCapabilities property"
This reverts commit 2c7b94f98cabddb34116dcdd83177614a484c026.
* added dashboard text and fix for connection store test
* added group name to end also temporary added dashboard changes based on feedback
* added in new SQL version
* added fix to edit connections
* added clarifying information to title generation
---------
Co-authored-by: Cheena Malhotra <cmalhotra@microsoft.com>
This commit is contained in:
@@ -125,6 +125,7 @@ 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()) {
|
||||
@@ -272,6 +273,7 @@ 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);
|
||||
}
|
||||
@@ -286,6 +288,7 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -298,6 +301,7 @@ 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,12 +319,14 @@ 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);
|
||||
}
|
||||
@@ -345,6 +351,7 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
||||
await this._tree.updateChildren(newParent);
|
||||
await this._tree.expand(newParent);
|
||||
}
|
||||
await this.refreshConnectionTreeTitles();
|
||||
const newConnection = this._tree.getElementById(movedConnection.id);
|
||||
if (newConnection) {
|
||||
await this._tree.revealSelectFocusElement(newConnection);
|
||||
@@ -359,6 +366,7 @@ 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);
|
||||
}
|
||||
}));
|
||||
@@ -381,6 +389,7 @@ 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);
|
||||
}
|
||||
}));
|
||||
@@ -391,6 +400,7 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -409,6 +419,7 @@ 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);
|
||||
@@ -695,6 +706,7 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
||||
return;
|
||||
}
|
||||
await this._tree.setInput(treeInput!);
|
||||
await this.refreshConnectionTreeTitles();
|
||||
if (isHidden(this.messages!)) {
|
||||
this._tree.getFocus();
|
||||
if (this._tree instanceof AsyncServerTree) {
|
||||
@@ -960,6 +972,13 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
||||
return actionContext;
|
||||
}
|
||||
|
||||
private async refreshConnectionTreeTitles(): Promise<void> {
|
||||
let treeInput = this._tree.getInput();
|
||||
let treeArray = TreeUpdateUtils.alterTreeChildrenTitles([treeInput], this._connectionManagementService, false);
|
||||
treeInput = treeArray[0];
|
||||
await this._tree!.setInput(treeInput);
|
||||
}
|
||||
|
||||
public collapseAllConnections(): void {
|
||||
const root = TreeUpdateUtils.getTreeInput(this._connectionManagementService)!;
|
||||
const connections = ConnectionProfileGroup.getConnectionsInGroup(root);
|
||||
|
||||
Reference in New Issue
Block a user