From c99238c8b1e027099b2cd3f4b31b4c0b06d488d0 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 29 Jun 2023 14:59:29 -0400
Subject: made recording annotation undoable.  fixed doc filters for dates,
 change filter to use :: instead of :

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

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

diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index fe42628cd..a5c18cd8b 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -71,7 +71,7 @@ export class FilterPanel extends React.Component<filterProps> {
      * @returns a string array of the current attributes
      */
     @computed get currentFacets() {
-        return this.activeFilters.map(filter => filter.split(':')[0]);
+        return this.activeFilters.map(filter => filter.split(Doc.FilterSep)[0]);
     }
 
     gatherFieldValues(childDocs: Doc[], facetKey: string) {
@@ -108,8 +108,8 @@ export class FilterPanel extends React.Component<filterProps> {
     @observable _chosenFacets = new ObservableMap<string, 'text' | 'checkbox' | 'slider' | 'range'>();
     @computed get activeFacets() {
         const facets = new Map<string, 'text' | 'checkbox' | 'slider' | 'range'>(this._chosenFacets);
-        StrListCast(this.targetDoc?._childFilters).map(filter => facets.set(filter.split(':')[0], filter.split(':')[2] === 'match' ? 'text' : 'checkbox'));
-        setTimeout(() => StrListCast(this.targetDoc?._childFilters).map(action(filter => this._chosenFacets.set(filter.split(':')[0], filter.split(':')[2] === 'match' ? 'text' : 'checkbox'))));
+        StrListCast(this.targetDoc?._childFilters).map(filter => facets.set(filter.split(Doc.FilterSep)[0], filter.split(Doc.FilterSep)[2] === 'match' ? 'text' : 'checkbox'));
+        setTimeout(() => StrListCast(this.targetDoc?._childFilters).map(action(filter => this._chosenFacets.set(filter.split(Doc.FilterSep)[0], filter.split(Doc.FilterSep)[2] === 'match' ? 'text' : 'checkbox'))));
         return facets;
     }
     /**
@@ -203,8 +203,8 @@ export class FilterPanel extends React.Component<filterProps> {
                     <input
                         placeholder={
                             StrListCast(this.targetDoc._childFilters)
-                                .find(filter => filter.split(':')[0] === facetHeader)
-                                ?.split(':')[1] ?? '-empty-'
+                                .find(filter => filter.split(Doc.FilterSep)[0] === facetHeader)
+                                ?.split(Doc.FilterSep)[1] ?? '-empty-'
                         }
                         onBlur={undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, e.currentTarget.value, !e.currentTarget.value ? 'remove' : 'match'), 'set text filter')}
                         onKeyDown={e => e.key === 'Enter' && undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, e.currentTarget.value, !e.currentTarget.value ? 'remove' : 'match'), 'set text filter')(e)}
@@ -219,8 +219,8 @@ export class FilterPanel extends React.Component<filterProps> {
                                 style={{ width: 20, marginLeft: 20 }}
                                 checked={
                                     StrListCast(this.targetDoc._childFilters)
-                                        .find(filter => filter.split(':')[0] === facetHeader && filter.split(':')[1] == facetValue)
-                                        ?.split(':')[2] === 'check'
+                                        .find(filter => filter.split(Doc.FilterSep)[0] === facetHeader && filter.split(Doc.FilterSep)[1] == facetValue)
+                                        ?.split(Doc.FilterSep)[2] === 'check'
                                 }
                                 type={type}
                                 onChange={undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, fval, e.target.checked ? 'check' : 'remove'), 'set filter')}
-- 
cgit v1.2.3-70-g09d2

