mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Databases order in schema compare dialog to be same as OE (#6162)
* Database order to be same as OE * changes to reset for source target buttons
This commit is contained in:
@@ -638,7 +638,7 @@ export class SchemaCompareDialog {
|
|||||||
|
|
||||||
let idx = -1;
|
let idx = -1;
|
||||||
let count = -1;
|
let count = -1;
|
||||||
let values = (await azdata.connection.listDatabases(connectionId)).map(db => {
|
let values = (await azdata.connection.listDatabases(connectionId)).sort((a, b) => a.localeCompare(b)).map(db => {
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
// put currently selected db at the top of the dropdown if there is one
|
// put currently selected db at the top of the dropdown if there is one
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ enum ResetButtonState {
|
|||||||
noSourceTarget,
|
noSourceTarget,
|
||||||
beforeCompareStart,
|
beforeCompareStart,
|
||||||
comparing,
|
comparing,
|
||||||
|
afterCompareComplete
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SchemaCompareResult {
|
export class SchemaCompareResult {
|
||||||
@@ -340,11 +341,7 @@ export class SchemaCompareResult {
|
|||||||
|
|
||||||
this.flexModel.removeItem(this.loader);
|
this.flexModel.removeItem(this.loader);
|
||||||
this.flexModel.removeItem(this.waitText);
|
this.flexModel.removeItem(this.waitText);
|
||||||
this.switchButton.enabled = true;
|
this.resetButtons(ResetButtonState.afterCompareComplete);
|
||||||
this.compareButton.enabled = true;
|
|
||||||
this.optionsButton.enabled = true;
|
|
||||||
this.openScmpButton.enabled = true;
|
|
||||||
this.cancelCompareButton.enabled = false;
|
|
||||||
|
|
||||||
if (this.comparisonResult.differences.length > 0) {
|
if (this.comparisonResult.differences.length > 0) {
|
||||||
this.flexModel.addItem(this.splitView, { CSSStyles: { 'overflow': 'hidden' } });
|
this.flexModel.addItem(this.splitView, { CSSStyles: { 'overflow': 'hidden' } });
|
||||||
@@ -714,15 +711,21 @@ export class SchemaCompareResult {
|
|||||||
this.switchButton.enabled = this.sourceEndpointInfo ? true : false; // allows switching if the source is set
|
this.switchButton.enabled = this.sourceEndpointInfo ? true : false; // allows switching if the source is set
|
||||||
this.openScmpButton.enabled = true;
|
this.openScmpButton.enabled = true;
|
||||||
this.cancelCompareButton.enabled = false;
|
this.cancelCompareButton.enabled = false;
|
||||||
|
this.selectSourceButton.enabled = true;
|
||||||
|
this.selectTargetButton.enabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (ResetButtonState.beforeCompareStart): {
|
// Before start and after complete are same functionally. Adding two enum values for clarity.
|
||||||
|
case (ResetButtonState.beforeCompareStart):
|
||||||
|
case (ResetButtonState.afterCompareComplete): {
|
||||||
this.compareButton.enabled = true;
|
this.compareButton.enabled = true;
|
||||||
this.optionsButton.enabled = true;
|
this.optionsButton.enabled = true;
|
||||||
this.switchButton.enabled = true;
|
this.switchButton.enabled = true;
|
||||||
this.openScmpButton.enabled = true;
|
this.openScmpButton.enabled = true;
|
||||||
this.saveScmpButton.enabled = true;
|
this.saveScmpButton.enabled = true;
|
||||||
this.cancelCompareButton.enabled = false;
|
this.cancelCompareButton.enabled = false;
|
||||||
|
this.selectSourceButton.enabled = true;
|
||||||
|
this.selectTargetButton.enabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (ResetButtonState.comparing): {
|
case (ResetButtonState.comparing): {
|
||||||
@@ -731,10 +734,13 @@ export class SchemaCompareResult {
|
|||||||
this.switchButton.enabled = false;
|
this.switchButton.enabled = false;
|
||||||
this.openScmpButton.enabled = false;
|
this.openScmpButton.enabled = false;
|
||||||
this.cancelCompareButton.enabled = true;
|
this.cancelCompareButton.enabled = true;
|
||||||
|
this.selectSourceButton.enabled = false;
|
||||||
|
this.selectTargetButton.enabled = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set generate script and apply to false because specific values depend on result and are set separately
|
||||||
this.generateScriptButton.enabled = false;
|
this.generateScriptButton.enabled = false;
|
||||||
this.applyButton.enabled = false;
|
this.applyButton.enabled = false;
|
||||||
this.generateScriptButton.title = generateScriptEnabledMessage;
|
this.generateScriptButton.title = generateScriptEnabledMessage;
|
||||||
|
|||||||
Reference in New Issue
Block a user