From 3a1dac48c00dbe81142da90f8b52bfae02ce1921 Mon Sep 17 00:00:00 2001
From: Andy Rickert <andrew_rickert@brown.edu>
Date: Wed, 1 Apr 2020 18:11:08 -0700
Subject:  fixed backend filter and passing search query to new doc

---
 src/client/views/nodes/QueryBox.tsx | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/QueryBox.tsx')

diff --git a/src/client/views/nodes/QueryBox.tsx b/src/client/views/nodes/QueryBox.tsx
index 995effd1b..95ea3e099 100644
--- a/src/client/views/nodes/QueryBox.tsx
+++ b/src/client/views/nodes/QueryBox.tsx
@@ -3,7 +3,6 @@ import { library } from '@fortawesome/fontawesome-svg-core';
 import { faArrowLeft, faArrowRight, faEdit, faMinus, faPlay, faPlus, faStop, faTimes } from '@fortawesome/free-solid-svg-icons';
 import { IReactionDisposer, computed } from "mobx";
 import { observer } from "mobx-react";
-import { FilterBox } from "../search/FilterBox";
 import { FieldView, FieldViewProps } from './FieldView';
 import "./PresBox.scss";
 import { SearchBox } from "../search/SearchBox";
@@ -15,6 +14,7 @@ import { makeInterface, createSchema } from "../../../new_fields/Schema";
 import { documentSchema } from "../../../new_fields/documentSchemas";
 import { TraceMobx } from "../../../new_fields/util";
 import { Id } from '../../../new_fields/FieldSymbols';
+import { StrCast } from "../../../new_fields/Types";
 
 
 
@@ -51,7 +51,18 @@ export class QueryBox extends DocAnnotatableComponent<FieldViewProps, QueryDocum
 
     @computed get content() {
         let key = this.props.Document[Id];
-        return <SearchBox id={key}/>
+        let sq = StrCast(this.props.Document.sq);
+        let fq= StrCast(this.props.Document.fq);
+        if (this.props.Document.sq){
+            console.log("yes");
+            console.log(sq);
+            console.log(fq);
+            return <SearchBox id={key} sq={sq} fq={fq}/>
+        }
+        else {
+            console.log("no");
+        return <SearchBox id={key} />
+        }
     }
     contentFunc = () => [this.content];
 
-- 
cgit v1.2.3-70-g09d2

