mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
Fix custom option support in CMS + update providername in provided profile (#21183)
This commit is contained in:
@@ -181,18 +181,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
}
|
||||
profile = result.connection;
|
||||
profile.serverName = trim(profile.serverName);
|
||||
|
||||
// append the port to the server name for SQL Server connections
|
||||
if (this._currentProviderType === Constants.mssqlProviderName ||
|
||||
this._currentProviderType === Constants.cmsProviderName) {
|
||||
let portPropertyName: string = 'port';
|
||||
let portOption: string = profile.options[portPropertyName];
|
||||
if (portOption && portOption.indexOf(',') === -1) {
|
||||
profile.serverName = profile.serverName + ',' + portOption;
|
||||
}
|
||||
profile.options[portPropertyName] = undefined;
|
||||
profile.providerName = Constants.mssqlProviderName;
|
||||
}
|
||||
this.updatePortAndProvider(profile);
|
||||
|
||||
// Disable password prompt during reconnect if connected with an empty password
|
||||
if (profile.password === '' && profile.savePassword === false) {
|
||||
@@ -202,6 +191,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
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));
|
||||
@@ -209,6 +199,20 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
}
|
||||
}
|
||||
|
||||
private updatePortAndProvider(profile: IConnectionProfile): void {
|
||||
// append the port to the server name for SQL Server connections
|
||||
if (this._currentProviderType === Constants.mssqlProviderName ||
|
||||
this._currentProviderType === Constants.cmsProviderName) {
|
||||
let portPropertyName: string = 'port';
|
||||
let portOption: string = profile.options[portPropertyName];
|
||||
if (portOption && portOption.indexOf(',') === -1) {
|
||||
profile.serverName = profile.serverName + ',' + portOption;
|
||||
}
|
||||
profile.options[portPropertyName] = undefined;
|
||||
profile.providerName = Constants.mssqlProviderName;
|
||||
}
|
||||
}
|
||||
|
||||
private handleOnCancel(params: INewConnectionParams): void {
|
||||
if (this.ignoreNextConnect) {
|
||||
this._connectionDialog.resetConnection();
|
||||
|
||||
Reference in New Issue
Block a user