This commit is contained in:
2019-05-29 22:08:27 +00:00
parent fa6fe20ae1
commit 4f4252a947
3 changed files with 31 additions and 10 deletions

View File

@@ -24,6 +24,9 @@ NEXT TODOS:
- On object not found when deleting an item and trying to reload the edit page, shoudl redirect to home or back instead or just not there
- On save of record should have a brief notification that auto closes that says "SAVED" or something just to handle the case of people not clicking on save??
- or, would the dirty check on nav away cover this anyway?
- Would it be annoying on a small device?
- Locale settings move to store
- Right now if you reload a page the locale settings reset back to default as they are not backed by the store
- However localized text keys do not because they *are* backed by the store

View File

@@ -94,6 +94,23 @@ export default {
}
]
});
},
/////////////////////////////////////
// Display LT message with wait for ok
//
displayLTErrorMessage(vm, ltKeyText, ltKeyTitle = undefined) {
//https://github.com/yariksav/vuetify-dialog#readme
return vm.$dialog.error({
text: ltKeyText ? vm.$gzlocale.get(ltKeyText) : "",
title: ltKeyTitle ? vm.$gzlocale.get(ltKeyTitle) : "",
icon: "fa-exclamation-triangle",
actions: [
{
text: vm.$gzlocale.get("OK"),
key: true
}
]
});
}
//new functions above here
};

View File

@@ -13,8 +13,7 @@
transition="scale-transition"
class="multi-line"
outline
>{{ formState.errorBoxMessage }}</v-alert
>
>{{ formState.errorBoxMessage }}</v-alert>
</v-flex>
<v-flex xs12 sm6 lg4 xl3 px-2>
<v-text-field
@@ -352,13 +351,15 @@ export default {
if (res.error) {
if (res.error.code == "2010") {
//notify error then navigate backwards
vm.$gzevent.$emit("notify-error", res.error.message);//TODO LOCALIZE THIS AND MOVE TO API
vm.$gzdialog
.displayLTErrorMessage(vm, "ErrorAPI2010")
.then(() => {
// navigate backwards
vm.$router.go(-1);
});
}
vm.formState.serverError = res.error;
vm.$gzform.setErrorBoxErrors(vm);
} else {
vm.obj = res.data;
//Update the form status