This commit is contained in:
2021-02-08 18:25:31 +00:00
parent 61078f5eaa
commit 6abb536009
2 changed files with 19 additions and 9 deletions

View File

@@ -7,7 +7,8 @@
MISC ITEMS THAT CAME UP
todo: tagpicker, don't like how it works, it's funky to enter multiple tags and input doesn't go away when you select it just leaves the typed text there
once a selection is made it should not repeat the typed text again, it shoudl be ready to type another tag from start
LISTVIEW REPLACE CURRENT <----HERE not THERE ---v
@@ -15,11 +16,6 @@ LISTVIEW REPLACE CURRENT <----HERE not THERE ---v
TODO (now)
Tag filter: "[{\"column\":\"customertags\",\"any\":false,\"items\":[{\"op\":\"=\",\"value\":[\"orange\"]}]}]"
Error: >Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: [. Path '[0].items[0].value', line 1, position 66.
Issue is because the "value" of tags filter is an array but c# expects a single string in the value columnm, so turn it into a comma delimited list instead and
then adjust the server code to handle it
todo (after)
Test TEST **TEST**

View File

@@ -379,9 +379,15 @@ export default {
items: []
};
this.editItem.filter.items.forEach(function(z) {
//de-arrayify tag filters
let filterValue = z.value;
if (Array.isArray(filterValue)) {
filterValue = z.value.join(); //array to string
}
newColumnFilter.items.push({
op: z.op,
value: z.value
value: filterValue
});
});
@@ -467,6 +473,7 @@ export default {
) {
filterItem.op = editItem.tempFilterOperator;
filterItem.value = editItem.tempFilterValue;
//only add if there is both an op and a value
//above here for tokens that isn't a restriction but
//after passing through those conditions were at a point where there MUST be both
@@ -869,8 +876,15 @@ editItemFilter:{ "any": false, "items": [] }
}
//If it's a tag and it's not been set yet it needs to have an empty array to stat with for the picker
if (o.uiFieldDataType == 9 && o.tempFilterValue == null) {
o.tempFilterValue = [];
//otherwise it needs to be converted to an array from a comma delimited string for the picker as well
if (o.uiFieldDataType == 9) {
if (o.tempFilterValue == null) {
o.tempFilterValue = [];
} else {
//should be a comma delimited string, turn into array
console.log("nitEditItem tag filter items=", o.filter.items);
o.tempFilterValue = o.filter.items[0].split(",");
}
}
//Add display text for filter item (same as in addFilterCondition)