This commit is contained in:
2020-04-01 19:08:07 +00:00
parent 810e060fed
commit fdd1fd3aaa
3 changed files with 22 additions and 14 deletions

View File

@@ -105,13 +105,23 @@ export default {
///////////////////////////////////// /////////////////////////////////////
// Display LT message with wait for ok // Display LT message with wait for ok
// //
// displayLTErrorMessage(tKeyText, tKeyTitle = undefined) {
// return VM_LOCAL.$root.$gzconfirm({
// message: tKeyText ? window.$gz.translation.get(tKeyText) : "",
// title: tKeyTitle ? window.$gz.translation.get(tKeyTitle) : "",
// yesButtonText: window.$gz.translation.get("OK"),
// type: "error"
// });
// },
displayLTErrorMessage(tKeyText, tKeyTitle = undefined) { displayLTErrorMessage(tKeyText, tKeyTitle = undefined) {
return VM_LOCAL.$root.$gzconfirm({ return VM_LOCAL.$root.$gzconfirm({
message: tKeyText ? window.$gz.translation.get(tKeyText) : "", message: tKeyText ? window.$gz.translation.get(tKeyText) : "",
title: tKeyTitle ? window.$gz.translation.get(tKeyTitle) : "", title: tKeyTitle ? window.$gz.translation.get(tKeyTitle) : "",
yesButtonText: window.$gz.translation.get("OK") yesButtonText: window.$gz.translation.get("OK"),
type: "error"
}); });
}, ///////////////////////////////////// },
/////////////////////////////////////
// Custom confirmation // Custom confirmation
// //
confirmGeneric(tKey) { confirmGeneric(tKey) {

View File

@@ -263,12 +263,11 @@ export default {
//Not found? //Not found?
if (res.error.code == "2010") { if (res.error.code == "2010") {
//notify not found error then navigate backwards //notify not found error then navigate backwards
window.$gz.dialog window.$gz.eventBus.$emit("notify-error", vm.t("ErrorAPI2010"));
.displayLTErrorMessage("ErrorAPI2010") // navigate backwards
.then(() => { window.$gz._.delay(function() {
// navigate backwards vm.$router.go(-1);
vm.$router.go(-1); }, 2000);
});
} }
vm.formState.serverError = res.error; vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm); window.$gz.form.setErrorBoxErrors(vm);

View File

@@ -408,12 +408,11 @@ export default {
//Not found? //Not found?
if (res.error.code == "2010") { if (res.error.code == "2010") {
//notify not found error then navigate backwards //notify not found error then navigate backwards
window.$gz.dialog window.$gz.eventBus.$emit("notify-error", vm.t("ErrorAPI2010"));
.displayLTErrorMessage("ErrorAPI2010") // navigate backwards
.then(() => { window.$gz._.delay(function() {
// navigate backwards vm.$router.go(-1);
vm.$router.go(-1); }, 2000);
});
} }
vm.formState.serverError = res.error; vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm); window.$gz.form.setErrorBoxErrors(vm);