aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-01 16:57:49 -0400
committerbobzel <zzzman@gmail.com>2020-09-01 16:57:49 -0400
commit4bdb3b64c476ffdc5b5c53c9c296c50ce68a8fc5 (patch)
tree5191a0ec62c09d1aebaa1fcb0e3195054836c598 /src/client/views/collections/CollectionView.tsx
parented69ee12a8d9971810c9f391700de526185f0738 (diff)
fixed facet filters operations and whitelisting of known fields
Diffstat (limited to 'src/client/views/collections/CollectionView.tsx')
-rw-r--r--src/client/views/collections/CollectionView.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 81403de46..cb053e85c 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -400,12 +400,19 @@ export class CollectionView extends Touchable<FieldViewProps & CollectionViewCus
const viewSpecScript = ScriptCast(this.props.Document.viewSpecScript);
return viewSpecScript ? docs.filter(d => viewSpecScript.script.run({ doc: d }, console.log).result) : docs;
}
+
@computed get _allFacets() {
TraceMobx();
- const facets = new Set<string>(["type", "text", "data", "author", "ACL"]);
+ return ["author", "creationDate", "type", "text", "context"];
+ const noviceReqFields = ["author", "creationDate", "type", "text", "context"];
+ const noviceLayoutFields: string[] = [];//["_curPage"];
+ const noviceFields = [...noviceReqFields, ...noviceLayoutFields];
+
+ const facets = new Set<string>([...noviceReqFields, ...noviceLayoutFields]);
this.childDocs.filter(child => child).forEach(child => child && Object.keys(Doc.GetProto(child)).forEach(key => facets.add(key)));
Doc.AreProtosEqual(this.dataDoc, this.props.Document) && this.childDocs.filter(child => child).forEach(child => Object.keys(child).forEach(key => facets.add(key)));
- return Array.from(facets).filter(f => !f.startsWith("_") && !["proto", "zIndex", "isPrototype", "context", "text-noTemplate"].includes(f)).sort();
+
+ return Array.from(facets).filter(key => key[0] === "#" || key.indexOf("lastModified") !== -1 || (key[0] === key[0].toUpperCase() && !key.startsWith("_") && !key.startsWith("ACL")) || noviceFields.includes(key)).sort();
}
/**