diff options
-rw-r--r-- | src/client/documents/Documents.ts | 6 | ||||
-rw-r--r-- | src/client/views/search/CheckBox.scss | 10 | ||||
-rw-r--r-- | src/client/views/search/CollectionFilters.tsx | 12 | ||||
-rw-r--r-- | src/client/views/search/SearchBox.tsx | 30 | ||||
-rw-r--r-- | src/client/views/search/ToggleBar.tsx | 4 |
5 files changed, 25 insertions, 37 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 1d137b9ff..2ace6a4cc 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -88,7 +88,7 @@ export namespace DocUtils { let protoTarg = target.proto ? target.proto : target; UndoManager.RunInBatch(() => { let linkDoc = Docs.TextDocument({ width: 100, height: 30, borderRounding: -1}); - // linkDoc.type = DocTypes.LINK; + linkDoc.type = DocTypes.LINK; let linkDocProto = Doc.GetProto(linkDoc); linkDocProto.title = title === "" ? source.title + " to " + target.title : title; linkDocProto.linkDescription = description; @@ -179,12 +179,12 @@ export namespace Docs { } function CreateTextPrototype(): Doc { let textProto = setupPrototypeOptions(textProtoId, "TEXT_PROTO", FormattedTextBox.LayoutString(), - { x: 0, y: 0, width: 300, backgroundColor: "#f1efeb" }); + { x: 0, y: 0, width: 300, backgroundColor: "#f1efeb", type: DocTypes.TEXT }); return textProto; } function CreatePdfPrototype(): Doc { let pdfProto = setupPrototypeOptions(pdfProtoId, "PDF_PROTO", CollectionPDFView.LayoutString("annotations"), - { x: 0, y: 0, width: 300, height: 300, backgroundLayout: PDFBox.LayoutString(), curPage: 1 }); + { x: 0, y: 0, width: 300, height: 300, backgroundLayout: PDFBox.LayoutString(), curPage: 1, type: DocTypes.PDF }); return pdfProto; } function CreateWebPrototype(): Doc { diff --git a/src/client/views/search/CheckBox.scss b/src/client/views/search/CheckBox.scss index 9b0af68d5..e8e7708f4 100644 --- a/src/client/views/search/CheckBox.scss +++ b/src/client/views/search/CheckBox.scss @@ -9,7 +9,7 @@ display: flex; position: relative; justify-content: center; - align-items: center; + align-items: center; margin-top: 0px; } @@ -24,12 +24,12 @@ border-color: $alt-accent; border-width: 2px; -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; + -moz-transition: all 0.2s ease-in-out; + -o-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; } - .check-container:hover ~ .check-box { + .check-container:hover~.check-box { background-color: $intermediate-color; } diff --git a/src/client/views/search/CollectionFilters.tsx b/src/client/views/search/CollectionFilters.tsx index 6019154a6..58b46ca29 100644 --- a/src/client/views/search/CollectionFilters.tsx +++ b/src/client/views/search/CollectionFilters.tsx @@ -8,6 +8,8 @@ import "./SearchBox.scss"; import "./CollectionFilters.scss"; import { FieldFilters } from './FieldFilters'; import * as anime from 'animejs'; +import { DocumentView } from '../nodes/DocumentView'; +import { SelectionManager } from '../../util/SelectionManager'; interface CollectionFilterProps { collectionStatus: boolean; @@ -48,7 +50,7 @@ export class CollectionFilters extends React.Component<CollectionFilterProps> { opacity: 1, }); - if(this.collectionsSelected){ + if (this.collectionsSelected) { this.timeline.play(); this.timeline.reverse(); } @@ -61,10 +63,10 @@ export class CollectionFilters extends React.Component<CollectionFilterProps> { updateColStat(val: boolean) { this.props.updateCollectionStatus(val); - if (this.collectionsSelected !== val) { - this.timeline.play(); - this.timeline.reverse(); - } + if (this.collectionsSelected !== val) { + this.timeline.play(); + this.timeline.reverse(); + } this.collectionsSelected = val; } diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx index e8b5f35da..30bd0c3d9 100644 --- a/src/client/views/search/SearchBox.tsx +++ b/src/client/views/search/SearchBox.tsx @@ -71,25 +71,6 @@ export class SearchBox extends React.Component { this.closeSearch(); } }); - - //empties search query after 30 seconds of the search bar/filter box not being open - // if (!this._resultsOpen && !this._filterOpen) { - // setTimeout(this.clearSearchQuery, 30000); - // } - } - - closeFilterVisual() { - $('document').ready(function () { - var form = document.getElementById("filter-form"); - - if(form){ - if(form.style.maxHeight) { - form.style.maxHeight = null; - form.style - } - - } - }); } setupAccordion() { @@ -227,11 +208,9 @@ export class SearchBox extends React.Component { else { selectedDocs.forEach(async element => { let layout: string = StrCast(element.props.Document.baseLayout); - // console.log("doc title:", element.props.Document.title) //checks if selected view (element) is a collection. if it is, adds to list to search through if (layout.indexOf("Collection") > -1) { console.log("current doc is a collection") - // console.log(element.props.Document) //makes sure collections aren't added more than once if (!collections.includes(element.props.Document)) { collections.push(element.props.Document); @@ -262,7 +241,6 @@ export class SearchBox extends React.Component { //if this._wordstatus is false, all words are required and a + is added before each if (!this._basicWordStatus) { query = this.basicRequireWords(query); - console.log(query) query = query.replace(/\s+/g, ' ').trim(); } @@ -271,6 +249,7 @@ export class SearchBox extends React.Component { query = this.addCollectionFilter(query); query = query.replace(/\s+/g, ' ').trim(); } + console.log(query) return query; } @@ -297,6 +276,7 @@ export class SearchBox extends React.Component { let results: Doc[]; query = this.getFinalQuery(query); + console.log(query) //if there is no query there should be no result if (query === "") { @@ -307,6 +287,8 @@ export class SearchBox extends React.Component { results = await this.getResults(query); } + console.log(results); + runInAction(() => { this._resultsOpen = true; this._results = results; @@ -330,14 +312,18 @@ export class SearchBox extends React.Component { docs.push(field); } } + console.log(docs) return this.filterDocsByType(docs); } //this.icons will now include all the icons that need to be included @action filterDocsByType(docs: Doc[]) { + console.log(this._icons) let finalDocs: Doc[] = []; docs.forEach(doc => { + console.log(doc.layout) let layoutresult = Cast(doc.type, "string", ""); + console.log(layoutresult) if (this._icons.includes(layoutresult)) { finalDocs.push(doc); } diff --git a/src/client/views/search/ToggleBar.tsx b/src/client/views/search/ToggleBar.tsx index b0a061270..96536794d 100644 --- a/src/client/views/search/ToggleBar.tsx +++ b/src/client/views/search/ToggleBar.tsx @@ -100,8 +100,8 @@ export class ToggleBar extends React.Component<ToggleBarProps>{ <div className="toggle-option" style={{ opacity: (this.props.getStatus() ? 1 : .4) }}>{this.props.optionOne}</div> <div className="toggle-option" style={{ opacity: (this.props.getStatus() ? .4 : 1) }}>{this.props.optionTwo}</div> </div> - <div className="toggle-bar" id="toggle-bar" style={{ flexDirection: (this._originalStatus ? "row" : "row-reverse") }}> - <div className="toggle-button" id="toggle-button" ref={this._toggleButton} onClick={this.onclick} /> + <div className="toggle-bar" id="toggle-bar" onClick={this.onclick} style={{ flexDirection: (this._originalStatus ? "row" : "row-reverse") }}> + <div className="toggle-button" id="toggle-button" ref={this._toggleButton} /> </div> </div> ); |