Allow data explorer to use connect (#5564)

* wip

* handle save password; get correct profile

* ensure resolve is being called

* fix tests

* fix more tests
This commit is contained in:
Anthony Dresser
2019-05-23 11:44:18 -07:00
committed by GitHub
parent 5e8a52bcc0
commit aae1480e4f
15 changed files with 87 additions and 50 deletions

View File

@@ -12,6 +12,8 @@ import { generateUuid } from 'vs/base/common/uuid';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { isString } from 'vs/base/common/types';
import { deepClone } from 'vs/base/common/objects';
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
import * as Constants from 'sql/platform/connection/common/constants';
// Concrete implementation of the IConnectionProfile interface
@@ -41,6 +43,14 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
this.saveProfile = model.saveProfile;
this._id = model.id;
this.azureTenantId = model.azureTenantId;
if (this.capabilitiesService) {
const options = this.capabilitiesService.getCapabilities(model.providerName).connection.connectionOptions;
let appNameOption = options.find(option => option.specialValueType === ConnectionOptionSpecialType.appName);
if (appNameOption) {
let appNameKey = appNameOption.name;
this.options[appNameKey] = Constants.applicationName;
}
}
} else {
//Default for a new connection
this.savePassword = false;