update deploy dialog to not show dropdown when there aren't any data sources (#10404)

This commit is contained in:
Kim Santiago
2020-05-14 14:31:47 -07:00
committed by GitHub
parent e95650da89
commit abdd9af931
2 changed files with 14 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ export class DeployDatabaseDialog {
ariaLabel: constants.databaseNameLabel
}).component();
this.dataSourcesFormComponent = this.createDataSourcesDropdown(view);
this.dataSourcesFormComponent = this.createDataSourcesFormComponent(view);
this.targetDatabaseTextBox.onTextChanged(() => {
this.tryEnableGenerateScriptAndOkButtons();
@@ -178,6 +178,18 @@ export class DeployDatabaseDialog {
};
}
private createDataSourcesFormComponent(view: azdata.ModelView): azdata.FormComponent {
if (this.project.dataSources.length > 0) {
return this.createDataSourcesDropdown(view);
} else {
const noDataSourcesText = view.modelBuilder.text().withProperties({ value: constants.noDataSourcesText }).component();
return {
title: constants.dataSourceDropdownTitle,
component: noDataSourcesText
};
}
}
private createDataSourcesDropdown(view: azdata.ModelView): azdata.FormComponent {
let dataSourcesValues: DataSourceDropdownValue[] = [];