Fixes the 'undefined' in connection tree when capabilities not loaded (#617)

* fixed the bug with loading the connection tree when capabilities not loaded
This commit is contained in:
Leila Lali
2018-02-06 13:13:48 -08:00
committed by GitHub
parent 3076390eb1
commit f5aa49ebb9
5 changed files with 38 additions and 19 deletions

View File

@@ -8,6 +8,7 @@ import 'vs/css!sql/media/objectTypes/objecttypes';
import 'vs/css!sql/media/icons/common-icons';
import * as dom from 'vs/base/browser/dom';
import { localize } from 'vs/nls';
import { ConnectionProfileGroup } from 'sql/parts/connection/common/connectionProfileGroup';
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -146,9 +147,10 @@ export class ServerTreeRenderer implements IRenderer {
}
}
let databaseName = connection.databaseName ? connection.databaseName : '<default>';
let userName = connection.userName ? connection.userName : "Windows Authentication";
let label = connection.serverName + ', ' + databaseName + ' (' + userName + ')';
let label = connection.title;
if (!connection.isConnectionOptionsValid) {
label = localize('loading', 'Loading...');
}
templateData.label.textContent = label;
templateData.root.title = label;