diff options
author | dg314 <david_grossman@brown.edu> | 2021-08-14 15:59:14 -0400 |
---|---|---|
committer | dg314 <david_grossman@brown.edu> | 2021-08-14 15:59:14 -0400 |
commit | 0607dce05a6f997308c15e32b9c6ae688ebef11b (patch) | |
tree | 6ad7c3928fb9e024a1c4726d7a7dad7adc3f2f1e | |
parent | 576c74eb596d19a7dfbef832ad626f5fcc4b8c71 (diff) |
testing
-rw-r--r-- | src/client/views/search/SearchBox.tsx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 9150b2e39..b9b3e358d 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -9,6 +9,7 @@ import { StrCast } from '../../../fields/Types'; import { DocumentType } from "../../documents/DocumentTypes"; import { DocumentManager } from "../../util/DocumentManager"; import { CollectionDockingView } from "../collections/CollectionDockingView"; +import { CollectionSchemaBooleanCell } from '../collections/collectionSchema/CollectionSchemaCells'; import { ViewBoxBaseComponent } from "../DocComponent"; import { FieldView, FieldViewProps } from '../nodes/FieldView'; import "./SearchBox.scss"; @@ -28,7 +29,6 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc public static Instance: SearchBox; private _inputRef = React.createRef<HTMLInputElement>(); - private _selectedCollection = CollectionDockingView.Instance; @observable _searchString = ""; @observable _docTypeString = "all"; @@ -182,16 +182,21 @@ export class SearchBox extends ViewBoxBaseComponent<FieldViewProps, SearchBoxDoc const blockedKeys = ["x", "y", "proto", "width", "autoHeight", "acl-Override", "acl-Public", "context", "zIndex", "height", "text-scrollHeight", "text-height", "cloneFieldFilter", "isPrototype", "text-annotations", "dragFactory-count", "text-noTemplate", "aliases", "system", "layoutKey", "baseProto", "xMargin", "yMargin", "links", "layout", "layout_keyValue", "fitWidth", "viewType", "title-custom", "panX", "panY", "viewScale"] + const collection = CollectionDockingView.Instance; query = query.toLowerCase(); this._results = [] this._selectedResult = undefined - if (this._selectedCollection !== undefined) { - const docs = DocListCast(this._selectedCollection.dataDoc[Doc.LayoutFieldKey(this._selectedCollection.dataDoc)]); + console.log("123"); + if (CollectionDockingView.Instance !== undefined) { + console.log("456"); + const docs = DocListCast(collection.dataDoc[Doc.LayoutFieldKey(collection.dataDoc)]); const docIDs: String[] = [] + console.log(docs.length) SearchBox.foreachRecursiveDoc(docs, (depth: number, doc: Doc) => { const dtype = StrCast(doc.type, "string") as DocumentType; + console.log("HELLO"); if (dtype && !blockedTypes.includes(dtype) && !docIDs.includes(doc[Id]) && depth > 0) { const hlights = new Set<string>(); SearchBox.documentKeys(doc).forEach(key => Field.toString(doc[key] as Field).toLowerCase().includes(query) && hlights.add(key)); |