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
This commit is contained in:
Aditya Bist
2019-06-04 17:11:36 -07:00
committed by GitHub
parent 5be2121a3e
commit 685a608518

View File

@@ -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
);
}
}