mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-03 01:25:38 -05:00
Schema Compare cleanup (#11418)
* cleanup async and await stuff * remove awaits * remove more awaits
This commit is contained in:
@@ -275,14 +275,14 @@ export class SchemaCompareDialog {
|
||||
let formModel = this.formBuilder.component();
|
||||
await view.initializeModel(formModel);
|
||||
if (this.sourceIsDacpac) {
|
||||
this.sourceDacpacRadioButton.focus();
|
||||
await this.sourceDacpacRadioButton.focus();
|
||||
} else {
|
||||
this.sourceDatabaseRadioButton.focus();
|
||||
await this.sourceDatabaseRadioButton.focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async createFileBrowser(view: azdata.ModelView, isTarget: boolean, endpoint: mssql.SchemaCompareEndpointInfo): Promise<azdata.FormComponent> {
|
||||
private createFileBrowser(view: azdata.ModelView, isTarget: boolean, endpoint: mssql.SchemaCompareEndpointInfo): azdata.FormComponent {
|
||||
let currentTextbox = isTarget ? this.targetTextBox : this.sourceTextBox;
|
||||
if (isTarget) {
|
||||
this.targetFileButton = view.modelBuilder.button().withProperties({
|
||||
@@ -333,7 +333,7 @@ export class SchemaCompareDialog {
|
||||
};
|
||||
}
|
||||
|
||||
private async createSourceRadiobuttons(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
private createSourceRadiobuttons(view: azdata.ModelView): azdata.FormComponent {
|
||||
this.sourceDacpacRadioButton = view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'source',
|
||||
@@ -389,7 +389,7 @@ export class SchemaCompareDialog {
|
||||
};
|
||||
}
|
||||
|
||||
private async createTargetRadiobuttons(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
private createTargetRadiobuttons(view: azdata.ModelView): azdata.FormComponent {
|
||||
let dacpacRadioButton = view.modelBuilder.radioButton()
|
||||
.withProperties({
|
||||
name: 'target',
|
||||
@@ -461,7 +461,7 @@ export class SchemaCompareDialog {
|
||||
return !isNullOrUndefined(filename) && await exists(filename) && (filename.toLocaleLowerCase().endsWith('.dacpac'));
|
||||
}
|
||||
|
||||
protected async createSourceServerDropdown(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
protected createSourceServerDropdown(view: azdata.ModelView): azdata.FormComponent {
|
||||
this.sourceServerDropdown = view.modelBuilder.dropDown().withProperties(
|
||||
{
|
||||
editable: true,
|
||||
@@ -471,7 +471,7 @@ export class SchemaCompareDialog {
|
||||
).component();
|
||||
this.sourceServerDropdown.onValueChanged(async (value) => {
|
||||
if (this.sourceServerDropdown.values.findIndex(x => this.matchesValue(x, value)) === -1) {
|
||||
this.sourceDatabaseDropdown.updateProperties({
|
||||
await this.sourceDatabaseDropdown.updateProperties({
|
||||
values: [],
|
||||
value: ' '
|
||||
});
|
||||
@@ -487,7 +487,7 @@ export class SchemaCompareDialog {
|
||||
};
|
||||
}
|
||||
|
||||
protected async createTargetServerDropdown(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
protected createTargetServerDropdown(view: azdata.ModelView): azdata.FormComponent {
|
||||
this.targetServerDropdown = view.modelBuilder.dropDown().withProperties(
|
||||
{
|
||||
editable: true,
|
||||
@@ -497,7 +497,7 @@ export class SchemaCompareDialog {
|
||||
).component();
|
||||
this.targetServerDropdown.onValueChanged(async (value) => {
|
||||
if (this.targetServerDropdown.values.findIndex(x => this.matchesValue(x, value)) === -1) {
|
||||
this.targetDatabaseDropdown.updateProperties({
|
||||
await this.targetDatabaseDropdown.updateProperties({
|
||||
values: [],
|
||||
value: ' '
|
||||
});
|
||||
@@ -518,7 +518,7 @@ export class SchemaCompareDialog {
|
||||
let values = await this.getServerValues(isTarget);
|
||||
|
||||
if (values && values.length > 0) {
|
||||
currentDropdown.updateProperties({
|
||||
await currentDropdown.updateProperties({
|
||||
values: values,
|
||||
value: values[0]
|
||||
});
|
||||
@@ -585,7 +585,7 @@ export class SchemaCompareDialog {
|
||||
return values;
|
||||
}
|
||||
|
||||
protected async createSourceDatabaseDropdown(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
protected createSourceDatabaseDropdown(view: azdata.ModelView): azdata.FormComponent {
|
||||
this.sourceDatabaseDropdown = view.modelBuilder.dropDown().withProperties(
|
||||
{
|
||||
editable: true,
|
||||
@@ -604,7 +604,7 @@ export class SchemaCompareDialog {
|
||||
};
|
||||
}
|
||||
|
||||
protected async createTargetDatabaseDropdown(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
protected createTargetDatabaseDropdown(view: azdata.ModelView): azdata.FormComponent {
|
||||
this.targetDatabaseDropdown = view.modelBuilder.dropDown().withProperties(
|
||||
{
|
||||
editable: true,
|
||||
@@ -629,7 +629,7 @@ export class SchemaCompareDialog {
|
||||
|
||||
protected async populateDatabaseDropdown(connectionProfile: azdata.connection.ConnectionProfile, isTarget: boolean): Promise<void> {
|
||||
let currentDropdown = isTarget ? this.targetDatabaseDropdown : this.sourceDatabaseDropdown;
|
||||
currentDropdown.updateProperties({ values: [], value: null });
|
||||
await currentDropdown.updateProperties({ values: [], value: null });
|
||||
|
||||
let values = [];
|
||||
try {
|
||||
@@ -640,7 +640,7 @@ export class SchemaCompareDialog {
|
||||
console.warn(e);
|
||||
}
|
||||
if (values && values.length > 0) {
|
||||
currentDropdown.updateProperties({
|
||||
await currentDropdown.updateProperties({
|
||||
values: values,
|
||||
value: values[0],
|
||||
});
|
||||
@@ -672,7 +672,7 @@ export class SchemaCompareDialog {
|
||||
return values;
|
||||
}
|
||||
|
||||
protected async createNoActiveConnectionsText(view: azdata.ModelView): Promise<azdata.FormComponent> {
|
||||
protected createNoActiveConnectionsText(view: azdata.ModelView): azdata.FormComponent {
|
||||
let noActiveConnectionsText = view.modelBuilder.text().withProperties({ value: loc.NoActiveConnectionsLabel }).component();
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user