From 9b2ea107b5073df0b86b701d743a5c25aa0b1dd6 Mon Sep 17 00:00:00 2001 From: madelinegr Date: Fri, 14 Jun 2019 15:04:57 -0400 Subject: something is incorrect! --- src/client/views/search/IconBar.tsx | 2 +- src/client/views/search/IconButton.tsx | 38 ++++++++++++++++++++++++++++++++++ src/client/views/search/SearchBox.tsx | 5 +++++ src/client/views/search/minus.svg | 5 ----- src/client/views/search/plus.svg | 5 ----- 5 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 src/client/views/search/IconButton.tsx delete mode 100644 src/client/views/search/minus.svg delete mode 100644 src/client/views/search/plus.svg (limited to 'src') diff --git a/src/client/views/search/IconBar.tsx b/src/client/views/search/IconBar.tsx index bc3b04ef3..abec9a8b5 100644 --- a/src/client/views/search/IconBar.tsx +++ b/src/client/views/search/IconBar.tsx @@ -343,7 +343,7 @@ export class IconBar extends React.Component { data-selected={"false"} data-removed={"false"} onClick={() => { this.onClick(DocTypes.NONE); }}> - +
Clear
diff --git a/src/client/views/search/IconButton.tsx b/src/client/views/search/IconButton.tsx new file mode 100644 index 000000000..30dd3676d --- /dev/null +++ b/src/client/views/search/IconButton.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import { observer } from 'mobx-react'; +import { observable, action, runInAction } from 'mobx'; +import "./SearchBox.scss"; +import "./IconBar.scss"; +import { faSearch, faFilePdf, faFilm, faImage, faObjectGroup, faStickyNote, faMusic, faLink, faChartBar, faGlobeAsia, faBan } from '@fortawesome/free-solid-svg-icons'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { library, icon } from '@fortawesome/fontawesome-svg-core'; + +interface IconButtonProps { + ref: React.RefObject; + isRefSelected(r: any): boolean; + isRemoved(ref: any): boolean; + type: string; + getInitialSelectedStatus(ref: any): string; + getInitialRemovedStatus(ref: any): string; + onClick(t: string): void; + icon: any; +} + +@observer +export class IconButton extends React.Component{ + + render() { + return ( +
+
{ this.props.onClick(this.props.type); }}> + +
+
{this.props.type}
+
+ ); + } +} \ No newline at end of file diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index 4befb99ec..5445f9cb0 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -81,6 +81,8 @@ export class SearchBox extends React.Component { let query = this._searchString; let results: Doc[]; + console.log(query) + //if this._wordstatus is false, all words are required and a + is added before each if (!this._wordStatus) { let oldWords = query.split(" "); @@ -102,6 +104,8 @@ export class SearchBox extends React.Component { results = await this.getResults(query); } + console.log(results) + runInAction(() => { this._resultsOpen = true; this._results = results; @@ -126,6 +130,7 @@ export class SearchBox extends React.Component { docs.push(field); } } + console.log(docs) return this.filterDocs(docs); } diff --git a/src/client/views/search/minus.svg b/src/client/views/search/minus.svg deleted file mode 100644 index 63cd809f6..000000000 --- a/src/client/views/search/minus.svg +++ /dev/null @@ -1,5 +0,0 @@ -Created by Manaqib Sfrom the Noun Project \ No newline at end of file diff --git a/src/client/views/search/plus.svg b/src/client/views/search/plus.svg deleted file mode 100644 index deb855637..000000000 --- a/src/client/views/search/plus.svg +++ /dev/null @@ -1,5 +0,0 @@ -Created by mohkamilfrom the Noun Project \ No newline at end of file -- cgit v1.2.3-70-g09d2