mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 09:35:38 -05:00
Fixing new connections not expanding in object explorer. (#22307)
* Fixing new connection node not expanding in OE * Fixing new connections not expanding and fixing expand request not resolving because of some provider error. * Fixing test * Adding a setting for node expansion timeout * Not saving when loading tree based connections * Adding some logs * Removing special casing for mssql provider * Missing providers * Adding user toast for node expansion timeout * Adding notification service to test * Fixing node type for mssql * remove polling * Fixing onNodeStatus * Fixing stuff * consolidating functions * Consolidating resolve logic * removing extra try catch * code cleanup * adding size checks * Removing commented code * Ignoring errors from other sessions and nodepaths.
This commit is contained in:
@@ -293,8 +293,9 @@ export class ServerTreeView extends Disposable implements IServerTreeView {
|
||||
}
|
||||
await this.refreshTree();
|
||||
if (newProfile && !newProfileIsSelected) {
|
||||
await this._tree!.reveal(newProfile);
|
||||
this._tree.setFocus(newProfile);
|
||||
await this._tree.reveal(newProfile);
|
||||
await this._tree.select(newProfile);
|
||||
await this._tree.expand(newProfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,12 @@ const serverTreeConfig: IConfigurationNode = {
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
'description': localize('serverTree.useAsyncServerTree', "(Preview) Use the new async server tree for the Servers view and Connection Dialog with support for new features such as dynamic node filtering.")
|
||||
},
|
||||
'serverTree.nodeExpansionTimeout': {
|
||||
'type': 'number',
|
||||
'default': '45',
|
||||
'description': localize('serverTree.nodeExpansionTimeout', "The timeout in seconds for expanding a node in the Servers view"),
|
||||
'minimum': 1
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -122,17 +122,17 @@ suite('ServerTreeView onAddConnectionProfile handler tests', () => {
|
||||
|
||||
|
||||
|
||||
test('onAddConnectionProfile handler focuses the new profile when no profile is already selected', async () => {
|
||||
test('onAddConnectionProfile handler selects the new profile when no profile is already selected', async () => {
|
||||
let newProfile = <IConnectionProfile>{
|
||||
id: 'test_connection'
|
||||
};
|
||||
await runAddConnectionProfileHandler(undefined, newProfile);
|
||||
mockRefreshTreeMethod.verify(x => x(), TypeMoq.Times.once());
|
||||
mockTree.verify(x => x.clearSelection(), TypeMoq.Times.never());
|
||||
mockTree.verify(x => x.setFocus(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once());
|
||||
mockTree.verify(x => x.select(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once());
|
||||
});
|
||||
|
||||
test('onAddConnectionProfile handler focuses the new profile when a different profile is already selected', async () => {
|
||||
test('onAddConnectionProfile handler selects the new profile when a different profile is already selected', async () => {
|
||||
let oldProfile = <IConnectionProfile>{
|
||||
id: 'old_connection'
|
||||
};
|
||||
@@ -142,7 +142,7 @@ suite('ServerTreeView onAddConnectionProfile handler tests', () => {
|
||||
await runAddConnectionProfileHandler(oldProfile, newProfile);
|
||||
mockRefreshTreeMethod.verify(x => x(), TypeMoq.Times.once());
|
||||
mockTree.verify(x => x.clearSelection(), TypeMoq.Times.once());
|
||||
mockTree.verify(x => x.setFocus(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once());
|
||||
mockTree.verify(x => x.select(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once());
|
||||
});
|
||||
|
||||
test('onAddConnectionProfile handler does not clear the selection when the new profile is already selected', async () => {
|
||||
|
||||
Reference in New Issue
Block a user