mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
handle validation error (#18766)
This commit is contained in:
8
src/sql/azdata.proposed.d.ts
vendored
8
src/sql/azdata.proposed.d.ts
vendored
@@ -1089,6 +1089,10 @@ declare module 'azdata' {
|
||||
* Issues of current state.
|
||||
*/
|
||||
issues?: { severity: DesignerIssueSeverity, description: string, propertyPath?: DesignerEditPath }[];
|
||||
/**
|
||||
* The input validation error.
|
||||
*/
|
||||
inputValidationError?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1118,6 +1122,10 @@ declare module 'azdata' {
|
||||
* Format (mimeType) of the report
|
||||
*/
|
||||
mimeType: string;
|
||||
/**
|
||||
* The table schema validation error.
|
||||
*/
|
||||
schemaValidationError?: string;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user