From 56394d6631f494526546cb5cd03297b400a85e65 Mon Sep 17 00:00:00 2001
From: Monika <monika_hedman@brown.edu>
Date: Mon, 24 Jun 2019 16:07:38 -0400
Subject: clean ups

---
 src/client/views/search/SearchBox.tsx | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

(limited to 'src/client/views/search/SearchBox.tsx')

diff --git a/src/client/views/search/SearchBox.tsx b/src/client/views/search/SearchBox.tsx
index 30bd0c3d9..28bcadc6b 100644
--- a/src/client/views/search/SearchBox.tsx
+++ b/src/client/views/search/SearchBox.tsx
@@ -194,23 +194,17 @@ export class SearchBox extends React.Component {
 
     get fieldFiltersApplied() { return !(this.dataFieldStatus && this.authorFieldStatus && this.titleFieldStatus); }
 
+    //TODO: basically all of this
     //gets all of the collections of all the docviews that are selected
     //if a collection is the only thing selected, search only in that collection (not its container)
     getCurCollections(): Doc[] {
         let selectedDocs: DocumentView[] = SelectionManager.SelectedDocuments();
         let collections: Doc[] = [];
 
-        //TODO: make this some sort of error
-        if (selectedDocs.length === 0) {
-            console.log("there is nothing selected!")
-        }
-        //also searches in a collection if it is selected
-        else {
             selectedDocs.forEach(async element => {
                 let layout: string = StrCast(element.props.Document.baseLayout);
                 //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")
                     //makes sure collections aren't added more than once
                     if (!collections.includes(element.props.Document)) {
                         collections.push(element.props.Document);
@@ -223,7 +217,6 @@ export class SearchBox extends React.Component {
                     collections.push(containingView.props.Document);
                 }
             });
-        }
 
         return collections;
     }
@@ -249,7 +242,6 @@ export class SearchBox extends React.Component {
             query = this.addCollectionFilter(query);
             query = query.replace(/\s+/g, ' ').trim();
         }
-        console.log(query)
         return query;
     }
 
@@ -276,7 +268,6 @@ 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 === "") {
@@ -287,8 +278,6 @@ export class SearchBox extends React.Component {
             results = await this.getResults(query);
         }
 
-        console.log(results);
-
         runInAction(() => {
             this._resultsOpen = true;
             this._results = results;
@@ -312,18 +301,14 @@ 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);
             }
-- 
cgit v1.2.3-70-g09d2

