This commit is contained in:
@@ -168,43 +168,9 @@ CURRENTLY DOING: Cleanup with untranslated error string when attempting to dele
|
|||||||
Remove translation await code from gzform as it's not going to work that way and assume all errors come with pre-translated or do not require a fetch
|
Remove translation await code from gzform as it's not going to work that way and assume all errors come with pre-translated or do not require a fetch
|
||||||
all stock error number validation codes errors should nto need to fetch as be prefetched so no need for async for that particualr purpose
|
all stock error number validation codes errors should nto need to fetch as be prefetched so no need for async for that particualr purpose
|
||||||
|
|
||||||
At server add standard *biz function to Translate(key) to replace the long winded one in ValidateCanDelete that is available to *all* biz objects
|
|
||||||
Then go into every validate save and validate delete and look for lt keys and replace with this pre-translate call to Translate(key)
|
|
||||||
Finally the error display for a referential integrity error on delete is ugly, confusing and has too much shit going on
|
|
||||||
clean it up to a one liner that clearly mixes in the object name with the error however that has to happen.
|
|
||||||
just want to see a clean list of all the types of objects it's linked to
|
|
||||||
|
|
||||||
How it would look with ErrorDBForeignKeyViolation method:
|
|
||||||
---
|
|
||||||
Validation error
|
|
||||||
ErrorAPI2200
|
|
||||||
Invalid operation [2030] - "This object can not be deleted because it is linked to one or more related objects: Inventory transaction"
|
|
||||||
Invalid operation [2030] - "This object can not be deleted because it is linked to one or more related objects: Part"
|
|
||||||
Invalid operation [2030] - "This object can not be deleted because it is linked to one or more related objects: Unit"
|
|
||||||
Invalid operation [2030] - "This object can not be deleted because it is linked to one or more related objects: User"
|
|
||||||
---
|
|
||||||
|
|
||||||
Validation error
|
|
||||||
ErrorAPI2200
|
|
||||||
This object is linked to others and can not be changed this way [2208] - "Part"
|
|
||||||
This object is linked to others and can not be changed this way [2208] - "Unit"
|
|
||||||
This object is linked to others and can not be changed this way [2208] - "Inventory transaction"
|
|
||||||
This object is linked to others and can not be changed this way [2208] - "User"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PartByWarehouseInventory part stock taking view and list
|
|
||||||
todo: make the adjustments list item the partinventorytransactions list
|
|
||||||
todo: make the partinventory just be the partinventory reconcilliation stock taking thing
|
|
||||||
|
|
||||||
EDIT form for partinventory item openobjecthyandler should open up to event log history of entry, not entry form since it is not editable anyway
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
todo: LT:NoType
|
todo: LT:NoType
|
||||||
modify datagrid to handle LT: in text fields (needs to cache values it finds)
|
modify datagrid to handle LT: in text fields (needs to cache values it finds)
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ async function dealWithError(msg, vm) {
|
|||||||
lastMessageTimeStamp = new Date();
|
lastMessageTimeStamp = new Date();
|
||||||
|
|
||||||
//translate as necessary
|
//translate as necessary
|
||||||
msg = await window.$gz.translation.translateStringWithMultipleKeys(msg);
|
msg = await window.$gz.translation.translateStringWithMultipleKeysAsync(msg);
|
||||||
|
|
||||||
//In some cases the error may not be translatable, if this is not a debug run then it should show without the ?? that translating puts in keys not found
|
//In some cases the error may not be translatable, if this is not a debug run then it should show without the ?? that translating puts in keys not found
|
||||||
//so it's not as weird looking to the user
|
//so it's not as weird looking to the user
|
||||||
|
|||||||
@@ -654,16 +654,14 @@ export default {
|
|||||||
ve.error +
|
ve.error +
|
||||||
"]";
|
"]";
|
||||||
if (ve.message) {
|
if (ve.message) {
|
||||||
//NOTE: This is (**still not**) how to handle calling an async function from a sync function
|
//NOTE: call sync version here as can't call async code from here
|
||||||
//for reference sync async function async method from sync method
|
//so translations must already be pre-fetched to work here
|
||||||
//it just can't be done and this needs to go away and not be expected to do this
|
fldErr +=
|
||||||
let transMessage = ve.message;
|
' - "' +
|
||||||
window.$gz.translation
|
window.$gz.translation.translateStringWithMultipleKeys(
|
||||||
.translateStringWithMultipleKeys(ve.message)
|
ve.message
|
||||||
.then(result => {
|
) +
|
||||||
transMessage = result;
|
'"';
|
||||||
});
|
|
||||||
fldErr += ' - "' + transMessage + '"';
|
|
||||||
ret.push(fldErr);
|
ret.push(fldErr);
|
||||||
} else {
|
} else {
|
||||||
ret.push(fldErr);
|
ret.push(fldErr);
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ export default {
|
|||||||
//translation keys that start with LT:
|
//translation keys that start with LT:
|
||||||
//translate each and replace and return the string translated
|
//translate each and replace and return the string translated
|
||||||
// (fetch and cache any missing strings)
|
// (fetch and cache any missing strings)
|
||||||
async translateStringWithMultipleKeys(s) {
|
async translateStringWithMultipleKeysAsync(s) {
|
||||||
let ret = s;
|
let ret = s;
|
||||||
let found = s.match(/LT:[\w]*/gm);
|
let found = s.match(/LT:[\w]*/gm);
|
||||||
if (found == null) {
|
if (found == null) {
|
||||||
@@ -324,6 +324,26 @@ export default {
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
// Take in a string that contains one or more
|
||||||
|
//translation keys that start with LT:
|
||||||
|
//translate each and replace and return the string translated
|
||||||
|
// (DOES NOT fetch and cache any missing strings, they must exist)
|
||||||
|
//this is the sync version to be used in non async capable code
|
||||||
|
translateStringWithMultipleKeys(s) {
|
||||||
|
let ret = s;
|
||||||
|
let found = s.match(/LT:[\w]*/gm);
|
||||||
|
if (found == null) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
//replace
|
||||||
|
found.forEach(z => {
|
||||||
|
let translated = this.get(z.replace("LT:", ""));
|
||||||
|
//replace all
|
||||||
|
ret = ret.split(z).join(translated);
|
||||||
|
});
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
// dynamically set the vuetify language elements from
|
// dynamically set the vuetify language elements from
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export default {
|
|||||||
this.languageName,
|
this.languageName,
|
||||||
this.hour12
|
this.hour12
|
||||||
),
|
),
|
||||||
status: await window.$gz.translation.translateStringWithMultipleKeys(
|
status: await window.$gz.translation.translateStringWithMultipleKeysAsync(
|
||||||
o.statusText
|
o.statusText
|
||||||
),
|
),
|
||||||
jobId:
|
jobId:
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export default {
|
|||||||
res.data.forEach(function appendImportResultItem(value) {
|
res.data.forEach(function appendImportResultItem(value) {
|
||||||
outText += value + "\n";
|
outText += value + "\n";
|
||||||
});
|
});
|
||||||
vm.importResult = await window.$gz.translation.translateStringWithMultipleKeys(
|
vm.importResult = await window.$gz.translation.translateStringWithMultipleKeysAsync(
|
||||||
outText
|
outText
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ export default {
|
|||||||
);
|
);
|
||||||
temp[
|
temp[
|
||||||
i
|
i
|
||||||
].name = await window.$gz.translation.translateStringWithMultipleKeys(
|
].name = await window.$gz.translation.translateStringWithMultipleKeysAsync(
|
||||||
temp[i].name
|
temp[i].name
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default {
|
|||||||
this.languageName,
|
this.languageName,
|
||||||
this.hour12
|
this.hour12
|
||||||
),
|
),
|
||||||
status: await window.$gz.translation.translateStringWithMultipleKeys(
|
status: await window.$gz.translation.translateStringWithMultipleKeysAsync(
|
||||||
o.statusText
|
o.statusText
|
||||||
),
|
),
|
||||||
jobId:
|
jobId:
|
||||||
|
|||||||
Reference in New Issue
Block a user