Fix #1916 Object explorer context object doesn't include database name (#1917)

This commit is contained in:
Kevin Cunnane
2018-07-12 17:21:57 -07:00
committed by GitHub
parent be45905830
commit 27ca9b13f8
2 changed files with 4 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ import { ServerTreeActionProvider } from 'sql/parts/objectExplorer/viewlet/serve
import { ObjectExplorerActionsContext } from 'sql/parts/objectExplorer/viewlet/objectExplorerActions';
import { TreeNode } from 'sql/parts/objectExplorer/common/treeNode';
import { OpenMode } from 'vs/base/parts/tree/browser/treeDefaults';
import { TreeUpdateUtils } from 'sql/parts/objectExplorer/viewlet/treeUpdateUtils';
/**
* Extends the tree controller to handle clicks on the tree elements
@@ -78,7 +79,10 @@ export class ServerTreeController extends treedefaults.DefaultController {
if (element instanceof TreeNode) {
let context = new ObjectExplorerActionsContext();
context.nodeInfo = element.toNodeInfo();
// Note: getting DB name before, but intentionally not using treeUpdateUtils.getConnectionProfile as it replaces
// the connection ID with a new one. This breaks a number of internal tasks
context.connectionProfile = element.getConnectionProfile().toIConnectionProfile();
context.connectionProfile.databaseName = element.getDatabaseName();
actionContext = context;
} else if (element instanceof ConnectionProfile) {
let context = new ObjectExplorerActionsContext();