This commit is contained in:
@@ -490,6 +490,8 @@ export default {
|
|||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
// SERVER ERRORS
|
// SERVER ERRORS
|
||||||
// Process and return server errors if any for form and field specified
|
// Process and return server errors if any for form and field specified
|
||||||
|
// note that this is called in turn by every control on the form so it's only job
|
||||||
|
// is to return errors if they exist for *that* field
|
||||||
//
|
//
|
||||||
serverErrors(vm, ref) {
|
serverErrors(vm, ref) {
|
||||||
//CHECK PREREQUISITES IN DEV MODE TO ENSURE FORM ISN"T MISSING NEEDED DATA ATTRIBUTES ETC
|
//CHECK PREREQUISITES IN DEV MODE TO ENSURE FORM ISN"T MISSING NEEDED DATA ATTRIBUTES ETC
|
||||||
@@ -545,8 +547,9 @@ export default {
|
|||||||
|
|
||||||
//GENERAL ERROR
|
//GENERAL ERROR
|
||||||
if (ref == "errorbox") {
|
if (ref == "errorbox") {
|
||||||
//Add any general errors to ret
|
//Add any general errors to ret (specific detail errors for the errorbox will be processed later below)
|
||||||
let err = vm.$ay.t("ErrorAPI" + apiErrorCode.toString());
|
let err = vm.$ay.t("ErrorAPI" + apiErrorCode.toString());
|
||||||
|
|
||||||
if (vm.formState.serverError.message) {
|
if (vm.formState.serverError.message) {
|
||||||
err = err + "\r\n" + vm.formState.serverError.message;
|
err = err + "\r\n" + vm.formState.serverError.message;
|
||||||
}
|
}
|
||||||
@@ -558,13 +561,13 @@ export default {
|
|||||||
});
|
});
|
||||||
ret.push(err);
|
ret.push(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
//DETAIL ERRORS
|
//DETAIL ERRORS
|
||||||
//{"error":{"code":"2200","details":[{"message":"Exception: Error converting value \"\" to type 'AyaNova.Biz.AUTHORIZATION_ROLES'. Path 'roles', line 1, position 141.","target":"roles","error":"2203"}],"message":"Object did not pass validation"}}
|
//{"error":{"code":"2200","details":[{"message":"Exception: Error converting value \"\" to type 'AyaNova.Biz.AUTHORIZATION_ROLES'. Path 'roles', line 1, position 141.","target":"roles","error":"2203"}],"message":"Object did not pass validation"}}
|
||||||
//Specific field validation errors are in an array in "details" key
|
//Specific field validation errors are in an array in "details" key
|
||||||
if (!window.$gz._.isEmpty(vm.formState.serverError.details)) {
|
if (!window.$gz._.isEmpty(vm.formState.serverError.details)) {
|
||||||
//See if this key is in the details array
|
//See if this key is in the details array
|
||||||
let errorsForField = getErrorsForField(vm, ref);
|
let errorsForField = getErrorsForField(vm, ref);
|
||||||
|
|
||||||
if (errorsForField.length > 0) {
|
if (errorsForField.length > 0) {
|
||||||
//iterate the errorsForField object and add each to return array of errors
|
//iterate the errorsForField object and add each to return array of errors
|
||||||
window.$gz._.each(errorsForField, function(ve) {
|
window.$gz._.each(errorsForField, function(ve) {
|
||||||
@@ -576,6 +579,9 @@ export default {
|
|||||||
ve.error +
|
ve.error +
|
||||||
"]";
|
"]";
|
||||||
if (ve.message) {
|
if (ve.message) {
|
||||||
|
if (ve.message.includes("LT:")) {
|
||||||
|
ve.message = vm.$ay.t(ve.message.split(":")[1]);
|
||||||
|
}
|
||||||
fldErr += ' - "' + ve.message + '"';
|
fldErr += ' - "' + ve.message + '"';
|
||||||
}
|
}
|
||||||
ret.push(fldErr);
|
ret.push(fldErr);
|
||||||
|
|||||||
@@ -145,6 +145,8 @@ export default {
|
|||||||
"ErrorUserNotAuthorized",
|
"ErrorUserNotAuthorized",
|
||||||
"ErrorNoMatch",
|
"ErrorNoMatch",
|
||||||
"ErrorPickListQueryInvalid",
|
"ErrorPickListQueryInvalid",
|
||||||
|
"ErrorSecurityUserCapacity",
|
||||||
|
"ErrorDBForeignKeyViolation",
|
||||||
"DeletePrompt",
|
"DeletePrompt",
|
||||||
"AreYouSureUnsavedChanges",
|
"AreYouSureUnsavedChanges",
|
||||||
"Leave",
|
"Leave",
|
||||||
|
|||||||
Reference in New Issue
Block a user