mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Move New Login dialog's advanced options into the general section (#24538)
This commit is contained in:
@@ -18,7 +18,6 @@ export class LoginDialog extends PrincipalDialogBase<Login, LoginViewInfo> {
|
||||
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<Login, LoginViewInfo> {
|
||||
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<Login, LoginViewInfo> {
|
||||
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<Login, LoginViewInfo> {
|
||||
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<Login, LoginViewInfo> {
|
||||
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],
|
||||
|
||||
Reference in New Issue
Block a user