handle validation error (#18766)

This commit is contained in:
Alan Ren
2022-03-17 19:43:02 -07:00
committed by GitHub
parent 3071a7b710
commit d6abcb892d
2 changed files with 15 additions and 0 deletions

View File

@@ -89,6 +89,9 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
this.updateState(this.valid, this.dirty, 'processEdit');
this._provider.processTableEdit(this.tableInfo, edit).then(
result => {
if (result.inputValidationError) {
this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.inputValidationError', "The input validation failed with error: {0}", result.inputValidationError));
}
this._viewModel = result.viewModel;
if (result.view) {
this.setDesignerView(result.view);
@@ -189,6 +192,10 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
this.updateState(this.valid, this.dirty);
return;
}
if (previewReportResult.schemaValidationError) {
this._errorMessageService.showDialog(Severity.Error, ErrorDialogTitle, localize('tableDesigner.TableSchemaValidationError', "Table schema validation failed with error: {0}", previewReportResult.schemaValidationError));
return;
}
const dialog = this._instantiationService.createInstance(TableDesignerPublishDialog);
const result = await dialog.open(previewReportResult.report, previewReportResult.mimeType);
if (result === TableDesignerPublishDialogResult.GenerateScript) {