This commit is contained in:
@@ -76,48 +76,48 @@ function getControlLabel(ctrl) {
|
||||
return ctrl.label;
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// DEBUG / DEVELOPMENT LOGGING
|
||||
//
|
||||
function logControl(caller, ctrl, ref) {
|
||||
if (ref != "xcount") {
|
||||
return;
|
||||
}
|
||||
// ////////////////////////////////////
|
||||
// // DEBUG / DEVELOPMENT LOGGING
|
||||
// //
|
||||
// function logControl(caller, ctrl, ref) {
|
||||
// if (ref != "xcount") {
|
||||
// return;
|
||||
// }
|
||||
|
||||
var hasChanged = false;
|
||||
if (ctrl.internalChange) {
|
||||
hasChanged = true;
|
||||
} else {
|
||||
if (ctrl.initialValue && ctrl.lazyValue) {
|
||||
if (ctrl.initialValue != ctrl.lazyValue) {
|
||||
hasChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// var hasChanged = false;
|
||||
// if (ctrl.internalChange) {
|
||||
// hasChanged = true;
|
||||
// } else {
|
||||
// if (ctrl.initialValue && ctrl.lazyValue) {
|
||||
// if (ctrl.initialValue != ctrl.lazyValue) {
|
||||
// hasChange = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
var v =
|
||||
"CTRL=" +
|
||||
ref +
|
||||
", CALLER [" +
|
||||
caller +
|
||||
"], " +
|
||||
", internalChange=" +
|
||||
ctrl.internalChange +
|
||||
", lazyValue=" +
|
||||
ctrl.lazyValue +
|
||||
", initialValue=" +
|
||||
ctrl.initialValue +
|
||||
", loading=" +
|
||||
ctrl.loading +
|
||||
", isDirty=" +
|
||||
ctrl.isDirty +
|
||||
", isResetting=" +
|
||||
ctrl.isResetting +
|
||||
", HAS CHANGED =" +
|
||||
hasChanged;
|
||||
// var v =
|
||||
// "CTRL=" +
|
||||
// ref +
|
||||
// ", CALLER [" +
|
||||
// caller +
|
||||
// "], " +
|
||||
// ", internalChange=" +
|
||||
// ctrl.internalChange +
|
||||
// ", lazyValue=" +
|
||||
// ctrl.lazyValue +
|
||||
// ", initialValue=" +
|
||||
// ctrl.initialValue +
|
||||
// ", loading=" +
|
||||
// ctrl.loading +
|
||||
// ", isDirty=" +
|
||||
// ctrl.isDirty +
|
||||
// ", isResetting=" +
|
||||
// ctrl.isResetting +
|
||||
// ", HAS CHANGED =" +
|
||||
// hasChanged;
|
||||
|
||||
console.log(v);
|
||||
}
|
||||
// console.log(v);
|
||||
// }
|
||||
|
||||
export default {
|
||||
///////////////////////////////
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
logControl("Required", ctrl, ref);
|
||||
//logControl("Required", ctrl, ref);
|
||||
|
||||
var value = getControlValue(ctrl);
|
||||
if (!isEmpty(value)) {
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
logControl("MaxLength", ctrl, ref);
|
||||
// logControl("MaxLength", ctrl, ref);
|
||||
|
||||
var value = getControlValue(ctrl);
|
||||
if (isEmpty(value)) {
|
||||
@@ -194,8 +194,8 @@ export default {
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
logControl("After", ctrlStart, refStart);
|
||||
logControl("After", ctrlEnd, refEnd);
|
||||
// logControl("After", ctrlStart, refStart);
|
||||
// logControl("After", ctrlEnd, refEnd);
|
||||
|
||||
var valueStart = getControlValue(ctrlStart);
|
||||
if (isEmpty(valueStart)) {
|
||||
@@ -233,7 +233,7 @@ export default {
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
logControl("Integer", ctrl, ref);
|
||||
//logControl("Integer", ctrl, ref);
|
||||
|
||||
var value = getControlValue(ctrl);
|
||||
if (isEmpty(value)) {
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
}
|
||||
|
||||
//DEBUG
|
||||
logControl("Decimal", ctrl, ref);
|
||||
//logControl("Decimal", ctrl, ref);
|
||||
|
||||
var value = getControlValue(ctrl);
|
||||
if (isEmpty(value)) {
|
||||
@@ -333,14 +333,18 @@ export default {
|
||||
return !o.target;
|
||||
});
|
||||
} else {
|
||||
errorsForField = v.$_.filter(v.serverError.details, {
|
||||
target: ref
|
||||
errorsForField = v.$_.filter(v.serverError.details, function(o) {
|
||||
if (!o.target) {
|
||||
return false;
|
||||
}
|
||||
//server error fields are capitalized
|
||||
return o.target.toLowerCase() == ref;
|
||||
});
|
||||
}
|
||||
|
||||
if (errorsForField.length > 0) {
|
||||
//DEBUG
|
||||
logControl("ServerErrors", getControl(v, ref), ref);
|
||||
//logControl("ServerErrors", getControl(v, ref), ref);
|
||||
|
||||
//iterate the errorsForField object and add each to return array of errors
|
||||
v.$_.each(errorsForField, function(ve) {
|
||||
|
||||
Reference in New Issue
Block a user