This commit is contained in:
2021-02-08 22:20:56 +00:00
parent 8dd8747c1f
commit af2d581f58

View File

@@ -7,10 +7,8 @@
> >
<v-card> <v-card>
<v-card-title>{{ tableColumnData.text }}</v-card-title> <v-card-title>{{ tableColumnData.text }}</v-card-title>
<!-- <v-card-subtitle class="mt-1">sub title text</v-card-subtitle> -->
<v-card-text> <v-card-text>
<!-- activefilter:{{ activeFilter }} <br /><br />
editItemFilter:{{ editItem.filter }} -->
<!-- FILTER CONTROL --> <!-- FILTER CONTROL -->
<template v-if="editItem.isFilterable"> <template v-if="editItem.isFilterable">
<div class="pt-6"> <div class="pt-6">
@@ -493,9 +491,6 @@ export default {
); );
//add only if not already in the collection (accidental double click) //add only if not already in the collection (accidental double click)
//de-lodash
// if (!window.$gz. _.find(editItem.filter.items, filterItem)) {
//some fits better here as it only test for truthiness and returns immediately on true //some fits better here as it only test for truthiness and returns immediately on true
//also the item is unique and display doesn't need to be compared for equality it's irrelevant //also the item is unique and display doesn't need to be compared for equality it's irrelevant
//so only the op and the value need to be checked //so only the op and the value need to be checked
@@ -549,10 +544,6 @@ async function initForm(vm) {
await fetchTranslatedText(vm); await fetchTranslatedText(vm);
populateSelectionLists(vm); populateSelectionLists(vm);
await populateFieldDefinitions(vm); await populateFieldDefinitions(vm);
// await fetchTranslatedFieldNames(vm);
// await setEffectiveListView(vm);
// await fetchEnums(vm);
} }
//////////////////// ////////////////////
@@ -839,13 +830,6 @@ function populateSelectionLists(vm) {
//////////////////// ////////////////////
// //
function initEditItem(vm) { function initEditItem(vm) {
/*
activefilter:{ "id": 1, "concurrency": 5029405, "userId": 1, "name": "-", "public": false, "defaultFilter": true, "listKey": "TestWidgetDataList",
"filter": "[{\"column\":\"widgetname\",\"any\":false,\"items\":[{\"op\":\">\",\"value\":\"A\"}]},{\"column\":\"widgetserial\",\"any\":false,\"items\":[{\"op\":\">\",\"value\":\"50\"}]},{\"column\":\"widgetdollaramount\",\"any\":false,\"items\":[{\"op\":\">\",\"value\":9}]}]" }
editItemFilter:{ "any": false, "items": [] }
*/
if (vm.fieldDefinitions == null) { if (vm.fieldDefinitions == null) {
throw new Error( throw new Error(
"ay-data-list::initEditItem - fieldDefinitions are not set" "ay-data-list::initEditItem - fieldDefinitions are not set"
@@ -882,7 +866,6 @@ editItemFilter:{ "any": false, "items": [] }
o.tempFilterValue = []; o.tempFilterValue = [];
} else { } else {
//should be a comma delimited string, turn into array //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(","); o.tempFilterValue = o.filter.items[0].split(",");
} }
} }
@@ -918,30 +901,17 @@ function getDisplayForFilter(
) { ) {
//BLANKS FILTER //BLANKS FILTER
if (filterOperator == "=" && filterValue == "*NULL*") { if (filterOperator == "=" && filterValue == "*NULL*") {
//de-lodash
// return window.$gz. _.find(vm.selectLists.stringFilterOperators, {
// id: "*NOVALUE*"
// }).name;
return vm.selectLists.stringFilterOperators.find(z => z.id == "*NOVALUE*") return vm.selectLists.stringFilterOperators.find(z => z.id == "*NOVALUE*")
.name; .name;
} }
// NONBLANKS FILTER // NONBLANKS FILTER
if (filterOperator == "!=" && filterValue == "*NULL*") { if (filterOperator == "!=" && filterValue == "*NULL*") {
//de-lodash
// return window.$gz. _.find(vm.selectLists.stringFilterOperators, {
// id: "*HASVALUE*"
// }).name;
return vm.selectLists.stringFilterOperators.find(z => z.id == "*HASVALUE*") return vm.selectLists.stringFilterOperators.find(z => z.id == "*HASVALUE*")
.name; .name;
} }
//DATE RELATIVE TOKEN FILTER //DATE RELATIVE TOKEN FILTER
if (uiFieldDataType === 1 && filterValue[0] == "*") { if (uiFieldDataType === 1 && filterValue[0] == "*") {
//de-lodash
// let valueDisplay = window.$gz. _.find(vm.selectLists.dateFilterTokens, {
// id: filterValue
// }).name;
let valueDisplay = vm.selectLists.dateFilterTokens.find( let valueDisplay = vm.selectLists.dateFilterTokens.find(
z => z.id == filterValue z => z.id == filterValue
).name; ).name;
@@ -952,11 +922,6 @@ function getDisplayForFilter(
//VALUE FILTER //VALUE FILTER
//Nothing more to do if there isn't both a value AND an operator at this point //Nothing more to do if there isn't both a value AND an operator at this point
if (filterOperator == null || filterValue == null) { if (filterOperator == null || filterValue == null) {
// if (window.$gz.dev) {
// throw new Error(
// "ay-data-list-column-view::getDisplayForFilter Value filter missing one ore more of Operator, Value"
// );
// }
return ""; return "";
} }
@@ -986,11 +951,6 @@ function getDisplayForFilter(
} }
//Operator //Operator
//de-lodash
// let opDisplay = window.$gz. _.find(vm.selectLists.stringFilterOperators, {
// id: filterOperator
// }).name;
let opDisplay = vm.selectLists.stringFilterOperators.find( let opDisplay = vm.selectLists.stringFilterOperators.find(
z => z.id == filterOperator z => z.id == filterOperator
).name; ).name;