From 4f4252a947798ad3e4ee5f8b6d147575701f5f6e Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 29 May 2019 22:08:27 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 5 ++++- ayanova/src/api/gzdialog.js | 17 +++++++++++++++++ ayanova/src/views/inventory-widget-edit.vue | 19 ++++++++++--------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 0dbc5e01..c79eff22 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -23,7 +23,10 @@ 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 diff --git a/ayanova/src/api/gzdialog.js b/ayanova/src/api/gzdialog.js index 3402aa7c..9bbce285 100644 --- a/ayanova/src/api/gzdialog.js +++ b/ayanova/src/api/gzdialog.js @@ -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 }; diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index 55ae95ba..faf719c1 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -13,8 +13,7 @@ transition="scale-transition" class="multi-line" outline - >{{ formState.errorBoxMessage }} + >{{ formState.errorBoxMessage }} - --> + --> @@ -345,20 +344,22 @@ export default { var url = "Widget/" + this.$route.params.id; var vm = this; this.$gzform.deleteAllErrorBoxErrors(this); - + this.$gzapi .get(url) .then(res => { if (res.error) { - if(res.error.code=="2010"){ + 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 - // navigate backwards - vm.$router.go(-1); + 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