aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-10 20:49:26 -0400
committerbobzel <zzzman@gmail.com>2020-10-10 20:49:26 -0400
commit858fdbf31c9ddbf00eae692cd43e70455a19e1b5 (patch)
treec3756fb8b91e95d2fb98cad8d519d6bb8b2ff790 /src/client/documents/Documents.ts
parentc63aeeb0010a79f0b19d8719f97d98b7a83baf3b (diff)
fixed docFilters to use up one string field, not 3. makes adding/removing to lists incrementally work with new server code.
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 7d78bd76a..159771145 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -895,8 +895,11 @@ export namespace Docs {
export namespace DocUtils {
export function Excluded(d: Doc, docFilters: string[]) {
const filterFacets: { [key: string]: { [value: string]: string } } = {}; // maps each filter key to an object with value=>modifier fields
- for (let i = 0; i < docFilters.length; i += 3) {
- const [key, value, modifiers] = docFilters.slice(i, i + 3);
+ for (let i = 0; i < docFilters.length; i++) {
+ const fields = docFilters[i].split(":");
+ const key = fields[0];
+ const value = fields[1];
+ const modifiers = fields[2];
if (!filterFacets[key]) {
filterFacets[key] = {};
}
@@ -918,8 +921,11 @@ export namespace DocUtils {
const childDocs = viewSpecScript ? docs.filter(d => viewSpecScript.script.run({ doc: d }, console.log).result) : docs;
const filterFacets: { [key: string]: { [value: string]: string } } = {}; // maps each filter key to an object with value=>modifier fields
- for (let i = 0; i < docFilters.length; i += 3) {
- const [key, value, modifiers] = docFilters.slice(i, i + 3);
+ for (let i = 0; i < docFilters.length; i++) {
+ const fields = docFilters[i].split(":");
+ const key = fields[0];
+ const value = fields[1];
+ const modifiers = fields[2];
if (!filterFacets[key]) {
filterFacets[key] = {};
}