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 ++++++++++++---- src/client/views/nodes/FilterBox.tsx | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'src') 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 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} + {StrListCast(this.props.Document._docFilters).length || StrListCast(this.props.Document._docRangeFilters).length ? + { /** open filters? */ e.stopPropagation(); }} + /> + : (null)} +
{ - const targetDoc = FilterBox.targetDoc; + const { targetDoc } = FilterBox; const found = this.activeAttributes.findIndex(doc => doc.title === facetHeader); if (found !== -1) { this.removeFilter(facetHeader); } else { - const allCollectionDocs = DocListCast((targetDoc.data as any)[0].data); + const allCollectionDocs = DocListCast((targetDoc.data as any)?.[0].data); const facetValues = this.gatherFieldValues(targetDoc, facetHeader); let nonNumbers = 0; -- cgit v1.2.3-70-g09d2