diff options
| author | bobzel <zzzman@gmail.com> | 2020-08-12 13:09:36 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-08-12 13:09:36 -0400 |
| commit | e5e693d7699e34d20fb183bc2514557edfb7d0f7 (patch) | |
| tree | e0cfd9ab9766d827c30a0a74ef27772bba5d41c2 /src/client/views/collections/CollectionSchemaHeaders.tsx | |
| parent | 5117ba5f30afe271095ae92c511844dfe7d0cc85 (diff) | |
fixed compound solr query syntax. fixed filter options to be sticky so that they don't get lost with a new search
Diffstat (limited to 'src/client/views/collections/CollectionSchemaHeaders.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionSchemaHeaders.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx index 7a1a6b41e..d379f1c1e 100644 --- a/src/client/views/collections/CollectionSchemaHeaders.tsx +++ b/src/client/views/collections/CollectionSchemaHeaders.tsx @@ -420,10 +420,16 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> { } }); + let filters = Cast(this.props.Document!._docFilters, listSpec("string")); + for (let i = 0; i < (filters?.length ?? 0) - 1; i += 3) { + if (filters![i] === this.props.col.heading && keyOptions.includes(filters![i + 1]) === false) { + keyOptions.push(filters![i + 1]); + } + } + const options = keyOptions.map(key => { //Doc.setDocFilter(this.props.Document!, this._key, key, undefined); let bool = false; - let filters = Cast(this.props.Document!._docFilters, listSpec("string")); console.log(filters); if (filters !== undefined) { bool = filters.includes(key) && filters[filters.indexOf(key) + 1] === "check"; @@ -434,7 +440,10 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> { width: this.props.width, maxWidth: this.props.width, overflowX: "hidden", background: "white", backgroundColor: "white", }} > - <input type="checkbox" onChange={(e) => { e.target.checked === true ? Doc.setDocFilter(this.props.Document!, this._key, key, "check") : Doc.setDocFilter(this.props.Document!, this._key, key, undefined); e.target.checked === true && SearchBox.Instance.filter === true ? Doc.setDocFilter(docs![0], this._key, key, "check") : Doc.setDocFilter(docs![0], this._key, key, undefined); }} + <input type="checkbox" onChange={(e) => { + e.target.checked === true ? Doc.setDocFilter(this.props.Document!, this._key, key, "check") : Doc.setDocFilter(this.props.Document!, this._key, key, undefined); + e.target.checked === true && SearchBox.Instance.filter === true ? Doc.setDocFilter(docs![0], this._key, key, "check") : Doc.setDocFilter(docs![0], this._key, key, undefined); + }} checked={bool} ></input> <span style={{ paddingLeft: 4 }}> {key} |
