mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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 of current state.
|
||||||
*/
|
*/
|
||||||
issues?: { severity: DesignerIssueSeverity, description: string, propertyPath?: DesignerEditPath }[];
|
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
|
* Format (mimeType) of the report
|
||||||
*/
|
*/
|
||||||
mimeType: string;
|
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.updateState(this.valid, this.dirty, 'processEdit');
|
||||||
this._provider.processTableEdit(this.tableInfo, edit).then(
|
this._provider.processTableEdit(this.tableInfo, edit).then(
|
||||||
result => {
|
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;
|
this._viewModel = result.viewModel;
|
||||||
if (result.view) {
|
if (result.view) {
|
||||||
this.setDesignerView(result.view);
|
this.setDesignerView(result.view);
|
||||||
@@ -189,6 +192,10 @@ export class TableDesignerComponentInput implements DesignerComponentInput {
|
|||||||
this.updateState(this.valid, this.dirty);
|
this.updateState(this.valid, this.dirty);
|
||||||
return;
|
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 dialog = this._instantiationService.createInstance(TableDesignerPublishDialog);
|
||||||
const result = await dialog.open(previewReportResult.report, previewReportResult.mimeType);
|
const result = await dialog.open(previewReportResult.report, previewReportResult.mimeType);
|
||||||
if (result === TableDesignerPublishDialogResult.GenerateScript) {
|
if (result === TableDesignerPublishDialogResult.GenerateScript) {
|
||||||
|
|||||||
Reference in New Issue
Block a user