From 4574b7f03ccc85c4bebdbfd9475788456086704f Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 8 Aug 2024 12:27:40 -0400
Subject: many changes to add typing in place of 'any's etc

---
 src/client/views/FilterPanel.tsx | 12 +++++-------
 1 file changed, 5 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 c97edd7f0..b11fa3bd5 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -1,6 +1,4 @@
 /* eslint-disable react/jsx-props-no-spreading */
-/* eslint-disable jsx-a11y/no-static-element-interactions */
-/* eslint-disable jsx-a11y/click-events-have-key-events */
 import { action, computed, makeObservable, observable, ObservableMap } from 'mobx';
 import { observer } from 'mobx-react';
 import * as React from 'react';
@@ -28,7 +26,7 @@ interface filterProps {
 export class FilterPanel extends ObservableReactComponent<filterProps> {
     @observable _selectedFacetHeaders = new Set<string>();
 
-    constructor(props: any) {
+    constructor(props: filterProps) {
         super(props);
         makeObservable(this);
     }
@@ -41,7 +39,7 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
     }
     @computed get targetDocChildKey() {
         const targetView = DocumentView.getFirstDocumentView(this.Document);
-        return targetView?.ComponentView?.annotationKey ?? targetView?.ComponentView?.fieldKey ?? 'data';
+        return targetView?.ComponentView?.annotationKey || (targetView?.ComponentView?.fieldKey ?? 'data');
     }
     @computed get targetDocChildren() {
         return [...DocListCast(this.Document?.[this.targetDocChildKey] || Doc.ActiveDashboard?.data), ...DocListCast(this.Document[Doc.LayoutFieldKey(this.Document) + '_sidebar'])];
@@ -240,7 +238,7 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
                     {Array.from(this.activeRenderedFacetInfos.keys()).map(
                         // iterate over activeFacetRenderInfos  ==> renderInfo  which you can renderInfo.facetHeader
                         renderInfo => (
-                            <div>
+                            <div key={renderInfo.facetHeader}>
                                 <div className="filterBox-facetHeader">
                                     <div className="filterBox-facetHeader-Header"> </div>
                                     {renderInfo.facetHeader.charAt(0).toUpperCase() + renderInfo.facetHeader.slice(1)}
@@ -308,7 +306,7 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
                 return this.facetValues(facetHeader).map(fval => {
                     const facetValue = fval;
                     return (
-                        <div>
+                        <div key={facetValue}>
                             <input
                                 style={{ width: 20, marginLeft: 20 }}
                                 checked={['check', 'exists'].includes(
@@ -343,7 +341,7 @@ export class FilterPanel extends ObservableReactComponent<filterProps> {
                                             <div className="slider-handles">
                                                 {handles.map(handle => (
                                                     // const value = i === 0 ? defaultValues[0] : defaultValues[1];
-                                                    <div>
+                                                    <div key={handle.id}>
                                                         <Handle key={handle.id} handle={handle} domain={domain} isActive={handle.id === activeHandleID} getHandleProps={getHandleProps} />
                                                     </div>
                                                 ))}
-- 
cgit v1.2.3-70-g09d2

