mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
Fix custom option support in CMS + update providername in provided profile (#21185)
This commit is contained in:
@@ -28,7 +28,7 @@ export class CmsConnectionController extends ConnectionController {
|
|||||||
) {
|
) {
|
||||||
super(connectionProperties, callback, providerName, _connectionManagementService, _instantiationService, _serverGroupController, _logService);
|
super(connectionProperties, callback, providerName, _connectionManagementService, _instantiationService, _serverGroupController, _logService);
|
||||||
let specialOptions = this._providerOptions.filter(
|
let specialOptions = this._providerOptions.filter(
|
||||||
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
|
(property) => (property.specialValueType !== null && property.specialValueType !== undefined || property.showOnConnectionDialog));
|
||||||
this._connectionWidget = this._instantiationService.createInstance(CmsConnectionWidget, specialOptions, {
|
this._connectionWidget = this._instantiationService.createInstance(CmsConnectionWidget, specialOptions, {
|
||||||
onSetConnectButton: (enable: boolean) => this._callback.onSetConnectButton(enable),
|
onSetConnectButton: (enable: boolean) => this._callback.onSetConnectButton(enable),
|
||||||
onCreateNewServerGroup: () => this.onCreateNewServerGroup(),
|
onCreateNewServerGroup: () => this.onCreateNewServerGroup(),
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ export class CmsConnectionWidget extends ConnectionWidget {
|
|||||||
// Login Options
|
// Login Options
|
||||||
this.addLoginOptions();
|
this.addLoginOptions();
|
||||||
|
|
||||||
|
// Add Custom connection options
|
||||||
|
this.addCustomConnectionOptions();
|
||||||
|
|
||||||
// Connection Name
|
// Connection Name
|
||||||
this.addConnectionNameOptions();
|
this.addConnectionNameOptions();
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,25 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
}
|
}
|
||||||
profile = result.connection;
|
profile = result.connection;
|
||||||
profile.serverName = trim(profile.serverName);
|
profile.serverName = trim(profile.serverName);
|
||||||
|
this.updatePortAndProvider(profile);
|
||||||
|
|
||||||
|
// Disable password prompt during reconnect if connected with an empty password
|
||||||
|
if (profile.password === '' && profile.savePassword === false) {
|
||||||
|
profile.savePassword = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.handleDefaultOnConnect(params, profile).catch(err => onUnexpectedError(err));
|
||||||
|
} else {
|
||||||
|
profile.serverName = trim(profile.serverName);
|
||||||
|
this.updatePortAndProvider(profile);
|
||||||
|
this._connectionManagementService.addSavedPassword(profile).then(async (connectionWithPassword) => {
|
||||||
|
await this.handleDefaultOnConnect(params, connectionWithPassword);
|
||||||
|
}).catch(err => onUnexpectedError(err));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private updatePortAndProvider(profile: IConnectionProfile): void {
|
||||||
// append the port to the server name for SQL Server connections
|
// append the port to the server name for SQL Server connections
|
||||||
if (this._currentProviderType === Constants.mssqlProviderName ||
|
if (this._currentProviderType === Constants.mssqlProviderName ||
|
||||||
this._currentProviderType === Constants.cmsProviderName) {
|
this._currentProviderType === Constants.cmsProviderName) {
|
||||||
@@ -193,20 +211,6 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
|||||||
profile.options[portPropertyName] = undefined;
|
profile.options[portPropertyName] = undefined;
|
||||||
profile.providerName = Constants.mssqlProviderName;
|
profile.providerName = Constants.mssqlProviderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable password prompt during reconnect if connected with an empty password
|
|
||||||
if (profile.password === '' && profile.savePassword === false) {
|
|
||||||
profile.savePassword = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.handleDefaultOnConnect(params, profile).catch(err => onUnexpectedError(err));
|
|
||||||
} else {
|
|
||||||
profile.serverName = trim(profile.serverName);
|
|
||||||
this._connectionManagementService.addSavedPassword(profile).then(async (connectionWithPassword) => {
|
|
||||||
await this.handleDefaultOnConnect(params, connectionWithPassword);
|
|
||||||
}).catch(err => onUnexpectedError(err));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleOnCancel(params: INewConnectionParams): void {
|
private handleOnCancel(params: INewConnectionParams): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user