From de253f5acca34f20017895a2d8469b5ebd6032bf Mon Sep 17 00:00:00 2001
From: aidahosa1 <aisosa_idahosa@brown.edu>
Date: Tue, 30 Jul 2024 14:31:00 -0400
Subject: fight w css

---
 src/client/views/FilterPanel.tsx | 95 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)

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

diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index 5db627d23..332a89a96 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -19,6 +19,16 @@ import './FilterPanel.scss';
 import { DocumentView } from './nodes/DocumentView';
 import { Handle, Tick, TooltipRail, Track } from './nodes/SliderBox-components';
 import { ObservableReactComponent } from './ObservableReactComponent';
+import { Button } from '../util/CurrentUserUtils';
+import { ButtonType } from './nodes/FontIconBox/FontIconBox';
+import { DocCast } from '../../fields/Types';
+// import { Docs } from '../../documents/Documents';
+import { Docs } from '../documents/Documents';
+import { CurrentUserUtils } from '../util/CurrentUserUtils';
+import { DocumentOptions } from '../documents/Documents';
+import { DocUtils } from '../documents/DocUtils';
+import { dropActionType } from '../util/DropActionTypes';
+
 
 interface filterProps {
     Document: Doc;
@@ -217,6 +227,83 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
         return nonNumbers / facetValues.length > 0.1 ? facetValues.sort() : facetValues.sort((n1: string, n2: string) => Number(n1) - Number(n2));
     };
 
+    addHotkey() {
+
+        const buttons = DocCast(Doc.UserDoc().myContextMenuBtns);
+        const filter = buttons['Filter']
+        const filter2 = DocCast(filter)
+        const but2 = Doc.UserDoc().myContextMenuBtns
+
+        // const newCol = Docs.Create.CarouselDocument(DocListCast(doc[Doc.LayoutFieldKey(doc)]), {
+        //     _width: 250,
+        //     _height: 200,
+        //     _layout_fitWidth: false,
+        //     _layout_autoHeight: true,
+        // });
+
+        // CurrentUserUtils.setupContextMenuButtons()
+
+        // const hm = Docs.Create.FontIconDocument()
+
+        // DocumentView.getDocumentView(filter2)?.ComponentView?.addDocument?.(hm)
+
+        // console.log(DocumentView.getDocumentView(filter2) + "hiiiii")
+
+        // DocumentView.getDocumentView(DocCast(buttons['Card']))?.ComponentView?.addDocument?.(hm)
+
+        const hi = CurrentUserUtils.contextMenuTools()
+
+        const newKey: Button = { title: "Cloud", icon: "cloud", toolTip:"Click to toggle the cloud group's visibility",  btnType: ButtonType.ToggleButton,  expertMode: false, toolType:"cloud", funcs: {}, scripts: { onClick: '{ return handleTags(this.toolType, _readOnly_);}'}}
+
+
+        const heyy = [...hi, newKey]
+
+        Doc.UserDoc().myFilterHotKeyIcons = "palette"
+        Doc.UserDoc().myFilterHotKeyTitles = "hi"
+
+        CurrentUserUtils.setupContextMenuButtons(Doc.UserDoc());
+
+
+
+        Doc.UserDoc().hi = Docs.Create.FontIconDocument(
+           { title: '',
+                icon: 'map-pin',
+            
+                backgroundColor: '#ACCEF7',
+                layout_hideAllLinks: true,
+                _width: 15,
+                _height: 15,
+                _xPadding: 0,
+   }
+        )
+
+
+        // buttons['Filter']
+
+
+
+
+        const reqdCtxtOpts:DocumentOptions = { title: "hi", undoIgnoreFields:new List<string>(['width', "linearView_IsOpen"]), flexGap: 0, childDragAction: dropActionType.embed, childDontRegisterViews: true,  linearView_IsOpen: true, ignoreClick: true, linearView_Expandable: false, _height: 35 };
+        const ctxtMenuBtns =  CurrentUserUtils.setupContextMenuBtn(newKey, buttons);
+        // DocUtils.AssignOpts(buttons, reqdCtxtOpts, ctxtMenuBtns);
+
+
+        DocUtils.AssignOpts(DocCast(buttons['Filter']), reqdCtxtOpts, [ctxtMenuBtns]);
+
+
+        // newCol && dv.ComponentView?.addDocument?.(newCol);
+
+        // console.log(but2 + "omgg")
+
+
+
+        // doc.cardSort_activeIcons = new List<string>(list.includes(icon) ? list.filter(d => d !== icon) : [...list, icon]);
+
+
+
+        // Doc.UserDoc().myContextMenuBtns = new List<Doc>([...buttons, newKey as Doc])
+    }
+
     render() {
         return (
             <div className="filterBox-treeView">
@@ -283,6 +370,14 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
                         )
                     )}
                 </div>
+                <div>
+                    <div className="filterBox-select">
+                        <div style={{ width: '100%' }}>
+                            <FieldsDropdown Document={this.Document} selectFunc={this.addHotkey} showPlaceholder placeholder="add a hotkey" addedFields={['acl_Guest', LinkedTo, 'Star', 'Heart', 'Bolt', 'Cloud']} />
+                        </div>
+                    </div>
+
+                </div>
             </div>
         );
     }
-- 
cgit v1.2.3-70-g09d2

