Benjin/project update bug (#18532)

* correct result.success

* shifting success message to actually check success

* keying on errorMessage rather than success
This commit is contained in:
Benjin Dubishar
2022-02-25 16:59:28 -08:00
committed by GitHub
parent 5e93f2ca9b
commit c64655ae71
2 changed files with 18 additions and 19 deletions

View File

@@ -898,8 +898,7 @@ export class SchemaCompareMainWindow {
throw new Error(`Unsupported SchemaCompareEndpointType: ${getSchemaCompareEndpointString(this.targetEndpointInfo.endpointType)}`);
}
if (!result || !result.success) {
if (!result || !result.success || result.errorMessage !== '') {
TelemetryReporter.createErrorEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareApplyFailed', undefined, getTelemetryErrorType(result?.errorMessage))
.withAdditionalProperties({
'operationId': this.comparisonResult.operationId,
@@ -912,6 +911,11 @@ export class SchemaCompareMainWindow {
this.generateScriptButton.title = loc.generateScriptEnabledMessage;
this.applyButton.enabled = true;
this.applyButton.title = loc.applyEnabledMessage;
} else if (this.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Project) {
const workspaceApi = getDataWorkspaceExtensionApi();
workspaceApi.showProjectsView();
void vscode.window.showInformationMessage(loc.applySuccess);
}
TelemetryReporter.createActionEvent(TelemetryViews.SchemaCompareMainWindow, 'SchemaCompareApplyEnded')
@@ -920,13 +924,6 @@ export class SchemaCompareMainWindow {
'operationId': this.comparisonResult.operationId,
'targetType': getSchemaCompareEndpointString(this.targetEndpointInfo.endpointType)
}).send();
if (this.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Project) {
const workspaceApi = getDataWorkspaceExtensionApi();
workspaceApi.showProjectsView();
void vscode.window.showInformationMessage(loc.applySuccess);
}
}
});
}