diff options
author | bobzel <zzzman@gmail.com> | 2023-09-18 14:41:53 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-09-18 14:41:53 -0400 |
commit | 84aa8806a62e2e957e8281d7d492139e3d8225f2 (patch) | |
tree | c3de2cbc0517743daa677aef1dfdb4fd55c96ba4 /src/fields/Doc.ts | |
parent | 2b96f355ea7f4aa0e1fcf0dbee8ce6bf6e8f09d4 (diff) |
removed filter checkboxes for list values since they don't work. fixed any/undefined filtering for tags or other list fields.
Diffstat (limited to 'src/fields/Doc.ts')
-rw-r--r-- | src/fields/Doc.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index 78a03d782..56b97e42f 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -1481,14 +1481,18 @@ export namespace Doc { value = value.replace(`,${Utils.noRecursionHack}`, ''); } const fieldVal = doc[key]; + // prettier-ignore + if ((value === Doc.FilterAny && fieldVal !== undefined) || + (value === Doc.FilterNone && fieldVal === undefined)) { + return true; + } if (Cast(fieldVal, listSpec('string'), []).length) { const vals = StrListCast(fieldVal); const docs = vals.some(v => (v as any) instanceof Doc); if (docs) return value === Field.toString(fieldVal as Field); return vals.some(v => v.includes(value)); // bcz: arghh: Todo: comparison should be parameterized as exact, or substring } - const fieldStr = Field.toString(fieldVal as Field); - return fieldStr.includes(value) || (value === Doc.FilterAny && fieldVal !== undefined) || (value === Doc.FilterNone && fieldVal === undefined); // bcz: arghh: Todo: comparison should be parameterized as exact, or substring + return Field.toString(fieldVal as Field).includes(value); // bcz: arghh: Todo: comparison should be parameterized as exact, or substring } export function deiconifyView(doc: Doc) { |