mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -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!.removeFormItem(<azdata.FormComponent>this.systemDatabaseFormComponent);
|
||||||
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.projectFormComponent, 2);
|
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.projectFormComponent, 2);
|
||||||
|
|
||||||
|
this.locationDropdown!.values = constants.locationDropdownValues;
|
||||||
|
|
||||||
this.currentReferenceType = ReferenceType.project;
|
this.currentReferenceType = ReferenceType.project;
|
||||||
this.updateEnabledInputBoxes();
|
this.updateEnabledInputBoxes();
|
||||||
this.tryEnableAddReferenceButton();
|
this.tryEnableAddReferenceButton();
|
||||||
@@ -274,7 +276,6 @@ export class AddDatabaseReferenceDialog {
|
|||||||
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.dacpacFormComponent, 2);
|
this.formBuilder!.insertFormItem(<azdata.FormComponent>this.dacpacFormComponent, 2);
|
||||||
|
|
||||||
this.locationDropdown!.values = constants.locationDropdownValues;
|
this.locationDropdown!.values = constants.locationDropdownValues;
|
||||||
this.locationDropdown!.value = constants.differentDbSameServer;
|
|
||||||
|
|
||||||
this.currentReferenceType = ReferenceType.dacpac;
|
this.currentReferenceType = ReferenceType.dacpac;
|
||||||
this.updateEnabledInputBoxes();
|
this.updateEnabledInputBoxes();
|
||||||
@@ -304,7 +305,6 @@ export class AddDatabaseReferenceDialog {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private createSystemDatabaseDropdown(): azdata.FormComponent {
|
private createSystemDatabaseDropdown(): azdata.FormComponent {
|
||||||
this.systemDatabaseDropdown = this.view!.modelBuilder.dropDown().withProperties({
|
this.systemDatabaseDropdown = this.view!.modelBuilder.dropDown().withProperties({
|
||||||
values: [constants.master, constants.msdb],
|
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
|
* Update the enabled input boxes based on what the location of the database reference selected in the dropdown is
|
||||||
* @param isSystemDb
|
|
||||||
*/
|
*/
|
||||||
public updateEnabledInputBoxes(): void {
|
public updateEnabledInputBoxes(): void {
|
||||||
const isSystemDb = this.currentReferenceType === ReferenceType.systemDb;
|
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 {
|
private setDefaultDatabaseValues(): void {
|
||||||
|
if (this.databaseNameTextbox!.enabled) {
|
||||||
switch (this.currentReferenceType) {
|
switch (this.currentReferenceType) {
|
||||||
case ReferenceType.project: {
|
case ReferenceType.project: {
|
||||||
this.databaseNameTextbox!.value = <string>this.projectDropdown?.value;
|
this.databaseNameTextbox!.value = <string>this.projectDropdown?.value;
|
||||||
@@ -464,6 +467,7 @@ export class AddDatabaseReferenceDialog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private createVariableSection(): azdata.FormComponent {
|
private createVariableSection(): azdata.FormComponent {
|
||||||
// database name row
|
// database name row
|
||||||
|
|||||||
Reference in New Issue
Block a user