mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fixing a couple database reference dialog bugs (#15523)
* fixing a couple database reference dialog bugs * update comment
This commit is contained in:
@@ -247,6 +247,8 @@ export class AddDatabaseReferenceDialog {
|
||||
this.formBuilder!.removeFormItem(<azdata.FormComponent>this.systemDatabaseFormComponent);
|
||||
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.projectFormComponent, 2);
|
||||
|
||||
this.locationDropdown!.values = constants.locationDropdownValues;
|
||||
|
||||
this.currentReferenceType = ReferenceType.project;
|
||||
this.updateEnabledInputBoxes();
|
||||
this.tryEnableAddReferenceButton();
|
||||
@@ -274,7 +276,6 @@ export class AddDatabaseReferenceDialog {
|
||||
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.dacpacFormComponent, 2);
|
||||
|
||||
this.locationDropdown!.values = constants.locationDropdownValues;
|
||||
this.locationDropdown!.value = constants.differentDbSameServer;
|
||||
|
||||
this.currentReferenceType = ReferenceType.dacpac;
|
||||
this.updateEnabledInputBoxes();
|
||||
@@ -304,7 +305,6 @@ export class AddDatabaseReferenceDialog {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private createSystemDatabaseDropdown(): azdata.FormComponent {
|
||||
this.systemDatabaseDropdown = this.view!.modelBuilder.dropDown().withProperties({
|
||||
values: [constants.master, constants.msdb],
|
||||
@@ -403,7 +403,6 @@ export class AddDatabaseReferenceDialog {
|
||||
|
||||
/**
|
||||
* Update the enabled input boxes based on what the location of the database reference selected in the dropdown is
|
||||
* @param isSystemDb
|
||||
*/
|
||||
public updateEnabledInputBoxes(): void {
|
||||
const isSystemDb = this.currentReferenceType === ReferenceType.systemDb;
|
||||
@@ -445,7 +444,11 @@ export class AddDatabaseReferenceDialog {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default values in the database name and variable text boxes if they are enabled
|
||||
*/
|
||||
private setDefaultDatabaseValues(): void {
|
||||
if (this.databaseNameTextbox!.enabled) {
|
||||
switch (this.currentReferenceType) {
|
||||
case ReferenceType.project: {
|
||||
this.databaseNameTextbox!.value = <string>this.projectDropdown?.value;
|
||||
@@ -464,6 +467,7 @@ export class AddDatabaseReferenceDialog {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private createVariableSection(): azdata.FormComponent {
|
||||
// database name row
|
||||
|
||||
Reference in New Issue
Block a user