aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSchemaHeaders.tsx
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-08-12 03:55:26 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-08-12 03:55:26 -0400
commit4d6da44b4eb484d79fc263e5d36c02ea50265767 (patch)
treecb5a92b4eb2b5ea0efd346e948b46437dc6c9859 /src/client/views/collections/CollectionSchemaHeaders.tsx
parent6a3924a7ea3b4ced83d7f956f7e9c4694008368e (diff)
filtering in solr and pagination
Diffstat (limited to 'src/client/views/collections/CollectionSchemaHeaders.tsx')
-rw-r--r--src/client/views/collections/CollectionSchemaHeaders.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index c1c4eb628..fc2463c97 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -387,8 +387,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
});
// if search term does not already exist as a group type, give option to create new group type
- console.log("Start here");
- console.log(this._key, this._searchTerm.slice(0, this._key.length));
+
if (this._key !== this._searchTerm.slice(0, this._key.length)) {
console.log("little further");
if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) {
@@ -414,16 +413,20 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
}
return options;
}
+
+ docSafe: Doc[] = []
+
@action
renderFilterOptions = (): JSX.Element[] | JSX.Element => {
- console.log("we here");
if (!this._isOpen) {
this.defaultMenuHeight = 0;
return <></>;
}
let keyOptions: string[] = [];
- let docs = DocListCast(this.props.dataDoc![this.props.fieldKey!]);
-
+ if (this.docSafe.length === 0) {
+ this.docSafe = DocListCast(this.props.dataDoc![this.props.fieldKey!]);
+ }
+ let docs = this.docSafe;
docs.forEach((doc) => {
const key = StrCast(doc[this._key]);
if (keyOptions.includes(key) === false) {