This commit is contained in:
chlafreniere
2020-04-03 00:14:28 -07:00
351 changed files with 7194 additions and 4889 deletions

View File

@@ -50,6 +50,7 @@ import { find } from 'vs/base/common/arrays';
import { values } from 'vs/base/common/collections';
import { assign } from 'vs/base/common/objects';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
@@ -90,7 +91,8 @@ export class ConnectionManagementService extends Disposable implements IConnecti
@IAccountManagementService private _accountManagementService: IAccountManagementService,
@ILogService private _logService: ILogService,
@IStorageService private _storageService: IStorageService,
@IEnvironmentService private _environmentService: IEnvironmentService
@IEnvironmentService private _environmentService: IEnvironmentService,
@IExtensionService private readonly extensionService: IExtensionService
) {
super();
@@ -819,6 +821,8 @@ export class ConnectionManagementService extends Disposable implements IConnecti
options: connection.options
});
await this.extensionService.activateByEvent(`onConnect:${connection.providerName}`);
return this._providers.get(connection.providerName).onReady.then((provider) => {
provider.connect(uri, connectionInfo);
this._onConnectRequestSent.fire();

View File

@@ -698,7 +698,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
if (this.authType === AuthenticationType.AzureMFA || this.authType === AuthenticationType.AzureMFAAndUser) {
this.fillInAzureAccountOptions().then(async () => {
let accountName = (this.authType === AuthenticationType.AzureMFA)
? connectionInfo.userName : connectionInfo.azureAccount;
? connectionInfo.azureAccount : connectionInfo.userName;
this._azureAccountDropdown.selectWithOptionName(this.getModelValue(accountName));
await this.onAzureAccountSelected();
let tenantId = connectionInfo.azureTenantId;

View File

@@ -35,6 +35,7 @@ import { NullLogService } from 'vs/platform/log/common/log';
import { assign } from 'vs/base/common/objects';
import { NullAdsTelemetryService } from 'sql/platform/telemetry/common/adsTelemetryService';
import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
suite('SQL ConnectionManagementService tests', () => {
@@ -164,7 +165,8 @@ suite('SQL ConnectionManagementService tests', () => {
accountManagementService.object,
new NullLogService(), // ILogService
undefined, // IStorageService
TestEnvironmentService
TestEnvironmentService,
getBasicExtensionService()
);
return connectionManagementService;
}
@@ -922,7 +924,7 @@ suite('SQL ConnectionManagementService tests', () => {
connectionStoreMock.setup(x => x.getConnectionProfileGroups(TypeMoq.It.isAny(), undefined)).returns(() => {
return [group1];
});
const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService());
// dupe connections have been seeded the numbers below already reflected the de-duped results
@@ -968,3 +970,9 @@ function createConnectionProfile(id: string): ConnectionProfile {
function createConnectionGroup(id: string): ConnectionProfileGroup {
return new ConnectionProfileGroup(id, undefined, id, undefined, undefined);
}
function getBasicExtensionService(): IExtensionService {
return <any>{
activateByEvent: () => Promise.resolve()
};
}