mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
update deploy dialog to not show dropdown when there aren't any data sources (#10404)
This commit is contained in:
@@ -38,6 +38,7 @@ export const dataSourceRadioButtonLabel = localize('dataSourceRadioButtonLabel',
|
|||||||
export const connectionRadioButtonLabel = localize('connectionRadioButtonLabel', "Connections");
|
export const connectionRadioButtonLabel = localize('connectionRadioButtonLabel', "Connections");
|
||||||
export const selectConnectionRadioButtonsTitle = localize('selectconnectionRadioButtonsTitle', "Specify connection from:");
|
export const selectConnectionRadioButtonsTitle = localize('selectconnectionRadioButtonsTitle', "Specify connection from:");
|
||||||
export const dataSourceDropdownTitle = localize('dataSourceDropdownTitle', "Data source");
|
export const dataSourceDropdownTitle = localize('dataSourceDropdownTitle', "Data source");
|
||||||
|
export const noDataSourcesText = localize('noDataSourcesText', "No data sources in this project");
|
||||||
|
|
||||||
// Error messages
|
// Error messages
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export class DeployDatabaseDialog {
|
|||||||
ariaLabel: constants.databaseNameLabel
|
ariaLabel: constants.databaseNameLabel
|
||||||
}).component();
|
}).component();
|
||||||
|
|
||||||
this.dataSourcesFormComponent = this.createDataSourcesDropdown(view);
|
this.dataSourcesFormComponent = this.createDataSourcesFormComponent(view);
|
||||||
|
|
||||||
this.targetDatabaseTextBox.onTextChanged(() => {
|
this.targetDatabaseTextBox.onTextChanged(() => {
|
||||||
this.tryEnableGenerateScriptAndOkButtons();
|
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 {
|
private createDataSourcesDropdown(view: azdata.ModelView): azdata.FormComponent {
|
||||||
let dataSourcesValues: DataSourceDropdownValue[] = [];
|
let dataSourcesValues: DataSourceDropdownValue[] = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user