diff --git a/app/client/src/components/shared/LocationSearch.js b/app/client/src/components/shared/LocationSearch.js index 2d0d0aac9..d2f134c12 100644 --- a/app/client/src/components/shared/LocationSearch.js +++ b/app/client/src/components/shared/LocationSearch.js @@ -986,7 +986,7 @@ function LocationSearch({ route, label }: Props) { role="menuitem" className={`esri-search__source esri-menu__list-item ${secondClass}`} tabIndex="-1" - key={`source-key-${sourceIndex}`} + key={`source-key-${source.name}`} onClick={handleSourceSelect} onKeyDown={handleSourceSelect} > @@ -1049,7 +1049,7 @@ function LocationSearch({ route, label }: Props) { role="menu" data-node-ref="_suggestionListNode" > - {filteredSuggestions.map((source, suggestIndex) => { + {filteredSuggestions.map((source) => { function findGroupName() { if ( source.source.name === 'ArcGIS World Geocoding Service' @@ -1085,7 +1085,7 @@ function LocationSearch({ route, label }: Props) { const title = findGroupName(); return ( ) { const { widgetLayers } = useAddSaveDataWidgetState(); const { basemap, highlightOptions, homeWidget, mapView, setMapView } = useContext(LocationSearchContext); @@ -104,7 +108,7 @@ function Map({ children, layers = null, startingExtent = null }: Props) { view={mapView} layers={layers} /> - + )} @@ -125,7 +129,7 @@ export function MapContainer(props: Props) { ); } -export default function MapWrapper(props: Props) { +export default function MapWrapper(props: Readonly) { return ( diff --git a/app/client/src/components/shared/MapMouseEvents.tsx b/app/client/src/components/shared/MapMouseEvents.tsx index 738901bdb..5b46e4d79 100644 --- a/app/client/src/components/shared/MapMouseEvents.tsx +++ b/app/client/src/components/shared/MapMouseEvents.tsx @@ -12,8 +12,6 @@ import { useMapHighlightState } from 'contexts/MapHighlight'; import { useLayers } from 'contexts/Layers'; import { LocationSearchContext } from 'contexts/locationSearch'; import { useServicesContext } from 'contexts/LookupFiles'; -// config -import { getPopupContent, graphicComparison } from 'utils/mapFunctions'; // types import type { MonitoringFeatureUpdate, @@ -21,7 +19,11 @@ import type { WatershedAttributes, } from 'types'; // utils -import { isInScale } from 'utils/mapFunctions'; +import { + getPopupContent, + graphicComparison, + isInScale, +} from 'utils/mapFunctions'; // --- types --- interface ClickEvent { @@ -200,8 +202,6 @@ function updateGraphics( // --- components --- type Props = { - // map and view props auto passed from parent Map component by react-arcgis - map: any; view: any; }; diff --git a/app/client/src/components/shared/MapWidgets.tsx b/app/client/src/components/shared/MapWidgets.tsx index 237e82b70..df0d1facd 100644 --- a/app/client/src/components/shared/MapWidgets.tsx +++ b/app/client/src/components/shared/MapWidgets.tsx @@ -368,7 +368,7 @@ function MapWidgets({ view, layers, onHomeWidgetRendered = () => {}, -}: Props) { +}: Readonly) { const { addSaveDataWidgetVisible, setActiveTabIndex, @@ -1278,10 +1278,10 @@ function MapWidgets({ function ShowAddSaveDataWidget({ addSaveDataWidgetVisible, setAddSaveDataWidgetVisible, -}: { +}: Readonly<{ addSaveDataWidgetVisible: boolean; setAddSaveDataWidgetVisible: Dispatch>; -}) { +}>) { const [hover, setHover] = useState(false); const clickHandler = useCallback( @@ -1353,7 +1353,7 @@ function ExpandCollapse({ fullscreenActive, setFullscreenActive, mapViewSetter, -}: ExpandeCollapseProps) { +}: Readonly) { const [hover, setHover] = useState(false); const clickHandler = useCallback( @@ -1586,7 +1586,7 @@ function ShowUpstreamWatershed({ selectionActive = false, upstreamLayer, upstreamLoading, -}: ShowUpstreamWatershedProps) { +}: Readonly) { const [hover, setHover] = useState(false); const upstreamWidgetDisabled = getUpstreamWidgetDisabled(); @@ -2879,7 +2879,7 @@ type DownloadWidgetProps = { view: __esri.MapView; }; -function DownloadWidget({ services, view }: DownloadWidgetProps) { +function DownloadWidget({ services, view }: Readonly) { const layoutOptions: LayoutOptionType[] = [ { value: 'a3-landscape', diff --git a/app/client/src/components/shared/Modal.tsx b/app/client/src/components/shared/Modal.tsx index c14c03ce3..89d7de064 100644 --- a/app/client/src/components/shared/Modal.tsx +++ b/app/client/src/components/shared/Modal.tsx @@ -158,7 +158,7 @@ export default function Modal({ onClose = () => {}, onConfirm = () => {}, triggerElm, -}: Props) { +}: Readonly) { const [dialogShown, setDialogShown] = useState(false); const close = () => { @@ -240,7 +240,7 @@ export function DisclaimerModal({ children, infoIcon = false, ...props -}: DisclaimerProps) { +}: Readonly) { return ( event.stopPropagation()} onChange={ (event) => setFilter(event.target.value || undefined) // Set undefined to remove the filter entirely diff --git a/app/client/src/components/shared/Sparkline.tsx b/app/client/src/components/shared/Sparkline.tsx index 5fc5f868d..fcc3e31a0 100644 --- a/app/client/src/components/shared/Sparkline.tsx +++ b/app/client/src/components/shared/Sparkline.tsx @@ -40,7 +40,7 @@ const accessors = { yAccessor: (d: Observation) => d.measurement, }; -export function Sparkline({ data }: { data: Observation[] }) { +export function Sparkline({ data }: Readonly<{ data: Observation[] }>) { const color = '#ffc107'; const values = data.map((d) => d.measurement); return (