From 685a608518e66ab28a8cdaae4d8caadaab943812 Mon Sep 17 00:00:00 2001 From: Aditya Bist Date: Tue, 4 Jun 2019 17:11:36 -0700 Subject: [PATCH] Make sure the first Connection Dialog has correct provider. (#5884) * force a restart for cms * remove unneeded existing conditional * fix for random provider when opening a connection dialog --- .../connection/browser/connectionDialogService.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/sql/workbench/services/connection/browser/connectionDialogService.ts b/src/sql/workbench/services/connection/browser/connectionDialogService.ts index c2712a08de..475d734b71 100644 --- a/src/sql/workbench/services/connection/browser/connectionDialogService.ts +++ b/src/sql/workbench/services/connection/browser/connectionDialogService.ts @@ -143,9 +143,6 @@ export class ConnectionDialogService implements IConnectionDialogService { if (filteredKeys && filteredKeys.length > 0) { defaultProvider = filteredKeys[0]; } - else { - defaultProvider = keys[0]; - } } } if (!defaultProvider && this._configurationService) { @@ -304,18 +301,19 @@ export class ConnectionDialogService implements IConnectionDialogService { private handleShowUiComponent(input: OnShowUIResponse) { if (input.selectedProviderType) { // If the call is for specific providers - let isParamProvider: boolean = false; + let isProviderInParams: boolean = false; if (this._params && this._params.providers) { this._params.providers.forEach((provider) => { if (input.selectedProviderType === this._providerNameToDisplayNameMap[provider]) { - isParamProvider = true; + isProviderInParams = true; this._currentProviderType = provider; } }); } - if (!isParamProvider) { + if (!isProviderInParams) { this._currentProviderType = Object.keys(this._providerNameToDisplayNameMap).find((key) => - this._providerNameToDisplayNameMap[key] === input.selectedProviderType + this._providerNameToDisplayNameMap[key] === input.selectedProviderType && + key !== Constants.cmsProviderName ); } }