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
|
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
|
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.
|
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
|
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
|
// childRowErrorClass
|
||||||
// returns class to set on row if error exists for row
|
// returns class to set on row if error exists for row
|
||||||
// else returns nothing
|
// else returns nothing
|
||||||
|
//( called by some forms but notably not the workorder or PO which have this built in)
|
||||||
//
|
//
|
||||||
childRowErrorClass(vm, collectionName, rowIndex) {
|
childRowErrorClass(vm, collectionName, rowIndex) {
|
||||||
if (this.childRowHasError(vm, collectionName, rowIndex)) {
|
if (this.childRowHasError(vm, collectionName, rowIndex)) {
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ export default {
|
|||||||
//# FAIL ROUTE
|
//# FAIL ROUTE
|
||||||
|
|
||||||
vm.formState.serverError = formErrorFromSaveResult();
|
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
|
//TODO: If it's a fatal error set accordingly and bail out here
|
||||||
// if (err.fatal) {
|
// if (err.fatal) {
|
||||||
@@ -789,17 +789,10 @@ async function deleteScheduledUsers(vm, woItemIndex) {
|
|||||||
if (res.error) {
|
if (res.error) {
|
||||||
handleSaveError({
|
handleSaveError({
|
||||||
error: res.error,
|
error: res.error,
|
||||||
itemIndex: woItemIndex,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
childKey: "scheduledUsers",
|
childKey: "scheduledUsers",
|
||||||
childIndex: i
|
childUid: d.uid
|
||||||
});
|
});
|
||||||
|
|
||||||
err.scheduledUsers.push({
|
|
||||||
e: res.error,
|
|
||||||
objectIndex: d.objectIndex,
|
|
||||||
woItemIndex: d.woItemIndex
|
|
||||||
});
|
|
||||||
err.error = true;
|
|
||||||
} else {
|
} else {
|
||||||
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1);
|
vm.obj.items[woItemIndex].scheduledUsers.splice(i, 1);
|
||||||
}
|
}
|
||||||
@@ -825,12 +818,12 @@ async function saveScheduledUsers(vm, woItemIndex, err) {
|
|||||||
o
|
o
|
||||||
);
|
);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
err.scheduledUsers.push({
|
handleSaveError({
|
||||||
e: res.error,
|
error: res.error,
|
||||||
objectIndex: i,
|
itemUid: vm.obj.items[woItemIndex].uid,
|
||||||
woItemIndex: woItemIndex
|
childKey: "scheduledUsers",
|
||||||
|
childUid: o.uid
|
||||||
});
|
});
|
||||||
err.error = true;
|
|
||||||
} else {
|
} else {
|
||||||
//update any server changed fields
|
//update any server changed fields
|
||||||
//always updated:
|
//always updated:
|
||||||
@@ -859,7 +852,7 @@ function handleSaveError(e) {
|
|||||||
error: res.error,
|
error: res.error,
|
||||||
itemUid: item.uid, //uid of item
|
itemUid: item.uid, //uid of item
|
||||||
childKey: "scheduledUsers",
|
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