From 019fb4a76d11bde525a8a7a4a5ff37dfe85db7ca Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 9 Apr 2020 22:58:18 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 +- ayanova/src/api/gzform.js | 8 ----- ayanova/src/api/translation.js | 1 - .../src/components/custom-fields-control.vue | 1 - ayanova/src/components/gz-data-table.vue | 8 +++-- .../components/report-selector-control.vue | 1 - ayanova/src/views/ay-data-list-view.vue | 5 --- ayanova/src/views/home-password.vue | 5 +-- ayanova/src/views/login.vue | 36 ------------------- ayanova/src/views/notfound.vue | 3 +- ayanova/src/views/widget.vue | 2 -- 11 files changed, 10 insertions(+), 63 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 9a06be81..ec13f4e0 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -49,8 +49,7 @@ CURRENT TODOs @@@@@@@@@@@ ROADMAP STAGE 2: -todo: what is vm.loading used for? - - generally preventing a loading a second time, but it's not checked for at the start in all cases so need to pick through and ensure that +todo: search form docs, jesus todo: RECORD HISTORY - implement in stubbed out separate page diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 3aca9c55..f267ce82 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -65,15 +65,7 @@ function getControl(vm, ref) { // function getControlValue(ctrl) { let value = ctrl.value; - // if(value==undefined){ - // debugger; - // if(ctrl._props){ - // let subvalue=ctrl._props; - - // } - // } return value; - //vm.$refs["customFields"]._computedWatchers.c2.value } //////////////////////////////////// diff --git a/ayanova/src/api/translation.js b/ayanova/src/api/translation.js index 9e1532eb..4d4a11e6 100644 --- a/ayanova/src/api/translation.js +++ b/ayanova/src/api/translation.js @@ -2,7 +2,6 @@ //AyaNova Translation related utilities export default { get(key) { - // debugger; if (!window.$gz._.has(window.$gz.store.state.translationText, key)) { return "??" + key; } diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index ff231d75..75ef5d7f 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -474,7 +474,6 @@ export default { }, created() { if (this.$ay.dev) { - //debugger; if (!this.formKey) { throw "custom-fields-control: formKey property is required and missing"; } diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index 672888ae..c1fc6bd3 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -533,7 +533,7 @@ export default { vm.headers = buildHeaders(res.columns); //Post process data here and then set vm.records vm.records = buildRecords(res.data, res.columns); - vm.loading = false; + vm.totalRecords = res.totalRecordCount; //Put back selected items vm.selected = [...preSelected]; @@ -545,8 +545,11 @@ export default { } }) .catch(err => { - vm.formState.ready = true; window.$gz.errorHandler.handleFormError(err, vm); + }) + .finally(function() { + vm.loading = false; + vm.formState.ready = true; }); } }, @@ -565,7 +568,6 @@ export default { //Called by getDataFromApi on retrieval of list with columnData function buildHeaders(columnData) { - //debugger; //iterate columns, build headers and return if (!columnData) { return []; diff --git a/ayanova/src/components/report-selector-control.vue b/ayanova/src/components/report-selector-control.vue index 9851462f..286ebd4c 100644 --- a/ayanova/src/components/report-selector-control.vue +++ b/ayanova/src/components/report-selector-control.vue @@ -71,7 +71,6 @@ export default { }, methods: { open() { - //debugger; //get report list from server //for now we'll fake it let fakeReportList = []; diff --git a/ayanova/src/views/ay-data-list-view.vue b/ayanova/src/views/ay-data-list-view.vue index 8fdc17dd..53271836 100644 --- a/ayanova/src/views/ay-data-list-view.vue +++ b/ayanova/src/views/ay-data-list-view.vue @@ -745,7 +745,6 @@ export default { window.$gz.form.setFormSettings(vm.formKey, formSettings); //Logic for detecting if a post or put: if id then it was a post, if no id then it was a put - // debugger; if (res.data.id) { //Handle "post" of new record (CREATE) @@ -843,7 +842,6 @@ export default { window.$gz.api .duplicate(url) .then(res => { - // debugger; vm.formState.loading = false; if (res.error) { vm.formState.serverError = res.error; @@ -1322,7 +1320,6 @@ function initDataObject(vm) { } //Pass 2, remaining fields not already dealt with - //debugger; for (let i = 0; i < vm.fieldDefinitions.length; i++) { let fld = vm.fieldDefinitions[i]; @@ -1457,7 +1454,6 @@ function getDisplayForFilter( valueDisplay = window.$gz.locale.decimalLocalized(filterValue); break; case 6: //BOOL translate - //debugger; let tKey = filterValue ? "True" : "False"; valueDisplay = vm.$ay.t(tKey); break; @@ -1503,7 +1499,6 @@ function generateListViewFromEdited(vm) { o.sort = ev.sort; } if (ev.filter && ev.filter.items && ev.filter.items.length > 0) { - // debugger; let f = { items: [] }; diff --git a/ayanova/src/views/home-password.vue b/ayanova/src/views/home-password.vue index 561af16c..278edbbc 100644 --- a/ayanova/src/views/home-password.vue +++ b/ayanova/src/views/home-password.vue @@ -204,7 +204,6 @@ export default { window.$gz.api .upsert(url, vm.obj) .then(res => { - vm.formState.loading = false; if (res.error) { vm.formState.serverError = res.error; window.$gz.form.setErrorBoxErrors(vm); @@ -217,8 +216,10 @@ export default { } }) .catch(function handleSubmitError(error) { - vm.formState.loading = false; window.$gz.errorHandler.handleFormError(error, vm); + }) + .finally(function() { + vm.loading = false; }); } } diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index 54900ec8..eb629147 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -317,40 +317,4 @@ export default { }); } }; - -// created() { -// console.log("CREATED"); -// // window.$gz.api -// // .get("license/trial") -// // .then(res => { -// // debugger; -// // vm.formState.ready = true; -// // if (res.error) { -// // vm.formState.serverError = res.error; -// // window.$gz.form.setErrorBoxErrors(vm); -// // } else { -// // vm.trialMode = res.data; -// // // vm.obj = res.data; - -// // // //Update the form status -// // // window.$gz.form.setFormState({ -// // // vm: vm, -// // // dirty: false, -// // // valid: true, -// // // loading: false, -// // // readOnly: res.readOnly ? true : false -// // // }); -// // // //modify the menu as necessary -// // // generateMenu(vm); -// // } -// // }) -// // .catch(function handleGetDataFromAPIError(error) { -// // //Update the form status -// // window.$gz.form.setFormState({ -// // vm: vm, -// // loading: false -// // }); -// // window.$gz.errorHandler.handleFormError(error, vm); -// // }); -// }, diff --git a/ayanova/src/views/notfound.vue b/ayanova/src/views/notfound.vue index ddd826cb..afc8912f 100644 --- a/ayanova/src/views/notfound.vue +++ b/ayanova/src/views/notfound.vue @@ -21,9 +21,8 @@ export default { }; }, created() { - // debugger; let badPath = this.$router.history.current.path; - //If this happens too early then it might not have all the setup stuf available which would trigger an infinite loop + //If this happens too early then it might not have all the setup stuff available which would trigger an infinite loop if ( !window || !window.$gz || diff --git a/ayanova/src/views/widget.vue b/ayanova/src/views/widget.vue index c6541b58..db2ac251 100644 --- a/ayanova/src/views/widget.vue +++ b/ayanova/src/views/widget.vue @@ -463,7 +463,6 @@ export default { } }) .catch(function handleSubmitError(error) { - debugger; vm.formState.loading = false; window.$gz.errorHandler.handleFormError(error, vm); }); @@ -523,7 +522,6 @@ export default { window.$gz.api .duplicate(url) .then(res => { - // debugger; vm.formState.loading = false; if (res.error) { vm.formState.serverError = res.error;