From f847b894e79a0914ea2864f07ece92ac90eab1de Mon Sep 17 00:00:00 2001
From: eperelm2 <emily_perelman@brown.edu>
Date: Thu, 20 Jul 2023 13:10:01 -0400
Subject: filter - still working on closing

---
 src/client/views/FilterPanel.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/client/views/FilterPanel.tsx')

diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index 416843f14..da00ae255 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -110,6 +110,7 @@ export class FilterPanel extends React.Component<filterProps> {
 
     @observable _chosenFacets = new ObservableMap<string, 'text' | 'checkbox' | 'slider' | 'range'>();
     @observable _chosenFacetsCollapse = new ObservableMap<string, boolean>();
+    // @observable _currentFilters: string[] ; -- instatitae array to store the currently selected filters (Ex: #food ). remove these filters when removing 
 
     @computed get activeFacets() {
         console.log("chosen collpase " + this._chosenFacetsCollapse)
@@ -214,7 +215,9 @@ export class FilterPanel extends React.Component<filterProps> {
                                         // delete this.activeFacets[facetHeader];
                                          this.activeFacets.delete(facetHeader)
                                          this._chosenFacets.delete(facetHeader)
-                                         //console.log("TRYING SOMETHING NEW " + e.target.checked)
+                                        //  console.log("TRYING SOMETHING NEW " + e.target.checked)
+                                        
+                                        // check if the current values are apart of the this.facetValues(facetHeader).map(fval ... 
                                          
                                         }
                                         )
@@ -236,7 +239,6 @@ export class FilterPanel extends React.Component<filterProps> {
     }
 
     private displayFacetValueFilterUIs(type: string | undefined, facetHeader: string): React.ReactNode {
-        console.log("im here")
         switch (type) {
             case 'text':
                 return (
@@ -252,6 +254,7 @@ export class FilterPanel extends React.Component<filterProps> {
                 );
             case 'checkbox':
                 // console.log("checking")
+           
                 return this.facetValues(facetHeader).map(fval => {
                     const facetValue = fval;
                     return (
@@ -266,7 +269,7 @@ export class FilterPanel extends React.Component<filterProps> {
                                 type={type}
                                 onChange={undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, fval, e.target.checked ? 'check' : 'remove'), 'set filter')}
                                 onClick={undoable (e => 
-                                    console.log("boolean value with " + facetValue + ":" + e.target.checked), 'set filter'
+                                    e.target.checked ? this._currentFilters.push(fval) :  , 'set filter'
                                 ) }
                             />
                             {facetValue}
-- 
cgit v1.2.3-70-g09d2

