diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 193bea3a..2d74239f 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -30,6 +30,7 @@ TODO: - Can the save button be enabled more quickly after losing focus on the edited field or should I revamp that? - I can see users making a quick change clicking on save once and it won't save but they think it has. - Right now you need to click twice on save + - 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 ### RETEST ALL DEVICES WHEN GET TO HERE ##### diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index b5ce2789..76d5cde6 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -485,7 +485,8 @@ export default { // loading:bool | undefined} // setFormState(newState) { - Vue.nextTick(function() { + //this returns a promise so any function that needs to wait for this can utilize that + return Vue.nextTick(function() { if (newState.valid != undefined) { newState.vm.formState.valid = newState.valid; } diff --git a/ayanova/src/components/inventorywidgetlist.vue b/ayanova/src/components/inventorywidgetlist.vue index da6f346a..9031c69d 100644 --- a/ayanova/src/components/inventorywidgetlist.vue +++ b/ayanova/src/components/inventorywidgetlist.vue @@ -10,14 +10,17 @@ transition="scale-transition" class="multi-line" outline - >{{ formState.errorBoxMessage }} + >{{ formState.errorBoxMessage }}
fa-splotch - {{ this.$gzlocale.get("WidgetList") }} + {{ + this.$gzlocale.get("WidgetList") + }} @@ -48,13 +51,17 @@ diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index f06c1a9b..34cb5fa5 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -13,7 +13,8 @@ transition="scale-transition" class="multi-line" outline - >{{ formState.errorBoxMessage }} + >{{ formState.errorBoxMessage }} READY: {{ formState.ready }} -
+
LOADING: {{ formState.loading }} -
+
DIRTY: {{ formState.dirty }} -
+
VALID: {{ formState.valid }} -
+
READONLY: {{ formState.readOnly }} -
+
@@ -228,6 +229,8 @@ function generateMenu(vm, readOnly) { vm.$gzevent.$emit("menu-change", menuOptions); } +var JUST_DELETED=false; + export default { beforeCreate() { //Cache all required lt keys @@ -273,7 +276,7 @@ export default { }, beforeRouteLeave(to, from, next) { var vm = this; - if (this.formState.dirty) { + if (this.formState.dirty && !JUST_DELETED) { vm.$gzdialog.confirmLeaveUnsaved(vm).then(dialogResult => { if (dialogResult == true) { next(); @@ -430,14 +433,25 @@ export default { vm.formState.serverError = res.error; vm.$gzform.setErrorBoxErrors(vm); } else { - //success set to not dirty so navigation guard is not triggered - vm.$gzform.setFormState({ - vm: vm, - dirty: false - }); + JUST_DELETED=true; + // navigate backwards + vm.$router.go(-1); - // navigate backwards - vm.$router.go(-1); + + // //es-lint-disable-next-line + // console.log(vm.$gzform.setFormState); + // //success set to not dirty so navigation guard is not triggered + // var that=vm; + // that.$gzform + // .setFormState({ + // vm: that, + // dirty: false + // }) + // .then(() =>{ + // // navigate backwards + // that.$router.go(-1); + // } + // ); } }) .catch(function handleGetDataFromAPIError(error) { diff --git a/ayanova/src/views/inventory.vue b/ayanova/src/views/inventory.vue index a6601a3f..d189abf0 100644 --- a/ayanova/src/views/inventory.vue +++ b/ayanova/src/views/inventory.vue @@ -12,13 +12,14 @@ transition="scale-transition" class="multi-line" outline - >{{ formState.errorBoxMessage }} + >{{ formState.errorBoxMessage }}
- - - - - + + + + + @@ -29,10 +30,9 @@ Cras facilisis mi vitae nunc lobortis pharetra. Nulla volutpat - tincidunt ornare. Pellentesque habitant morbi tristique senectus - et netus et malesuada fames ac turpis egestas. Nullam in aliquet - odio. Aliquam eu est vitae tellus bibendum tincidunt. - Suspendisse potenti. + tincidunt ornare. Pellentesque habitant morbi tristique senectus et + netus et malesuada fames ac turpis egestas. Nullam in aliquet odio. + Aliquam eu est vitae tellus bibendum tincidunt. Suspendisse potenti.