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

@@ -104,6 +104,23 @@ export class ProviderConnectionInfo implements data.ConnectionInfo {
this.options[name] = value;
}
/**
* Returns the title of the connection
*/
public get title(): string {
let databaseName = this.databaseName ? this.databaseName : '<default>';
let userName = this.userName ? this.userName : 'Windows Authentication';
let label = this.serverName + ', ' + databaseName + ' (' + userName + ')';
return label;
}
/**
* Returns true if the capabilities and options are loaded correctly
*/
public get isConnectionOptionsValid(): boolean {
return this.serverCapabilities && this.title.indexOf('undefined') < 0;
}
public isPasswordRequired(): boolean {
let optionMetadata = this._serverCapabilities.connectionProvider.options.find(
option => option.specialValueType === ConnectionOptionSpecialType.password);