From 7827e692abfbbc70893a76e52681a9f83ccba5db Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 9 Feb 2021 00:00:49 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 51 +-------------------------- ayanova/src/components/data-table.vue | 48 ++++++++++++++++++------- 2 files changed, 36 insertions(+), 63 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index cf83d50f..f4e078d0 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -7,57 +7,8 @@ MISC ITEMS THAT CAME UP -todo: custom column shenanigans: - DETERMINED: - *Issues occurring in lists when have Custom columns show* - - If enable any Custom column to show, data displayed gets messed up if there is no data in the field. - For example, if set Custom5 as first column, then that somehow pushes data into other columns. Take a look at HeadOffices list . Issue: The actual name of the company is showing under the column heading Custom5. Issue: when select a HO name, nothing happens (HO form does not open) - - Also issues occurs if Custom columns are placed elsewhere (i.e. issue is NOT only when Custom column is listed first). - i.e. if place Custom5 column before Tags column, then the tags data will appear "to move" depending if there is any data in Custom5 - - xo - - - On 08-Feb.-2021 11:54 a.m., AyaNova Sales & Support wrote: - > MORE: - > - > Have determined that what shows is dependent on the order of the columns (left to right). - > - > For example - in Head Office list, I CAN recreate below if I checkmark Custom1, Custom5 and then Tags columns to show. - > BUT if I instead, select Tags column FIRST before checkmarking columns Custom1 or Custom5, then the tags correctly show under the Tags column even if Custom1 has no data. - > - > So there appears to be something funky with data showing in incorrect column depending on the order (left to right) of the columns. - > - > - > xo - > - > - > On 08-Feb.-2021 10:11 a.m., AyaNova Sales & Support wrote: - >> Issue? Noticed that contents of "tags" are showing listed under Custom1 column if there is NO text in Custom1 or Custom5 (the two Custom columns set to show) - >> - >> Recreate: - >> Show Customers list - >> If not already (default list options for Superuser I just set has this) set to show, set to show the columns: Customer Name, Business, Email, Head Office, City, Custom1, Custom5, Tags - >> Change the sort order such as #1 is City and set sort order A -> Z - >> You will see: - >> - if there is NO text in the Custom1 field for that customer, then the tags show under Custom1 column - >> - if there IS text in the Custom1 field for that customer, then the tags correctly show under the Tags column - >> - >> - >> I DID NOT make a case for this. - >> - >> xo - >> - >> - >> - >> On 05-Feb.-2021 05:14 p.m., John Cardinal wrote: - >>> If you want to play with it or take some screenshots - >>> https://test.helloayanova.com/login - >>> - >>> the new Sort todo: is data-table function buildRecords(listData, columndefinitions, ridColumnOpenable) being called twice every time?? + Yes, fixed now but full of console.log statements to clean out, also should it be set in next tick everywhere? todo: column picker form, make not included columns not show the movement controls todo: if you change the filter the page should reset to 1 or else you get a weird scenario where it says page 5 but there is only one result page so it says no data diff --git a/ayanova/src/components/data-table.vue b/ayanova/src/components/data-table.vue index 9d5ddaae..f340a4d5 100644 --- a/ayanova/src/components/data-table.vue +++ b/ayanova/src/components/data-table.vue @@ -487,9 +487,31 @@ export default { ); if (!pagingHaschanged && !sortHasChanged) { + console.log("NOTHING CHANGED BAILING"); return; } + console.log("SOMETHING CHANGED", { + loading: this.loading, + itWasPaging: pagingHaschanged, + itWasSort: sortHasChanged, + srt: this.dataTablePagingOptions.sortBy, + desc: this.dataTablePagingOptions.sortDesc, + lastsrt: this.lastDataTablePagingOptions.sortBy, + lastdesc: this.lastDataTablePagingOptions.sortDesc + }); + console.trace(); + + //something changed, persist it to last + this.lastDataTablePagingOptions = this.dataTablePagingOptions; + + // console.log("AFTER LAST SET", { + // srt: this.dataTablePagingOptions.sortBy, + // desc: this.dataTablePagingOptions.sortDesc, + // lastsrt: this.lastDataTablePagingOptions.sortBy, + // lastdesc: this.lastDataTablePagingOptions.sortDesc + // }); + if (sortHasChanged && !this.loading) { //update sort at server and then allow get data @@ -505,9 +527,8 @@ export default { }); } - //has changed something important so refetch and put a pin in last paging settings for next time + //has changed something important so refetch await this.getDataFromApi(); - this.lastDataTablePagingOptions = this.dataTablePagingOptions; }, deep: true }, @@ -601,6 +622,7 @@ export default { }); }, setSortIndicatorsFromDataListResponse(rsort) { + console.log("SetSortIndicators - culprit? vm.loading is", this.loading); let sortBy = []; let sortDesc = []; if (rsort != null) { @@ -766,7 +788,10 @@ export default { vm.headers = buildHeaders(res.columns); //SET TABLE SORT HERE FROM RESPONSE + //BUGBUG: this line is triggering a second fetch, but it shouldn't be since we are in the midst of loading=true which should avoid a getData call + console.log("InGetData about to call setsortindicators"); vm.setSortIndicatorsFromDataListResponse(res.sortBy); + console.log("Back from setSortIndicators, building records..."); //Post process data here and then set vm.records vm.records = buildRecords( @@ -785,8 +810,14 @@ export default { } catch (err) { window.$gz.errorHandler.handleFormError(err, vm); } finally { - vm.loading = false; - vm.formState.ready = true; + console.log( + "InGetData Finally block setting loading to false via nexttick" + ); + vm.$nextTick(() => { + console.log("loading false in nexttick"); + vm.loading = false; + vm.formState.ready = true; + }); } } }, @@ -799,14 +830,6 @@ export default { vm.loading = false; vm.getDataFromApi(); } - // , - // beforeUpdate() { - // // //WTF is beforeUpdate doing and what is resetlxistview doing?? - // // console.log("data-table: BEFORE UPDATE CALLED WTF?"); - // // if (this.clientCriteria != null && this.activeFilterId != 0) { - // // this.resetLxistView(); - // // } - // } }; //Called by getDataFromApi on retrieval of list with columnData @@ -1048,7 +1071,6 @@ function buildRecords(listData, columndefinitions, ridColumnOpenable) { } ret.push(o); } - console.log("buildRecords ret:", { ...ret }); return ret; }