From 534877a9d75f828c50c37dc43a0555c307444709 Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Tue, 11 May 2021 20:35:04 -0400
Subject: filters applied indicator

---
 .../collectionFreeForm/CollectionFreeFormView.tsx        | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index a14ba036f..6b5b67bd8 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -48,6 +48,7 @@ import { CollectionFreeFormRemoteCursors } from "./CollectionFreeFormRemoteCurso
 import "./CollectionFreeFormView.scss";
 import { MarqueeView } from "./MarqueeView";
 import React = require("react");
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 
 export const panZoomSchema = createSchema({
     _panX: "number",
@@ -833,10 +834,10 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
             const measuredDocs = docs.filter(doc => doc && this.childDataProvider(doc, "")).map(doc => this.childDataProvider(doc, ""));
             if (measuredDocs.length) {
                 const ranges = measuredDocs.reduce(({ xrange, yrange }, { x, y, width, height }) =>  // computes range of content
-                    ({
-                        xrange: { min: Math.min(xrange.min, x), max: Math.max(xrange.max, x + width) },
-                        yrange: { min: Math.min(yrange.min, y), max: Math.max(yrange.max, y + height) }
-                    })
+                ({
+                    xrange: { min: Math.min(xrange.min, x), max: Math.max(xrange.max, x + width) },
+                    yrange: { min: Math.min(yrange.min, y), max: Math.max(yrange.max, y + height) }
+                })
                     , {
                         xrange: { min: Number.MAX_VALUE, max: -Number.MAX_VALUE },
                         yrange: { min: Number.MAX_VALUE, max: -Number.MAX_VALUE }
@@ -1494,6 +1495,13 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
                 this.placeholder : this.marqueeView}
             {this.props.noOverlay ? (null) : <CollectionFreeFormOverlayView elements={this.elementFunc} />}
 
+            {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length ?
+                <FontAwesomeIcon icon={"filter"} size="lg"
+                    style={{ position: 'absolute', top: 5, right: 5, cursor: "pointer", padding: 1, color: '#18c718bd' }}
+                    onPointerDown={e => { /** open filters? */ e.stopPropagation(); }}
+                />
+                : (null)}
+
             <div className={"pullpane-indicator"}
                 style={{
                     display: this._pullDirection ? "block" : "none",
-- 
cgit v1.2.3-70-g09d2


From cdb61a7a83dd6f6573c4667ce85fd1f613ce2f0a Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Tue, 11 May 2021 21:10:37 -0400
Subject: expand propertiesview on icon click

---
 .../views/collections/collectionFreeForm/CollectionFreeFormView.tsx     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 6b5b67bd8..870b0f79d 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1498,7 +1498,7 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
             {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length ?
                 <FontAwesomeIcon icon={"filter"} size="lg"
                     style={{ position: 'absolute', top: 5, right: 5, cursor: "pointer", padding: 1, color: '#18c718bd' }}
-                    onPointerDown={e => { /** open filters? */ e.stopPropagation(); }}
+                    onPointerDown={e => { runInAction(() => CurrentUserUtils.propertiesWidth = 250); e.stopPropagation(); }}
                 />
                 : (null)}
 
-- 
cgit v1.2.3-70-g09d2


From c39a9b24345a77fc738d33b7c112296fd1f4279d Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Tue, 11 May 2021 21:22:23 -0400
Subject: icon displays for freeform, need to find position for the rest

---
 .../views/collections/collectionFreeForm/CollectionFreeFormView.tsx     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 870b0f79d..9bc764aca 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1495,7 +1495,7 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
                 this.placeholder : this.marqueeView}
             {this.props.noOverlay ? (null) : <CollectionFreeFormOverlayView elements={this.elementFunc} />}
 
-            {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length ?
+            {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docRangeFilters).length ?
                 <FontAwesomeIcon icon={"filter"} size="lg"
                     style={{ position: 'absolute', top: 5, right: 5, cursor: "pointer", padding: 1, color: '#18c718bd' }}
                     onPointerDown={e => { runInAction(() => CurrentUserUtils.propertiesWidth = 250); e.stopPropagation(); }}
-- 
cgit v1.2.3-70-g09d2


From 1e2e9feb78d9ea8c061c0141a5fd44ecb9f7fe1a Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Thu, 13 May 2021 01:34:35 -0400
Subject: filter icon shows up for all collections

---
 .../collections/collectionFreeForm/CollectionFreeFormView.tsx     | 6 ------
 src/client/views/nodes/DocumentView.tsx                           | 8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 9bc764aca..0f9dbe23b 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1495,12 +1495,6 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
                 this.placeholder : this.marqueeView}
             {this.props.noOverlay ? (null) : <CollectionFreeFormOverlayView elements={this.elementFunc} />}
 
-            {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docRangeFilters).length ?
-                <FontAwesomeIcon icon={"filter"} size="lg"
-                    style={{ position: 'absolute', top: 5, right: 5, cursor: "pointer", padding: 1, color: '#18c718bd' }}
-                    onPointerDown={e => { runInAction(() => CurrentUserUtils.propertiesWidth = 250); e.stopPropagation(); }}
-                />
-                : (null)}
 
             <div className={"pullpane-indicator"}
                 style={{
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 7ec9f5f74..f4a5c7e96 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -1136,6 +1136,9 @@ export class DocumentView extends React.Component<DocumentViewProps> {
         !this.props.dontRegisterView && DocumentManager.Instance.RemoveView(this);
     }
 
+    @computed get showFilterIcon() {
+        return this.props.Document.type === DocumentType.COL && !Doc.IsSystem(this.props.Document) && (StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docFilters).length || StrListCast(CurrentUserUtils.ActiveDashboard._docRangeFilters).length);
+    }
     render() {
         TraceMobx();
         const xshift = () => (this.props.Document.isInkMask ? InkingStroke.MaskDim : Math.abs(this.Xshift) <= 0.001 ? this.props.PanelWidth() : undefined);
@@ -1164,6 +1167,11 @@ export class DocumentView extends React.Component<DocumentViewProps> {
                         focus={this.props.focus || emptyFunction}
                         bringToFront={emptyFunction}
                         ref={action((r: DocumentViewInternal | null) => this.docView = r)} />
+                    {this.showFilterIcon ?
+                        <FontAwesomeIcon icon={"filter"} size="lg"
+                            style={{ position: 'absolute', top: '1%', right: '1%', cursor: "pointer", padding: 1, color: '#18c718bd' }}
+                        />
+                        : (null)}
                 </div>)}
         </div>);
     }
-- 
cgit v1.2.3-70-g09d2

