aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorAndy Rickert <andrew_rickert@brown.edu>2020-07-26 18:30:47 -0400
committerAndy Rickert <andrew_rickert@brown.edu>2020-07-26 18:30:47 -0400
commit383351a022ff7b20a46a2d492d04ac350b1f2eb3 (patch)
tree915a4436b29d96063ae8238b98dded39f1ed9350 /src/client/views/collections
parente2a082c8e4101d33b3e01a75ba541d1ad72dc74c (diff)
searching within collections : )
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionSchemaHeaders.tsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index ec8605215..0ee225407 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -323,7 +323,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
@action
onSelect2 = (key: string): void => {
- this._searchTerm=this._searchTerm.slice(0,this._key.length) +key;
+ this._searchTerm = this._searchTerm.slice(0, this._key.length) + key;
this._isOpen = false;
}
@@ -404,16 +404,15 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
}
renderFilterOptions = (): JSX.Element[] | JSX.Element => {
- console.log("HEHEHE")
if (!this._isOpen) return <></>;
- const keyOptions:string[]=[];
+ const keyOptions: string[] = [];
console.log(this._searchTerm.slice(this._key.length))
let temp = this._searchTerm.slice(this._key.length);
- this.props.docs?.forEach((doc)=>{
+ this.props.docs?.forEach((doc) => {
let key = StrCast(doc[this._key]);
- if (keyOptions.includes(key)===false && key.includes(temp)){
- keyOptions.push(key);
+ if (keyOptions.includes(key) === false && key.includes(temp)) {
+ keyOptions.push(key);
}
});
@@ -423,7 +422,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
border: "1px solid lightgray",
width: this.props.width, maxWidth: this.props.width, overflowX: "hidden"
}}
- onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect2(key); }}>{key}</div>;
+ onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect2(key); }}>{key}</div>;
});
return options;
@@ -452,7 +451,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
}}
onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
{this._key === this._searchTerm.slice(0, this._key.length) ?
- this.renderFilterOptions():this.renderOptions()}
+ this.renderFilterOptions() : this.renderOptions()}
</div>
</div >
);