This commit is contained in:
@@ -228,19 +228,23 @@ todo: many biz objects are not using new PUT methodology
|
|||||||
CURRENTLY DOING: error and ordering stuff
|
CURRENTLY DOING: error and ordering stuff
|
||||||
|
|
||||||
OVERALL
|
OVERALL
|
||||||
ORDERING AND ERRORS
|
ORDERING AND ERRORS
|
||||||
- Must support doing it by ID instead, this is necessary and much better than hoping the order is consistent
|
- New idea: since each graph item is saved one by one, the client knows which one it's sending so the Client should hydrate the correct collection error index
|
||||||
|
server should act like its' a standalone object when reporting errors
|
||||||
|
this way, no need to modify existing code at all (po etc)
|
||||||
|
- NO WON'T WORK: Must support doing it by ID instead, this is necessary and much better than hoping the order is consistent
|
||||||
|
NO, this can't work because a collection of new items all have no id so which would be which??
|
||||||
i.e. the server sets the error index by the ID not the order, the client checks by ID as well, this way it matters not what the physical order is
|
i.e. the server sets the error index by the ID not the order, the client checks by ID as well, this way it matters not what the physical order is
|
||||||
This would be the definitive resolution since it would then work with re-ordering
|
This would be the definitive resolution since it would then work with re-ordering
|
||||||
would require any currently index style errors to be re-worked (unless I add a new protocol atop i.e. Items[id:23].ScheduledUsers[id:2] which would be interpreted differently by the error system)
|
would require any currently index style errors to be re-worked (unless I add a new protocol atop i.e. Items[id:23].ScheduledUsers[id:2] which would be interpreted differently by the error system)
|
||||||
The forms though might have a problem with it since they are working very well with indexes right now
|
The forms though might have a problem with it since they are working very well with indexes right now
|
||||||
perhaps the server returns error in form of id, but the client translates it back to an index for actual display?
|
perhaps the server returns error in form of id, but the client translates it back to an index for actual display?
|
||||||
ErrorIdToIndex(blah) method
|
ErrorIdToIndex(blah) method
|
||||||
- make it consistent with all collections / go back and retro the others (PO, CONTRACT ETC)
|
make it consistent with all collections / go back and retro the others (PO, CONTRACT ETC)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- test partial save (and delete) with fail at each level (make up a fail if have to at server)
|
- test partial save (### and delete ###) with fail at each level (make up a fail if have to at server)
|
||||||
- Error messages should display correctly both in alert box and in each item's controls
|
- Error messages should display correctly both in alert box and in each item's controls
|
||||||
- Test out role rights, login as various roles and ensure it works as expected
|
- Test out role rights, login as various roles and ensure it works as expected
|
||||||
- once past this step then second pass at new features **that affect models** (not necessarily UI stuff just fields required etc)
|
- once past this step then second pass at new features **that affect models** (not necessarily UI stuff just fields required etc)
|
||||||
|
|||||||
@@ -694,7 +694,7 @@ async function deleteItems(vm, err) {
|
|||||||
`${API_BASE_URL}items/${vm.deletedGraphItems.items[i]}`
|
`${API_BASE_URL}items/${vm.deletedGraphItems.items[i]}`
|
||||||
);
|
);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
err.items.push(res.error);
|
err.items.push({ e: res.error, i: i });
|
||||||
err.error = true;
|
err.error = true;
|
||||||
} else {
|
} else {
|
||||||
vm.deletedGraphItems.items.splice(i, 1);
|
vm.deletedGraphItems.items.splice(i, 1);
|
||||||
@@ -727,7 +727,7 @@ async function saveItems(vm, err) {
|
|||||||
const isPost = o.id == 0;
|
const isPost = o.id == 0;
|
||||||
let res = await window.$gz.api.upsert(`${API_BASE_URL}items`, o);
|
let res = await window.$gz.api.upsert(`${API_BASE_URL}items`, o);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
err.items.push(res.error);
|
err.items.push({ e: res.error, i: i });
|
||||||
err.error = true;
|
err.error = true;
|
||||||
if (isPost) {
|
if (isPost) {
|
||||||
//a post error precludes further operations on this item below
|
//a post error precludes further operations on this item below
|
||||||
@@ -779,7 +779,7 @@ async function deleteScheduledUsers(vm, err) {
|
|||||||
`${API_BASE_URL}items/scheduledusers/${vm.deletedGraphItems.scheduledUsers[i]}`
|
`${API_BASE_URL}items/scheduledusers/${vm.deletedGraphItems.scheduledUsers[i]}`
|
||||||
);
|
);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
err.scheduledUsers.push(res.error);
|
err.scheduledUsers.push({ e: res.error, i: i });
|
||||||
err.error = true;
|
err.error = true;
|
||||||
} else {
|
} else {
|
||||||
vm.deletedGraphItems.scheduledUsers.splice(i, 1);
|
vm.deletedGraphItems.scheduledUsers.splice(i, 1);
|
||||||
@@ -802,7 +802,7 @@ async function saveScheduledUsers(vm, woitemindex, err) {
|
|||||||
o
|
o
|
||||||
);
|
);
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
err.scheduledUsers.push(res.error);
|
err.scheduledUsers.push({ e: res.error, i: i });
|
||||||
err.error = true;
|
err.error = true;
|
||||||
} else {
|
} else {
|
||||||
//update any server changed fields
|
//update any server changed fields
|
||||||
|
|||||||
Reference in New Issue
Block a user