Add AuthenticationType enum to typings (#20699)

* Add AuthenticationType enum to typings

* fix

* const

* Add comments

* fix comment

* remove unused
This commit is contained in:
Charles Gagnon
2022-09-30 16:49:36 -07:00
committed by GitHub
parent d6d75d8817
commit 85dc506a3c
49 changed files with 236 additions and 164 deletions

View File

@@ -23,7 +23,7 @@ import * as DOM from 'vs/base/browser/dom';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { OS, OperatingSystem } from 'vs/base/common/platform';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
import { ConnectionWidget, AuthenticationType } from 'sql/workbench/services/connection/browser/connectionWidget';
import { ConnectionWidget } from 'sql/workbench/services/connection/browser/connectionWidget';
import { ILogService } from 'vs/platform/log/common/log';
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
@@ -33,8 +33,8 @@ import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMess
export class CmsConnectionWidget extends ConnectionWidget {
private _serverDescriptionInputBox: InputBox;
protected _authTypeMap: { [providerName: string]: AuthenticationType[] } = {
[Constants.cmsProviderName]: [AuthenticationType.SqlLogin, AuthenticationType.Integrated]
protected _authTypeMap: { [providerName: string]: Constants.AuthenticationType[] } = {
[Constants.cmsProviderName]: [Constants.AuthenticationType.SqlLogin, Constants.AuthenticationType.Integrated]
};
constructor(options: azdata.ConnectionOption[],
@@ -92,17 +92,17 @@ export class CmsConnectionWidget extends ConnectionWidget {
// True when opening a CMS dialog to add a registered server
if (authTypeChanged) {
// Registered Servers only support Integrated Auth
newAuthTypes = authTypeOption.categoryValues.filter((option) => option.name === AuthenticationType.Integrated);
newAuthTypes = authTypeOption.categoryValues.filter((option) => option.name === Constants.AuthenticationType.Integrated);
this._authTypeSelectBox.setOptions(newAuthTypes.map(c => c.displayName));
authTypeOption.defaultValue = AuthenticationType.Integrated;
authTypeOption.defaultValue = Constants.AuthenticationType.Integrated;
} else {
// CMS supports all auth types
newAuthTypes = authTypeOption.categoryValues;
this._authTypeSelectBox.setOptions(newAuthTypes.map(c => c.displayName));
if (OS === OperatingSystem.Windows) {
authTypeOption.defaultValue = this.getAuthTypeDisplayName(AuthenticationType.Integrated);
authTypeOption.defaultValue = this.getAuthTypeDisplayName(Constants.AuthenticationType.Integrated);
} else {
authTypeOption.defaultValue = this.getAuthTypeDisplayName(AuthenticationType.SqlLogin);
authTypeOption.defaultValue = this.getAuthTypeDisplayName(Constants.AuthenticationType.SqlLogin);
}
}
this._authTypeSelectBox.selectWithOptionName(authTypeOption.defaultValue);