From 5976bb19671b36778b65686fef8c11130c1fa5e9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 20 Feb 2020 22:35:22 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 1 + .../api/relative-date-filter-calculator.js | 2 +- ayanova/src/views/ay-data-list-view.vue | 27 ++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index a3e31cb4..d80cffb6 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -275,6 +275,7 @@ TAGS - At server if equality compare value is an array of strings then it's assu ---------------------- NON DATALISTVIEW STUFF ---------------------------- +TODO: Add test for *NULL* and not *NULL* in datalistfilter tests as there currently aren't any TODO: ay-data-list-view initform code shows proper way to initialize and await each step - Take that model and look at all the other forms and ensure they work the same way diff --git a/ayanova/src/api/relative-date-filter-calculator.js b/ayanova/src/api/relative-date-filter-calculator.js index 7c6aa296..595f6682 100644 --- a/ayanova/src/api/relative-date-filter-calculator.js +++ b/ayanova/src/api/relative-date-filter-calculator.js @@ -4,7 +4,7 @@ // { // public static class DataListFilterSpecialToken // { -// public const string Null = "{[null]}"; +// public const string Null = "*NULL*"; // public const string Yesterday = "{[yesterday]}"; // public const string Today = "{[today]}"; // public const string Tomorrow = "{[tomorrow]}"; diff --git a/ayanova/src/views/ay-data-list-view.vue b/ayanova/src/views/ay-data-list-view.vue index 4f360efa..466d9426 100644 --- a/ayanova/src/views/ay-data-list-view.vue +++ b/ayanova/src/views/ay-data-list-view.vue @@ -393,12 +393,37 @@ export default { Dates have special values in tempFilterToken that must be handled specially if Date tempfiltertoken is *select* then no special value token is in use like YESTERDAY - everything has special values in the tempfilterOperator of two choices *NOVALUE* or *HASVALUE*, otherwise it's a straight up filter operator + + + ONLY OTHER POSSIBLE TOKEN: + every type can have in the tempfilterOperator two choices *NOVALUE* or *HASVALUE*, + otherwise it's a straight up filter operator In all other cases than above tempfilterOperator is relevant and tempFilterValue is relevant TODO: sample fragment of each kind as are done I guess TODO: DataTAble needs to pre-process filter to substitute tokens on the fly before sending to the server */ + var filterItem = { op: null, value: null }; + //DATE relative token? + if (item.uiFieldDataType === 1) { + //some kind of relative date token? + if (item.tempFilterToken && item.tempFilterToken != "*select*") { + //special relative token + filterItem.op = "="; //equality + filterItem.value = item.tempFilterToken; + item.filter.items.push(filterItem); + return; + } + } + if(item.tempFilterOperator=="*NOVALUE*"){ + filterItem.op="="; + } + + + item.filter.items.push({ + op: item.tempFilterOperator, + value: item.tempFilterValue + }); console.log(item); }, form() {