Azure pane in connection dialog (#11736)

* azure pane in connection dialog

* fix layering

* fix issues

* fix test

* more test fixes

* add back double click to connect for non-contributed views
This commit is contained in:
Anthony Dresser
2020-08-13 17:02:42 -07:00
committed by GitHub
parent a69b4bf662
commit 8cf82c1f8b
19 changed files with 272 additions and 167 deletions

View File

@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import { INodeContextValue } from 'sql/workbench/browser/parts/views/nodeContext';
import { RawContextKey, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { Disposable } from 'vs/base/common/lifecycle';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
@@ -14,6 +13,12 @@ import { mssqlProviderName } from 'sql/platform/connection/common/constants';
import { NodeType } from 'sql/workbench/services/objectExplorer/common/nodeType';
import { DatabaseEngineEdition } from 'sql/workbench/api/common/sqlExtHostTypes';
import { isWindows } from 'vs/base/common/platform';
import { ITreeItem } from 'sql/workbench/common/views';
export interface INodeContextValue {
node: ITreeItem;
viewId: string;
}
export class MssqlNodeContext extends Disposable {

View File

@@ -47,7 +47,7 @@ export class TreeUpdateUtils {
/**
* Set input for the tree.
*/
public static structuralTreeUpdate(tree: ITree, viewKey: string, connectionManagementService: IConnectionManagementService, providers?: string[]): Promise<void> {
public static structuralTreeUpdate(tree: ITree, viewKey: 'recent' | 'active' | 'saved', connectionManagementService: IConnectionManagementService, providers?: string[]): Promise<void> {
// convert to old VS Code tree interface with expandable methods
let expandableTree: IExpandableTree = <IExpandableTree>tree;
@@ -61,7 +61,7 @@ export class TreeUpdateUtils {
targetsToExpand = expandableTree.getExpandedElements();
}
let groups;
let treeInput = new ConnectionProfileGroup('root', null, undefined, undefined, undefined);
let treeInput = new ConnectionProfileGroup('root', null, undefined);
if (viewKey === 'recent') {
groups = connectionManagementService.getRecentConnections(providers);
treeInput.addConnections(groups);
@@ -71,7 +71,7 @@ export class TreeUpdateUtils {
} else if (viewKey === 'saved') {
treeInput = TreeUpdateUtils.getTreeInput(connectionManagementService, providers);
}
const previousTreeInput: any = tree.getInput();
const previousTreeInput = tree.getInput();
return tree.setInput(treeInput).then(async () => {
if (previousTreeInput instanceof Disposable) {
previousTreeInput.dispose();
@@ -83,7 +83,6 @@ export class TreeUpdateUtils {
if (selectedElement) {
tree.select(selectedElement);
}
tree.getFocus();
});
}