diff --git a/extensions/mssql/src/objectManagement/ui/loginDialog.ts b/extensions/mssql/src/objectManagement/ui/loginDialog.ts index 706c38fc40..65e6b3098f 100644 --- a/extensions/mssql/src/objectManagement/ui/loginDialog.ts +++ b/extensions/mssql/src/objectManagement/ui/loginDialog.ts @@ -18,7 +18,6 @@ export class LoginDialog extends PrincipalDialogBase { private generalSection: azdata.GroupContainer; private sqlAuthSection: azdata.GroupContainer; private serverRoleSection: azdata.GroupContainer; - private advancedSection: azdata.GroupContainer; private nameInput: azdata.InputBoxComponent; private authTypeDropdown: azdata.DropDownComponent; private passwordInput: azdata.InputBoxComponent; @@ -99,14 +98,11 @@ export class LoginDialog extends PrincipalDialogBase { sections.push(this.serverRoleSection); sections.push(this.securableSection); - if (this.viewInfo.supportAdvancedOptions) { - this.initializeAdvancedSection(); - sections.push(this.advancedSection); - } this.formContainer.addItems(sections, this.getSectionItemLayout()); } private initializeGeneralSection(): void { + const items: azdata.Component[] = []; this.nameInput = this.createInputBox(async (newValue) => { this.objectInfo.name = newValue; }, { @@ -115,8 +111,9 @@ export class LoginDialog extends PrincipalDialogBase { enabled: this.options.isNewObject, value: this.objectInfo.name }); - const nameContainer = this.createLabelInputContainer(objectManagementLoc.NameText, this.nameInput); + items.push(nameContainer); + this.authTypeDropdown = this.createDropdown(objectManagementLoc.AuthTypeText, async (newValue) => { this.objectInfo.authenticationType = objectManagementLoc.getAuthenticationTypeByDisplayName(newValue); @@ -125,13 +122,34 @@ export class LoginDialog extends PrincipalDialogBase { this.viewInfo.authenticationTypes.map(authType => objectManagementLoc.getAuthenticationTypeDisplayName(authType)), objectManagementLoc.getAuthenticationTypeDisplayName(this.objectInfo.authenticationType), this.options.isNewObject); - const authTypeContainer = this.createLabelInputContainer(objectManagementLoc.AuthTypeText, this.authTypeDropdown); + items.push(authTypeContainer); this.enabledCheckbox = this.createCheckbox(objectManagementLoc.EnabledText, async (checked) => { this.objectInfo.isEnabled = checked; }, this.objectInfo.isEnabled); - this.generalSection = this.createGroup(objectManagementLoc.GeneralSectionHeader, [nameContainer, authTypeContainer, this.enabledCheckbox], false); + items.push(this.enabledCheckbox); + + if (this.viewInfo.supportAdvancedOptions) { + this.defaultDatabaseDropdown = this.createDropdown(objectManagementLoc.DefaultDatabaseText, async (newValue) => { + this.objectInfo.defaultDatabase = newValue; + }, this.viewInfo.databases, this.objectInfo.defaultDatabase); + const defaultDatabaseContainer = this.createLabelInputContainer(objectManagementLoc.DefaultDatabaseText, this.defaultDatabaseDropdown); + items.push(defaultDatabaseContainer); + + this.defaultLanguageDropdown = this.createDropdown(objectManagementLoc.DefaultLanguageText, async (newValue) => { + this.objectInfo.defaultLanguage = newValue; + }, this.viewInfo.languages, this.objectInfo.defaultLanguage); + const defaultLanguageContainer = this.createLabelInputContainer(objectManagementLoc.DefaultLanguageText, this.defaultLanguageDropdown); + items.push(defaultLanguageContainer); + + this.connectPermissionCheckbox = this.createCheckbox(objectManagementLoc.PermissionToConnectText, async (checked) => { + this.objectInfo.connectPermission = checked; + }, this.objectInfo.connectPermission); + items.push(this.connectPermissionCheckbox); + } + + this.generalSection = this.createGroup(objectManagementLoc.GeneralSectionHeader, items, false); } private initializeSqlAuthSection(): void { @@ -207,28 +225,6 @@ export class LoginDialog extends PrincipalDialogBase { return this.objectInfo.password !== this.originalObjectInfo.password } - private initializeAdvancedSection(): void { - const items: azdata.Component[] = []; - if (this.viewInfo.supportAdvancedOptions) { - this.defaultDatabaseDropdown = this.createDropdown(objectManagementLoc.DefaultDatabaseText, async (newValue) => { - this.objectInfo.defaultDatabase = newValue; - }, this.viewInfo.databases, this.objectInfo.defaultDatabase); - const defaultDatabaseContainer = this.createLabelInputContainer(objectManagementLoc.DefaultDatabaseText, this.defaultDatabaseDropdown); - - this.defaultLanguageDropdown = this.createDropdown(objectManagementLoc.DefaultLanguageText, async (newValue) => { - this.objectInfo.defaultLanguage = newValue; - }, this.viewInfo.languages, this.objectInfo.defaultLanguage); - const defaultLanguageContainer = this.createLabelInputContainer(objectManagementLoc.DefaultLanguageText, this.defaultLanguageDropdown); - - this.connectPermissionCheckbox = this.createCheckbox(objectManagementLoc.PermissionToConnectText, async (checked) => { - this.objectInfo.connectPermission = checked; - }, this.objectInfo.connectPermission); - items.push(defaultDatabaseContainer, defaultLanguageContainer, this.connectPermissionCheckbox); - } - - this.advancedSection = this.createGroup(objectManagementLoc.AdvancedSectionHeader, items, true, true); - } - private initializeServerRolesSection(): void { this.serverRoleTable = this.createTableList(objectManagementLoc.ServerRoleSectionHeader, [objectManagementLoc.ServerRoleTypeDisplayNameInTitle],