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