mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix menu item not showing up for non-English languages (#20224)
* new object type property * vbump sts * fix azure tree * mark as optional * Fix test errors
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
|
||||||
"version": "4.2.0.5",
|
"version": "4.2.0.8",
|
||||||
"downloadFileNames": {
|
"downloadFileNames": {
|
||||||
"Windows_86": "win-x86-net6.0.zip",
|
"Windows_86": "win-x86-net6.0.zip",
|
||||||
"Windows_64": "win-x64-net6.0.zip",
|
"Windows_64": "win-x64-net6.0.zip",
|
||||||
|
|||||||
@@ -511,7 +511,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.newTable",
|
"command": "mssql.newTable",
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Folder && nodeLabel == Tables && config.workbench.enablePreviewFeatures",
|
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType == Tables && config.workbench.enablePreviewFeatures",
|
||||||
"group": "0_query@1"
|
"group": "0_query@1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -523,7 +523,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "mssql.newTable",
|
"command": "mssql.newTable",
|
||||||
"when": "connectionProvider == MSSQL && nodeType == Folder && nodeLabel == Tables && config.workbench.enablePreviewFeatures",
|
"when": "connectionProvider == MSSQL && nodeType == Folder && objectType == Tables && config.workbench.enablePreviewFeatures",
|
||||||
"group": "connection@1"
|
"group": "connection@1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
8
src/sql/azdata.proposed.d.ts
vendored
8
src/sql/azdata.proposed.d.ts
vendored
@@ -1606,4 +1606,12 @@ declare module 'azdata' {
|
|||||||
onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void;
|
onQueryEvent(type: QueryEventType, document: QueryDocument, args: ResultSetSummary | string | undefined, queryInfo: QueryInfo): void;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface NodeInfo {
|
||||||
|
/**
|
||||||
|
* The object type of the node. Node type is used to determine the icon, the object type is the actual type of the node, e.g. for Tables node
|
||||||
|
* under the database, the nodeType is Folder, the objectType is be Tables.
|
||||||
|
*/
|
||||||
|
objectType?: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Strict, connectionManagementService);
|
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Strict, connectionManagementService);
|
||||||
objectExplorerService.callBase = true;
|
objectExplorerService.callBase = true;
|
||||||
objectExplorerService.setup(x => x.getTreeNode(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve(getTreeNodeReturnVal));
|
objectExplorerService.setup(x => x.getTreeNode(TypeMoq.It.isAny(), TypeMoq.It.isAny())).returns(() => Promise.resolve(getTreeNodeReturnVal));
|
||||||
objectExplorerService.setup(x => x.getObjectExplorerNode(TypeMoq.It.isAny())).returns(() => new TreeNode('', '', false, '', '', '', undefined, undefined, undefined, undefined));
|
objectExplorerService.setup(x => x.getObjectExplorerNode(TypeMoq.It.isAny())).returns(() => new TreeNode('', '', '', false, '', '', '', undefined, undefined, undefined, undefined));
|
||||||
objectExplorerService.setup(x => x.getObjectExplorerNode(undefined)).returns(() => new TreeNode('', '', false, '', '', '', undefined, undefined, undefined, undefined));
|
objectExplorerService.setup(x => x.getObjectExplorerNode(undefined)).returns(() => new TreeNode('', '', '', false, '', '', '', undefined, undefined, undefined, undefined));
|
||||||
objectExplorerService.setup(x => x.onUpdateObjectExplorerNodes).returns(() => new Emitter<ObjectExplorerNodeEventArgs>().event);
|
objectExplorerService.setup(x => x.onUpdateObjectExplorerNodes).returns(() => new Emitter<ObjectExplorerNodeEventArgs>().event);
|
||||||
|
|
||||||
objectExplorerService.setup(x => x.onUpdateObjectExplorerNodes).returns(() => new Emitter<ObjectExplorerNodeEventArgs>().event);
|
objectExplorerService.setup(x => x.onUpdateObjectExplorerNodes).returns(() => new Emitter<ObjectExplorerNodeEventArgs>().event);
|
||||||
@@ -192,7 +192,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
saveProfile: true,
|
saveProfile: true,
|
||||||
id: 'testId'
|
id: 'testId'
|
||||||
});
|
});
|
||||||
let treeNode = new TreeNode(NodeType.Database, 'db node', false, '', '', '', undefined, undefined, undefined, undefined);
|
let treeNode = new TreeNode(NodeType.Database, '', 'db node', false, '', '', '', undefined, undefined, undefined, undefined);
|
||||||
treeNode.connection = connection;
|
treeNode.connection = connection;
|
||||||
let connectionManagementService = createConnectionManagementService(isConnectedReturnValue, connection);
|
let connectionManagementService = createConnectionManagementService(isConnectedReturnValue, connection);
|
||||||
let objectExplorerService = createObjectExplorerService(connectionManagementService.object, treeNode);
|
let objectExplorerService = createObjectExplorerService(connectionManagementService.object, treeNode);
|
||||||
@@ -409,6 +409,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
rootNode: {
|
rootNode: {
|
||||||
nodePath: 'testServerName\tables',
|
nodePath: 'testServerName\tables',
|
||||||
nodeType: NodeType.Folder,
|
nodeType: NodeType.Folder,
|
||||||
|
objectType: '',
|
||||||
label: 'Tables',
|
label: 'Tables',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -419,11 +420,11 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
errorMessage: ''
|
errorMessage: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
let tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
tablesNode.session = objectExplorerSession;
|
tablesNode.session = objectExplorerSession;
|
||||||
let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table1Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table2Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
tablesNode.children = [table1Node, table2Node];
|
tablesNode.children = [table1Node, table2Node];
|
||||||
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
||||||
objectExplorerService.callBase = true;
|
objectExplorerService.callBase = true;
|
||||||
@@ -495,6 +496,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
rootNode: {
|
rootNode: {
|
||||||
nodePath: 'testServerName\tables',
|
nodePath: 'testServerName\tables',
|
||||||
nodeType: NodeType.Folder,
|
nodeType: NodeType.Folder,
|
||||||
|
objectType: '',
|
||||||
label: 'Tables',
|
label: 'Tables',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -505,11 +507,11 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
errorMessage: ''
|
errorMessage: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
let tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
tablesNode.session = objectExplorerSession;
|
tablesNode.session = objectExplorerSession;
|
||||||
let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table1Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table2Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
tablesNode.children = [table1Node, table2Node];
|
tablesNode.children = [table1Node, table2Node];
|
||||||
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
||||||
objectExplorerService.callBase = true;
|
objectExplorerService.callBase = true;
|
||||||
@@ -582,6 +584,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
rootNode: {
|
rootNode: {
|
||||||
nodePath: 'testServerName\tables',
|
nodePath: 'testServerName\tables',
|
||||||
nodeType: NodeType.Folder,
|
nodeType: NodeType.Folder,
|
||||||
|
objectType: '',
|
||||||
label: 'Tables',
|
label: 'Tables',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -592,11 +595,11 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
errorMessage: ''
|
errorMessage: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
let tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
tablesNode.session = objectExplorerSession;
|
tablesNode.session = objectExplorerSession;
|
||||||
let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table1Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table2Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
tablesNode.children = [table1Node, table2Node];
|
tablesNode.children = [table1Node, table2Node];
|
||||||
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
||||||
objectExplorerService.callBase = true;
|
objectExplorerService.callBase = true;
|
||||||
@@ -678,6 +681,7 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
rootNode: {
|
rootNode: {
|
||||||
nodePath: 'testServerName\tables',
|
nodePath: 'testServerName\tables',
|
||||||
nodeType: NodeType.Folder,
|
nodeType: NodeType.Folder,
|
||||||
|
objectType: '',
|
||||||
label: 'Tables',
|
label: 'Tables',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -688,11 +692,11 @@ suite('SQL Connection Tree Action tests', () => {
|
|||||||
errorMessage: ''
|
errorMessage: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
let tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
let tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\Db1\tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
tablesNode.session = objectExplorerSession;
|
tablesNode.session = objectExplorerSession;
|
||||||
let table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table1Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
let table2Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
let table2Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\tables\dbo.Table1', '', '', tablesNode, null, undefined, undefined);
|
||||||
tablesNode.children = [table1Node, table2Node];
|
tablesNode.children = [table1Node, table2Node];
|
||||||
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
let objectExplorerService = TypeMoq.Mock.ofType(ObjectExplorerService, TypeMoq.MockBehavior.Loose, connectionManagementService.object);
|
||||||
objectExplorerService.callBase = true;
|
objectExplorerService.callBase = true;
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ const connection: azdata.IConnectionProfile = {
|
|||||||
|
|
||||||
const nodeInfo: azdata.NodeInfo = {
|
const nodeInfo: azdata.NodeInfo = {
|
||||||
nodePath: 'MyServer',
|
nodePath: 'MyServer',
|
||||||
|
objectType: '',
|
||||||
nodeStatus: '',
|
nodeStatus: '',
|
||||||
nodeSubType: '',
|
nodeSubType: '',
|
||||||
nodeType: 'Server',
|
nodeType: 'Server',
|
||||||
@@ -51,7 +52,7 @@ const nodeInfo: azdata.NodeInfo = {
|
|||||||
errorMessage: ''
|
errorMessage: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
const treeNode = new TreeNode(NodeType.Database, 'db node', false, '', '', '', undefined, undefined, undefined, undefined);
|
const treeNode = new TreeNode(NodeType.Database, '', 'db node', false, '', '', '', undefined, undefined, undefined, undefined);
|
||||||
const oeActionArgs: ObjectExplorerActionsContext = { connectionProfile: connection, isConnectionNode: false, nodeInfo: nodeInfo };
|
const oeActionArgs: ObjectExplorerActionsContext = { connectionProfile: connection, isConnectionNode: false, nodeInfo: nodeInfo };
|
||||||
|
|
||||||
let instantiationService: IInstantiationService;
|
let instantiationService: IInstantiationService;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export class MssqlNodeContext extends Disposable {
|
|||||||
static IsWindows = new RawContextKey<boolean>('isWindows', isWindows);
|
static IsWindows = new RawContextKey<boolean>('isWindows', isWindows);
|
||||||
static IsCloud = new RawContextKey<boolean>('isCloud', false);
|
static IsCloud = new RawContextKey<boolean>('isCloud', false);
|
||||||
static NodeType = new RawContextKey<string>('nodeType', undefined);
|
static NodeType = new RawContextKey<string>('nodeType', undefined);
|
||||||
|
static ObjectType = new RawContextKey<string>('objectType', undefined);
|
||||||
static NodeLabel = new RawContextKey<string>('nodeLabel', undefined);
|
static NodeLabel = new RawContextKey<string>('nodeLabel', undefined);
|
||||||
static EngineEdition = new RawContextKey<number>('engineEdition', DatabaseEngineEdition.Unknown);
|
static EngineEdition = new RawContextKey<number>('engineEdition', DatabaseEngineEdition.Unknown);
|
||||||
static CanOpenInAzurePortal = new RawContextKey<boolean>('canOpenInAzurePortal', false);
|
static CanOpenInAzurePortal = new RawContextKey<boolean>('canOpenInAzurePortal', false);
|
||||||
@@ -53,6 +54,7 @@ export class MssqlNodeContext extends Disposable {
|
|||||||
private nodeProviderKey!: IContextKey<string>;
|
private nodeProviderKey!: IContextKey<string>;
|
||||||
private isCloudKey!: IContextKey<boolean>;
|
private isCloudKey!: IContextKey<boolean>;
|
||||||
private nodeTypeKey!: IContextKey<string>;
|
private nodeTypeKey!: IContextKey<string>;
|
||||||
|
private objectTypeKey!: IContextKey<string>;
|
||||||
private nodeLabelKey!: IContextKey<string>;
|
private nodeLabelKey!: IContextKey<string>;
|
||||||
private isDatabaseOrServerKey!: IContextKey<boolean>;
|
private isDatabaseOrServerKey!: IContextKey<boolean>;
|
||||||
private engineEditionKey!: IContextKey<number>;
|
private engineEditionKey!: IContextKey<number>;
|
||||||
@@ -96,6 +98,7 @@ export class MssqlNodeContext extends Disposable {
|
|||||||
if (node.label) {
|
if (node.label) {
|
||||||
this.nodeLabelKey.set(node.label.label);
|
this.nodeLabelKey.set(node.label.label);
|
||||||
}
|
}
|
||||||
|
this.objectTypeKey.set(node.nodeInfo?.objectType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,6 +106,7 @@ export class MssqlNodeContext extends Disposable {
|
|||||||
this.isCloudKey = MssqlNodeContext.IsCloud.bindTo(this.contextKeyService);
|
this.isCloudKey = MssqlNodeContext.IsCloud.bindTo(this.contextKeyService);
|
||||||
this.engineEditionKey = MssqlNodeContext.EngineEdition.bindTo(this.contextKeyService);
|
this.engineEditionKey = MssqlNodeContext.EngineEdition.bindTo(this.contextKeyService);
|
||||||
this.nodeTypeKey = MssqlNodeContext.NodeType.bindTo(this.contextKeyService);
|
this.nodeTypeKey = MssqlNodeContext.NodeType.bindTo(this.contextKeyService);
|
||||||
|
this.objectTypeKey = MssqlNodeContext.ObjectType.bindTo(this.contextKeyService);
|
||||||
this.nodeLabelKey = MssqlNodeContext.NodeLabel.bindTo(this.contextKeyService);
|
this.nodeLabelKey = MssqlNodeContext.NodeLabel.bindTo(this.contextKeyService);
|
||||||
this.isDatabaseOrServerKey = MssqlNodeContext.IsDatabaseOrServer.bindTo(this.contextKeyService);
|
this.isDatabaseOrServerKey = MssqlNodeContext.IsDatabaseOrServer.bindTo(this.contextKeyService);
|
||||||
this.canScriptAsSelectKey = MssqlNodeContext.CanScriptAsSelect.bindTo(this.contextKeyService);
|
this.canScriptAsSelectKey = MssqlNodeContext.CanScriptAsSelect.bindTo(this.contextKeyService);
|
||||||
|
|||||||
@@ -469,6 +469,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
let allNodes: azdata.NodeInfo[] = [];
|
let allNodes: azdata.NodeInfo[] = [];
|
||||||
let errorNode: azdata.NodeInfo = {
|
let errorNode: azdata.NodeInfo = {
|
||||||
nodePath: nodePath,
|
nodePath: nodePath,
|
||||||
|
objectType: 'error',
|
||||||
label: 'Error',
|
label: 'Error',
|
||||||
errorMessage: '',
|
errorMessage: '',
|
||||||
nodeType: 'error',
|
nodeType: 'error',
|
||||||
@@ -625,7 +626,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let node = new TreeNode(nodeInfo.nodeType, nodeInfo.label, isLeaf, nodeInfo.nodePath,
|
let node = new TreeNode(nodeInfo.nodeType, nodeInfo.objectType, nodeInfo.label, isLeaf, nodeInfo.nodePath,
|
||||||
nodeInfo.nodeSubType!, nodeInfo.nodeStatus, parent, nodeInfo.metadata, nodeInfo.iconType, nodeInfo.icon, {
|
nodeInfo.nodeSubType!, nodeInfo.nodeStatus, parent, nodeInfo.metadata, nodeInfo.iconType, nodeInfo.icon, {
|
||||||
getChildren: (treeNode?: TreeNode) => this.getChildren(treeNode),
|
getChildren: (treeNode?: TreeNode) => this.getChildren(treeNode),
|
||||||
isExpanded: treeNode => this.isExpanded(treeNode),
|
isExpanded: treeNode => this.isExpanded(treeNode),
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ export class OEShimService extends Disposable implements IOEShimService {
|
|||||||
|
|
||||||
const sessionId = await this.getOrCreateSession(viewId, node);
|
const sessionId = await this.getOrCreateSession(viewId, node);
|
||||||
const requestHandle = this.nodeHandleMap.get(generateNodeMapKey(viewId, node)) || node.handle;
|
const requestHandle = this.nodeHandleMap.get(generateNodeMapKey(viewId, node)) || node.handle;
|
||||||
const treeNode = new TreeNode(undefined!, undefined!, undefined!, requestHandle, undefined!); // hack since this entire system is a hack anyways
|
const treeNode = new TreeNode(undefined!, undefined!, undefined!, undefined!, requestHandle, undefined!); // hack since this entire system is a hack anyways
|
||||||
treeNode.connection = new ConnectionProfile(this.capabilities, node.payload);
|
treeNode.connection = new ConnectionProfile(this.capabilities, node.payload);
|
||||||
const childrenNodes = await this.oe.refreshTreeNode({
|
const childrenNodes = await this.oe.refreshTreeNode({
|
||||||
success: true,
|
success: true,
|
||||||
@@ -186,6 +186,7 @@ export class OEShimService extends Disposable implements IOEShimService {
|
|||||||
const nodeInfo: azdata.NodeInfo = {
|
const nodeInfo: azdata.NodeInfo = {
|
||||||
nodePath: nodePath,
|
nodePath: nodePath,
|
||||||
nodeType: node.nodeTypeId,
|
nodeType: node.nodeTypeId,
|
||||||
|
objectType: node.objectType,
|
||||||
nodeSubType: node.nodeSubType,
|
nodeSubType: node.nodeSubType,
|
||||||
nodeStatus: node.nodeStatus,
|
nodeStatus: node.nodeStatus,
|
||||||
label: node.label,
|
label: node.label,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export class ServerTreeActionProvider {
|
|||||||
* Return actions for connection elements
|
* Return actions for connection elements
|
||||||
*/
|
*/
|
||||||
private getConnectionActions(tree: AsyncServerTree | ITree, profile: ConnectionProfile): IAction[] {
|
private getConnectionActions(tree: AsyncServerTree | ITree, profile: ConnectionProfile): IAction[] {
|
||||||
let node = new TreeNode(NodeType.Server, '', false, '', '', '', undefined, undefined, undefined, undefined);
|
let node = new TreeNode(NodeType.Server, NodeType.Server, '', false, '', '', '', undefined, undefined, undefined, undefined);
|
||||||
node.connection = profile;
|
node.connection = profile;
|
||||||
return this.getAllActions({
|
return this.getAllActions({
|
||||||
tree: tree,
|
tree: tree,
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ export class TreeNode {
|
|||||||
*/
|
*/
|
||||||
public nodeTypeId: string;
|
public nodeTypeId: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The object type.
|
||||||
|
*/
|
||||||
|
public objectType: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Label to display to the user, describing this node
|
* Label to display to the user, describing this node
|
||||||
*/
|
*/
|
||||||
@@ -94,12 +99,13 @@ export class TreeNode {
|
|||||||
|
|
||||||
public icon?: IconPath | SqlThemeIcon;
|
public icon?: IconPath | SqlThemeIcon;
|
||||||
|
|
||||||
constructor(nodeTypeId: string, label: string, isAlwaysLeaf: boolean, nodePath: string,
|
constructor(nodeTypeId: string, objectType: string, label: string, isAlwaysLeaf: boolean, nodePath: string,
|
||||||
nodeSubType: string, nodeStatus?: string, parent?: TreeNode, metadata?: azdata.ObjectMetadata,
|
nodeSubType: string, nodeStatus?: string, parent?: TreeNode, metadata?: azdata.ObjectMetadata,
|
||||||
iconType?: string | SqlThemeIcon,
|
iconType?: string | SqlThemeIcon,
|
||||||
icon?: IconPath | SqlThemeIcon,
|
icon?: IconPath | SqlThemeIcon,
|
||||||
private _objectExplorerCallbacks?: ObjectExplorerCallbacks) {
|
private _objectExplorerCallbacks?: ObjectExplorerCallbacks) {
|
||||||
this.nodeTypeId = nodeTypeId;
|
this.nodeTypeId = nodeTypeId;
|
||||||
|
this.objectType = objectType;
|
||||||
this.label = label;
|
this.label = label;
|
||||||
this.isAlwaysLeaf = isAlwaysLeaf;
|
this.isAlwaysLeaf = isAlwaysLeaf;
|
||||||
this.nodePath = nodePath;
|
this.nodePath = nodePath;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilit
|
|||||||
export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
||||||
|
|
||||||
static NodeType = new RawContextKey<string>('nodeType', undefined);
|
static NodeType = new RawContextKey<string>('nodeType', undefined);
|
||||||
|
static ObjectType = new RawContextKey<string>('objectType', undefined);
|
||||||
static SubType = new RawContextKey<string>('nodeSubType', undefined);
|
static SubType = new RawContextKey<string>('nodeSubType', undefined);
|
||||||
static Status = new RawContextKey<string>('nodeStatus', undefined);
|
static Status = new RawContextKey<string>('nodeStatus', undefined);
|
||||||
static TreeNode = new RawContextKey<TreeNode>('treeNode', undefined);
|
static TreeNode = new RawContextKey<TreeNode>('treeNode', undefined);
|
||||||
@@ -18,6 +19,7 @@ export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
|||||||
static IsQueryProvider = new RawContextKey<boolean>('isQueryProvider', false);
|
static IsQueryProvider = new RawContextKey<boolean>('isQueryProvider', false);
|
||||||
|
|
||||||
private _nodeTypeKey: IContextKey<string>;
|
private _nodeTypeKey: IContextKey<string>;
|
||||||
|
private _objectTypeKey: IContextKey<string>;
|
||||||
private _subTypeKey: IContextKey<string>;
|
private _subTypeKey: IContextKey<string>;
|
||||||
private _statusKey: IContextKey<string>;
|
private _statusKey: IContextKey<string>;
|
||||||
private _treeNodeKey: IContextKey<TreeNode>;
|
private _treeNodeKey: IContextKey<TreeNode>;
|
||||||
@@ -30,6 +32,7 @@ export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
|||||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService
|
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService
|
||||||
) {
|
) {
|
||||||
this._nodeTypeKey = TreeNodeContextKey.NodeType.bindTo(contextKeyService);
|
this._nodeTypeKey = TreeNodeContextKey.NodeType.bindTo(contextKeyService);
|
||||||
|
this._objectTypeKey = TreeNodeContextKey.ObjectType.bindTo(contextKeyService);
|
||||||
this._subTypeKey = TreeNodeContextKey.SubType.bindTo(contextKeyService);
|
this._subTypeKey = TreeNodeContextKey.SubType.bindTo(contextKeyService);
|
||||||
this._statusKey = TreeNodeContextKey.Status.bindTo(contextKeyService);
|
this._statusKey = TreeNodeContextKey.Status.bindTo(contextKeyService);
|
||||||
this._treeNodeKey = TreeNodeContextKey.TreeNode.bindTo(contextKeyService);
|
this._treeNodeKey = TreeNodeContextKey.TreeNode.bindTo(contextKeyService);
|
||||||
@@ -41,6 +44,7 @@ export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
|||||||
set(value: TreeNode) {
|
set(value: TreeNode) {
|
||||||
this._treeNodeKey.set(value);
|
this._treeNodeKey.set(value);
|
||||||
this._nodeTypeKey.set(value && value.nodeTypeId);
|
this._nodeTypeKey.set(value && value.nodeTypeId);
|
||||||
|
this._objectTypeKey.set(value && value.objectType);
|
||||||
this._subTypeKey.set(value && value.nodeSubType);
|
this._subTypeKey.set(value && value.nodeSubType);
|
||||||
if (value.nodeStatus) {
|
if (value.nodeStatus) {
|
||||||
this._statusKey.set(value && value.nodeStatus);
|
this._statusKey.set(value && value.nodeStatus);
|
||||||
@@ -54,6 +58,7 @@ export class TreeNodeContextKey implements IContextKey<TreeNode> {
|
|||||||
|
|
||||||
reset(): void {
|
reset(): void {
|
||||||
this._nodeTypeKey.reset();
|
this._nodeTypeKey.reset();
|
||||||
|
this._objectTypeKey.reset();
|
||||||
this._subTypeKey.reset();
|
this._subTypeKey.reset();
|
||||||
this._statusKey.reset();
|
this._statusKey.reset();
|
||||||
this._treeNodeKey.reset();
|
this._treeNodeKey.reset();
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ suite('AsyncServerTreeDragAndDrop', () => {
|
|||||||
let connectionProfileArray = [connectionProfile];
|
let connectionProfileArray = [connectionProfile];
|
||||||
let connectionProfileGroupId = new ConnectionProfileGroup('name', undefined, 'd936bb32-422b-49c3-963f-ae9532d63dc5', 'color', 'description');
|
let connectionProfileGroupId = new ConnectionProfileGroup('name', undefined, 'd936bb32-422b-49c3-963f-ae9532d63dc5', 'color', 'description');
|
||||||
let connectionProfileGroupArray = [connectionProfileGroupId];
|
let connectionProfileGroupArray = [connectionProfileGroupId];
|
||||||
let treeNode = new TreeNode('Column', 'label', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
let treeNode = new TreeNode('Column', '', 'label', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||||
let treeNodeArray = [treeNode];
|
let treeNodeArray = [treeNode];
|
||||||
|
|
||||||
setup(() => {
|
setup(() => {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ suite('SQL Drag And Drop Controller tests', () => {
|
|||||||
let connectionProfileGroupId = new ConnectionProfileGroup('name', undefined, 'd936bb32-422b-49c3-963f-ae9532d63dc5', 'color', 'description');
|
let connectionProfileGroupId = new ConnectionProfileGroup('name', undefined, 'd936bb32-422b-49c3-963f-ae9532d63dc5', 'color', 'description');
|
||||||
connectionProfileGroupId.addConnections([connectionProfileId_pgsql]);
|
connectionProfileGroupId.addConnections([connectionProfileId_pgsql]);
|
||||||
let connectionProfileGroupArray = [connectionProfileGroupId];
|
let connectionProfileGroupArray = [connectionProfileGroupId];
|
||||||
let treeNode = new TreeNode('Column', 'label', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
let treeNode = new TreeNode('Column', '', 'label', undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
||||||
let treeNodeArray = [treeNode];
|
let treeNodeArray = [treeNode];
|
||||||
|
|
||||||
setup(() => {
|
setup(() => {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
const NodeInfoTable1 = {
|
const NodeInfoTable1 = {
|
||||||
nodePath: 'testServerName/tables/dbo.Table1',
|
nodePath: 'testServerName/tables/dbo.Table1',
|
||||||
nodeType: NodeType.Table,
|
nodeType: NodeType.Table,
|
||||||
|
objectType: '',
|
||||||
label: 'dbo.Table1',
|
label: 'dbo.Table1',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -53,6 +54,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
const NodeInfoTable2 = {
|
const NodeInfoTable2 = {
|
||||||
nodePath: 'testServerName/tables/dbo.Table2',
|
nodePath: 'testServerName/tables/dbo.Table2',
|
||||||
nodeType: NodeType.Table,
|
nodeType: NodeType.Table,
|
||||||
|
objectType: '',
|
||||||
label: 'dbo.Table2',
|
label: 'dbo.Table2',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -64,6 +66,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
const NodeInfoTable3 = {
|
const NodeInfoTable3 = {
|
||||||
nodePath: 'testServerName/tables/dbo.Table3',
|
nodePath: 'testServerName/tables/dbo.Table3',
|
||||||
nodeType: NodeType.Table,
|
nodeType: NodeType.Table,
|
||||||
|
objectType: '',
|
||||||
label: 'dbo.Table3',
|
label: 'dbo.Table3',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -78,6 +81,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
rootNode: {
|
rootNode: {
|
||||||
nodePath: 'testServerName/tables',
|
nodePath: 'testServerName/tables',
|
||||||
nodeType: NodeType.Folder,
|
nodeType: NodeType.Folder,
|
||||||
|
objectType: '',
|
||||||
label: 'Tables',
|
label: 'Tables',
|
||||||
isLeaf: false,
|
isLeaf: false,
|
||||||
metadata: null,
|
metadata: null,
|
||||||
@@ -325,7 +329,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('expand node should expand node correctly', async () => {
|
test('expand node should expand node correctly', async () => {
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
||||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||||
const expandInfo = await objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, tablesNode);
|
const expandInfo = await objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, tablesNode);
|
||||||
@@ -338,7 +342,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('refresh node should refresh node correctly', async () => {
|
test('refresh node should refresh node correctly', async () => {
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
||||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||||
const expandInfo = await objectExplorerService.refreshNode(mssqlProviderName, objectExplorerSession, tablesNode);
|
const expandInfo = await objectExplorerService.refreshNode(mssqlProviderName, objectExplorerSession, tablesNode);
|
||||||
@@ -351,7 +355,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('expand tree node should get correct children', async () => {
|
test('expand tree node should get correct children', async () => {
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||||
@@ -366,7 +370,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('refresh tree node should children correctly', async () => {
|
test('refresh tree node should children correctly', async () => {
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName/tables', '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
await objectExplorerService.createNewSession(mssqlProviderName, connection);
|
||||||
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
objectExplorerService.onSessionCreated(1, objectExplorerSession);
|
||||||
@@ -413,13 +417,13 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
parentName: undefined,
|
parentName: undefined,
|
||||||
parentTypeName: undefined
|
parentTypeName: undefined
|
||||||
};
|
};
|
||||||
const databaseNode = new TreeNode(NodeType.Database, 'Db1', false, 'testServerName\\Db1', '', '', undefined, databaseMetaData, undefined, undefined);
|
const databaseNode = new TreeNode(NodeType.Database, '', 'Db1', false, 'testServerName\\Db1', '', '', undefined, databaseMetaData, undefined, undefined);
|
||||||
databaseNode.connection = connection;
|
databaseNode.connection = connection;
|
||||||
databaseNode.session = objectExplorerSession;
|
databaseNode.session = objectExplorerSession;
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, undefined, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, undefined, undefined, undefined);
|
||||||
databaseNode.children = [tablesNode];
|
databaseNode.children = [tablesNode];
|
||||||
const table1Node = new TreeNode(NodeType.Table, 'dbo.Table1', false, 'testServerName\\Db1\\tables\\dbo.Table1', '', '', tablesNode, undefined, undefined, undefined);
|
const table1Node = new TreeNode(NodeType.Table, '', 'dbo.Table1', false, 'testServerName\\Db1\\tables\\dbo.Table1', '', '', tablesNode, undefined, undefined, undefined);
|
||||||
const table2Node = new TreeNode(NodeType.Table, 'dbo.Table2', false, 'testServerName\\Db1\\tables\\dbo.Table2', '', '', tablesNode, undefined, undefined, undefined);
|
const table2Node = new TreeNode(NodeType.Table, '', 'dbo.Table2', false, 'testServerName\\Db1\\tables\\dbo.Table2', '', '', tablesNode, undefined, undefined, undefined);
|
||||||
tablesNode.children = [table1Node, table2Node];
|
tablesNode.children = [table1Node, table2Node];
|
||||||
assert.strictEqual(table1Node.getSession(), objectExplorerSession);
|
assert.strictEqual(table1Node.getSession(), objectExplorerSession);
|
||||||
assert.strictEqual(table1Node.getConnectionProfile(), connection);
|
assert.strictEqual(table1Node.getConnectionProfile(), connection);
|
||||||
@@ -438,7 +442,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
|
|
||||||
test('getSelectedProfileAndDatabase returns the profile but no database if children of a server are selected', () => {
|
test('getSelectedProfileAndDatabase returns the profile but no database if children of a server are selected', () => {
|
||||||
const serverTreeView = TypeMoq.Mock.ofInstance({ getSelection: () => undefined, onSelectionOrFocusChange: Event.None } as IServerTreeView);
|
const serverTreeView = TypeMoq.Mock.ofInstance({ getSelection: () => undefined, onSelectionOrFocusChange: Event.None } as IServerTreeView);
|
||||||
const databaseNode = new TreeNode(NodeType.Folder, 'Folder1', false, 'testServerName\\Folder1', '', '', undefined, undefined, undefined, undefined);
|
const databaseNode = new TreeNode(NodeType.Folder, '', 'Folder1', false, 'testServerName\\Folder1', '', '', undefined, undefined, undefined, undefined);
|
||||||
databaseNode.connection = connection;
|
databaseNode.connection = connection;
|
||||||
serverTreeView.setup(x => x.getSelection()).returns(() => [databaseNode]);
|
serverTreeView.setup(x => x.getSelection()).returns(() => [databaseNode]);
|
||||||
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
objectExplorerService.registerServerTreeView(serverTreeView.object);
|
||||||
@@ -460,8 +464,8 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
parentTypeName: undefined
|
parentTypeName: undefined
|
||||||
};
|
};
|
||||||
const databaseName = 'Db1';
|
const databaseName = 'Db1';
|
||||||
const databaseNode = new TreeNode(NodeType.Database, databaseName, false, 'testServerName\\Db1', '', '', undefined, databaseMetadata, undefined, undefined);
|
const databaseNode = new TreeNode(NodeType.Database, '', databaseName, false, 'testServerName\\Db1', '', '', undefined, databaseMetadata, undefined, undefined);
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, undefined, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, 'testServerName\\Db1\\tables', '', '', databaseNode, undefined, undefined, undefined);
|
||||||
databaseNode.connection = connection;
|
databaseNode.connection = connection;
|
||||||
databaseNode.children = [tablesNode];
|
databaseNode.children = [tablesNode];
|
||||||
serverTreeView.setup(x => x.getSelection()).returns(() => [tablesNode]);
|
serverTreeView.setup(x => x.getSelection()).returns(() => [tablesNode]);
|
||||||
@@ -653,7 +657,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
sqlOEProvider.setup(x => x.expandNode(TypeMoq.It.is(x => x.nodePath === nodePath))).callback(() => { }).returns(() => Promise.resolve(true));
|
sqlOEProvider.setup(x => x.expandNode(TypeMoq.It.is(x => x.nodePath === nodePath))).callback(() => { }).returns(() => Promise.resolve(true));
|
||||||
|
|
||||||
// If I queue a second expand request (the first compconstes normally because of the original mock) and then close the session
|
// If I queue a second expand request (the first compconstes normally because of the original mock) and then close the session
|
||||||
const rootNode = new TreeNode(NodeType.Root, '', false, objectExplorerSession.rootNode.nodePath, '', '', null, null, undefined, undefined);
|
const rootNode = new TreeNode(NodeType.Root, '', '', false, objectExplorerSession.rootNode.nodePath, '', '', null, null, undefined, undefined);
|
||||||
await objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, rootNode);
|
await objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, rootNode);
|
||||||
const expandPromise = objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, rootNode);
|
const expandPromise = objectExplorerService.expandNode(mssqlProviderName, objectExplorerSession, rootNode);
|
||||||
const closeSessionResult = await objectExplorerService.closeSession(mssqlProviderName, objectExplorerSession);
|
const closeSessionResult = await objectExplorerService.closeSession(mssqlProviderName, objectExplorerSession);
|
||||||
@@ -670,7 +674,7 @@ suite('SQL Object Explorer Service tests', () => {
|
|||||||
|
|
||||||
// If I call resolveTreeNodeChildren once, set an error on the node, and then call it again
|
// If I call resolveTreeNodeChildren once, set an error on the node, and then call it again
|
||||||
const tablesNodePath = 'testServerName/tables';
|
const tablesNodePath = 'testServerName/tables';
|
||||||
const tablesNode = new TreeNode(NodeType.Folder, 'Tables', false, tablesNodePath, '', '', null, null, undefined, undefined);
|
const tablesNode = new TreeNode(NodeType.Folder, '', 'Tables', false, tablesNodePath, '', '', null, null, undefined, undefined);
|
||||||
tablesNode.connection = connection;
|
tablesNode.connection = connection;
|
||||||
await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tablesNode);
|
await objectExplorerService.resolveTreeNodeChildren(objectExplorerSession, tablesNode);
|
||||||
sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(x => x.nodePath === tablesNodePath)), TypeMoq.Times.never());
|
sqlOEProvider.verify(x => x.refreshNode(TypeMoq.It.is(x => x.nodePath === tablesNodePath)), TypeMoq.Times.never());
|
||||||
|
|||||||
Reference in New Issue
Block a user