mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 09:35:37 -05:00
@@ -51,7 +51,8 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
onFetchDatabases: (serverName: string, authenticationType: string, userName?: string, password?: string) => this.onFetchDatabases(
|
||||
serverName, authenticationType, userName, password).then(result => {
|
||||
return result;
|
||||
})
|
||||
}),
|
||||
onAzureTenantSelection: (azureTenantId?: string) => this.onAzureTenantSelection(azureTenantId),
|
||||
}, providerName);
|
||||
this._providerName = providerName;
|
||||
}
|
||||
@@ -104,6 +105,20 @@ export class ConnectionController implements IConnectionComponentController {
|
||||
}
|
||||
}
|
||||
|
||||
protected onAzureTenantSelection(azureTenantId?: string): void {
|
||||
if (this._model.options.azureAccountToken !== undefined) {
|
||||
this._model.options.azureAccountToken = undefined;
|
||||
}
|
||||
|
||||
if (this._model.azureTenantId !== azureTenantId) {
|
||||
this._model.azureTenantId = azureTenantId;
|
||||
}
|
||||
|
||||
if (this._model.options.azureTenantId !== azureTenantId) {
|
||||
this._model.azureTenantId = azureTenantId;
|
||||
}
|
||||
}
|
||||
|
||||
protected handleOnAdvancedProperties(): void {
|
||||
if (!this._advancedController) {
|
||||
this._advancedController = this._instantiationService.createInstance(AdvancedPropertiesController, () => this._connectionWidget.focusOnAdvancedButton());
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface IConnectionComponentCallbacks {
|
||||
onAdvancedProperties?: () => void;
|
||||
onSetAzureTimeOut?: () => void;
|
||||
onFetchDatabases?: (serverName: string, authenticationType: string, userName?: string, password?: string) => Promise<string[]>;
|
||||
onAzureTenantSelection?: (azureTenantId?: string) => void;
|
||||
}
|
||||
|
||||
export interface IConnectionComponentController {
|
||||
|
||||
@@ -587,6 +587,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
let tenant = account.properties.tenants[tenantIndex];
|
||||
if (tenant) {
|
||||
this._azureTenantId = tenant.id;
|
||||
this._callbacks.onAzureTenantSelection(tenant.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user