From a69f194d8bcbbe24ae99908259299b03bb1776f2 Mon Sep 17 00:00:00 2001 From: Aditya Bist Date: Fri, 3 May 2019 13:26:04 -0700 Subject: [PATCH] Fixed CMS connection auth (#5306) * fixed auth change to reflect in UI * added comments * fix bug where cms shows in dropdown * added parameter to parent call --- src/sql/platform/connection/common/constants.ts | 2 +- .../services/connection/browser/cmsConnectionWidget.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/sql/platform/connection/common/constants.ts b/src/sql/platform/connection/common/constants.ts index f91f4ce17c..331387dbf2 100644 --- a/src/sql/platform/connection/common/constants.ts +++ b/src/sql/platform/connection/common/constants.ts @@ -29,6 +29,6 @@ export const azureMFA = 'AzureMFA'; /* CMS constants */ export const cmsProviderName = 'MSSQL-CMS'; -export const cmsProviderDisplayName = localize('constants.cmsProviderDisplayName', 'Microsoft SQL Server (CMS)'); +export const cmsProviderDisplayName = localize('constants.cmsProviderDisplayName', 'Microsoft SQL Server - CMS'); export const UNSAVED_GROUP_ID = 'unsaved'; diff --git a/src/sql/workbench/services/connection/browser/cmsConnectionWidget.ts b/src/sql/workbench/services/connection/browser/cmsConnectionWidget.ts index 51a3cef215..c63d708a8b 100644 --- a/src/sql/workbench/services/connection/browser/cmsConnectionWidget.ts +++ b/src/sql/workbench/services/connection/browser/cmsConnectionWidget.ts @@ -92,16 +92,15 @@ export class CmsConnectionWidget extends ConnectionWidget { } protected addAuthenticationTypeOption(authTypeChanged: boolean = false): void { - super.addAuthenticationTypeOption(); + super.addAuthenticationTypeOption(authTypeChanged); let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType]; let newAuthTypes = authTypeOption.categoryValues; + // True when opening a CMS dialog to add a registered server if (authTypeChanged) { + // Need to filter out SQL Login because registered servers don't support it newAuthTypes = authTypeOption.categoryValues.filter((option) => option.name !== AuthenticationType.SqlLogin); - } - if (this._authTypeSelectBox) { + authTypeOption.defaultValue = AuthenticationType.Integrated; this._authTypeSelectBox.setOptions(newAuthTypes.map(c => c.displayName)); - } else { - this._authTypeSelectBox = new SelectBox(newAuthTypes.map(c => c.displayName), authTypeOption.defaultValue, this._contextViewService, undefined, { ariaLabel: authTypeOption.displayName }); } }