This commit is contained in:
@@ -60,6 +60,11 @@ todo: cleanup unnecessary use of a ayatype access inside the Methods of objects
|
||||
todo: use const, not let unless need to reassign the variable
|
||||
Going to need a case by case through all uses but it's a very important precaution so code it that way now for all new code
|
||||
|
||||
todo: why the need for setErrorBoxErrors when setting the formstate errors already allows all the fields to pickup the errors for them
|
||||
shouldn't the errorbox itself pickup it's own errors and elminate the need for this??
|
||||
currently is: <gz-error :error-box-message="formState.errorBoxMessage"></gz-error>
|
||||
maybe could be this?: <gz-error :error-box-message="form().serverErrors(this, 'generalerror')"></gz-error>
|
||||
might even be a drop in replacement, should test, would reduce fuckery
|
||||
|
||||
todo: gzdecimal triggering dirty just by clicking into and out of a field witha value in it.
|
||||
also, it sometimes shows without the decimal then with the decimal for editing then without, it's crazy
|
||||
|
||||
@@ -721,6 +721,7 @@ export default {
|
||||
// childRowErrorClass
|
||||
// returns class to set on row if error exists for row
|
||||
// else returns nothing
|
||||
//( called by some forms but notably not the workorder or PO which have this built in)
|
||||
//
|
||||
childRowErrorClass(vm, collectionName, rowIndex) {
|
||||
if (this.childRowHasError(vm, collectionName, rowIndex)) {
|
||||
|
||||
@@ -498,7 +498,7 @@ export default {
|
||||
//# FAIL ROUTE
|
||||
|
||||
vm.formState.serverError = formErrorFromSaveResult();
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
window.$gz.form.setErrorBoxErrors(vm); //set generalerror errors in error box at top, not related to form field errors which happen alternatively based on formState.serverError which is confusing
|
||||
|
||||
//TODO: If it's a fatal error set accordingly and bail out here
|
||||
// if (err.fatal) {
|
||||
@@ -789,17 +789,10 @@ async function deleteScheduledUsers(vm, woItemIndex) {
|
||||
if (res.error) {
|
||||
handleSaveError({
|
||||
error: res.error,
|
||||
itemIndex: woItemIndex,
|
||||
itemUid: vm.obj.items[woItemIndex].uid,
|
||||
childKey: "scheduledUsers",
|
||||
childIndex: i
|
||||
childUid: d.uid
|
||||
});
|
||||
|
||||
err.scheduledUsers.push({
|
||||
e: res.error,
|
||||
objectIndex: d.objectIndex,
|
||||
woItemIndex: d.woItemIndex
|
||||
});
|
||||
err.error = true;
|
||||
} else {
|
||||
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1);
|
||||
}
|
||||
@@ -825,12 +818,12 @@ async function saveScheduledUsers(vm, woItemIndex, err) {
|
||||
o
|
||||
);
|
||||
if (res.error) {
|
||||
err.scheduledUsers.push({
|
||||
e: res.error,
|
||||
objectIndex: i,
|
||||
woItemIndex: woItemIndex
|
||||
handleSaveError({
|
||||
error: res.error,
|
||||
itemUid: vm.obj.items[woItemIndex].uid,
|
||||
childKey: "scheduledUsers",
|
||||
childUid: o.uid
|
||||
});
|
||||
err.error = true;
|
||||
} else {
|
||||
//update any server changed fields
|
||||
//always updated:
|
||||
@@ -859,7 +852,7 @@ function handleSaveError(e) {
|
||||
error: res.error,
|
||||
itemUid: item.uid, //uid of item
|
||||
childKey: "scheduledUsers",
|
||||
childId: i //uid of child item will be located later as index
|
||||
childUid: i //uid of child item will be located later as index
|
||||
}
|
||||
*
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user