mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Reset schema comapre when comparison result is not success (#17184)
This commit is contained in:
@@ -291,6 +291,10 @@ export class SchemaCompareMainWindow {
|
|||||||
operationId: this.comparisonResult.operationId
|
operationId: this.comparisonResult.operationId
|
||||||
}).send();
|
}).send();
|
||||||
vscode.window.showErrorMessage(loc.compareErrorMessage(this.comparisonResult?.errorMessage));
|
vscode.window.showErrorMessage(loc.compareErrorMessage(this.comparisonResult?.errorMessage));
|
||||||
|
|
||||||
|
// reset state so a new comparison can be made
|
||||||
|
this.resetWindow();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaComparisonFinished')
|
TelemetryReporter.createActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaComparisonFinished')
|
||||||
@@ -647,7 +651,18 @@ export class SchemaCompareMainWindow {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async cancelCompare() {
|
/**
|
||||||
|
* Resets state of buttons and text to initial state before a comparison is started/completed
|
||||||
|
*/
|
||||||
|
public resetWindow(): void {
|
||||||
|
// clean the pane
|
||||||
|
this.flexModel.removeItem(this.loader);
|
||||||
|
this.flexModel.removeItem(this.waitText);
|
||||||
|
this.flexModel.addItem(this.startText, { CSSStyles: { 'margin': 'auto' } });
|
||||||
|
this.resetButtons(ResetButtonState.beforeCompareStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async cancelCompare(): Promise<void> {
|
||||||
|
|
||||||
TelemetryReporter.createActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareCancelStarted')
|
TelemetryReporter.createActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareCancelStarted')
|
||||||
.withAdditionalProperties({
|
.withAdditionalProperties({
|
||||||
@@ -655,11 +670,7 @@ export class SchemaCompareMainWindow {
|
|||||||
'operationId': this.operationId
|
'operationId': this.operationId
|
||||||
}).send();
|
}).send();
|
||||||
|
|
||||||
// clean the pane
|
this.resetWindow();
|
||||||
this.flexModel.removeItem(this.loader);
|
|
||||||
this.flexModel.removeItem(this.waitText);
|
|
||||||
this.flexModel.addItem(this.startText, { CSSStyles: { 'margin': 'auto' } });
|
|
||||||
this.resetButtons(ResetButtonState.beforeCompareStart);
|
|
||||||
|
|
||||||
// cancel compare
|
// cancel compare
|
||||||
if (this.operationId) {
|
if (this.operationId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user