diff --git a/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts b/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts index f65786de51..7a0c4e4ce4 100644 --- a/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/addDatabaseReferenceDialog.ts @@ -39,6 +39,8 @@ export class AddDatabaseReferenceDialog { public serverVariableTextbox: azdata.InputBoxComponent | undefined; public suppressMissingDependenciesErrorsCheckbox: azdata.CheckBoxComponent | undefined; public exampleUsage: azdata.TextComponent | undefined; + private projectRadioButton: azdata.RadioButtonComponent | undefined; + private systemDatabaseRadioButton: azdata.RadioButtonComponent | undefined; public currentReferenceType: ReferenceType | undefined; @@ -114,6 +116,12 @@ export class AddDatabaseReferenceDialog { await view.initializeModel(formModel); this.updateEnabledInputBoxes(); + if (this.currentReferenceType === ReferenceType.project) { + this.projectRadioButton?.focus(); + } else { + this.systemDatabaseRadioButton?.focus(); + } + this.initDialogComplete?.resolve(); }); } @@ -155,23 +163,23 @@ export class AddDatabaseReferenceDialog { } private createRadioButtons(): azdata.FormComponent { - const projectRadioButton = this.view!.modelBuilder.radioButton() + this.projectRadioButton = this.view!.modelBuilder.radioButton() .withProperties({ name: 'referenceType', label: constants.projectRadioButtonTitle }).component(); - projectRadioButton.onDidClick(() => { + this.projectRadioButton.onDidClick(() => { this.projectRadioButtonClick(); }); - const systemDatabaseRadioButton = this.view!.modelBuilder.radioButton() + this.systemDatabaseRadioButton = this.view!.modelBuilder.radioButton() .withProperties({ name: 'referenceType', label: constants.systemDatabaseRadioButtonTitle }).component(); - systemDatabaseRadioButton.onDidClick(() => { + this.systemDatabaseRadioButton.onDidClick(() => { this.systemDbRadioButtonClick(); }); @@ -186,19 +194,19 @@ export class AddDatabaseReferenceDialog { }); if (this.projectDropdown?.values?.length) { - projectRadioButton.checked = true; + this.projectRadioButton.checked = true; this.currentReferenceType = ReferenceType.project; } else { - systemDatabaseRadioButton.checked = true; + this.systemDatabaseRadioButton.checked = true; this.currentReferenceType = ReferenceType.systemDb; // disable projects radio button if there aren't any projects that can be added as a reference - projectRadioButton.enabled = false; + this.projectRadioButton.enabled = false; } let flexRadioButtonsModel: azdata.FlexContainer = this.view!.modelBuilder.flexContainer() .withLayout({ flexFlow: 'column' }) - .withItems([projectRadioButton, systemDatabaseRadioButton, dacpacRadioButton]) + .withItems([this.projectRadioButton, this.systemDatabaseRadioButton, dacpacRadioButton]) .withProperties({ ariaRole: 'radiogroup' }) .component(); diff --git a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts index 61407f1436..5aa158d260 100644 --- a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts @@ -117,6 +117,7 @@ export class CreateProjectFromDatabaseDialog { let formModel = this.formBuilder.component(); await view.initializeModel(formModel); + this.selectConnectionButton?.focus(); this.initDialogComplete?.resolve(); }); } diff --git a/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts index ab7d22e728..e3f2d852e3 100644 --- a/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/publishDatabaseDialog.ts @@ -142,6 +142,8 @@ export class PublishDatabaseDialog { let formModel = this.formBuilder.component(); await view.initializeModel(formModel); + + this.loadProfileTextBox!.focus(); }); }