diff --git a/src/MapDrawingTools/index.test.js b/src/MapDrawingTools/index.test.js
index a83bc8798..e7aeab9c9 100644
--- a/src/MapDrawingTools/index.test.js
+++ b/src/MapDrawingTools/index.test.js
@@ -1,10 +1,13 @@
import React from 'react';
-import { render } from '@testing-library/react';
+import { render, screen } from '@testing-library/react';
import { createMapMock } from '../__test-helpers/mocks';
import { MapContext } from '../App';
import MapDrawingTools, { DRAWING_MODES } from './';
+import { LAYER_IDS } from './MapLayers';
+
+
describe('rendering', () => {
test('rendering without crashing', () => {
let points = [];
@@ -20,57 +23,171 @@ describe('rendering', () => {
});
describe('MapDrawingTools', () => {
- let points = [];
- let drawing = false;
- let map;
+ let points, drawing, map;
beforeEach(() => {
map = createMapMock();
+ drawing = true;
});
- fit('not rendering if no point data is provided', () => {
- const { asFragment } = render(
-
-
-
- );
-
- console.log('the fragment', asFragment());
+ describe('with no point data', () => {
+ test('not rendering if no point data is provided', () => {
+ points = [];
+ drawing = true;
+
+ render(
+
+
+
+ );
+ });
});
- test('rendering when point data is received', () => {
+ describe('with point data', () => {
+ beforeEach(() => {
+ points = [[1, 2], [2, 3], [3, 4], [1, 2]];
+ });
- });
+ test('creating map layers and sources', () => {
+ render(
+
+
+
+ );
- test('firing #onChange when the map is clicked', () => {
+ expect(map.addSource).toHaveBeenCalled();
+ expect(map.addLayer).toHaveBeenCalled();
+ });
- });
+ test('firing #onChange when the map is clicked', () => {
+ const onChange = jest.fn();
- test('only firing #onChange once on double click', () => {
+ render(
+
+
+
+ );
- });
+ map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
- test('firing #onClickPoint when a drawn point is clicked', () => {
+ expect(onChange).toHaveBeenCalled();
+ });
- });
+ test('only firing #onChange once on double click', () => {
+ const onChange = jest.fn();
- test('firing #onClickLine when a drawn line is clicked', () => {
+ render(
+
+
+
+ );
- });
+ map.__test.fireHandlers('dblclick', { lngLat: { lat: [2, 3], lng: [3, 4] } });
- test('firing #onClickFill when a drawn polyon\'s fill is clicked', () => {
+ expect(onChange).toHaveBeenCalledTimes(1);
- });
+ });
- test('firing #onClickLabel when a drawn line\'s label is clicked', () => {
+ test('firing #onClickPoint when a drawn point is clicked', () => {
+ const onClickPoint = jest.fn();
- });
+ render(
+
+
+
+ );
+
+ map.__test.fireHandlers('click', LAYER_IDS.POINTS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+
+ expect(onClickPoint).toHaveBeenCalled();
+ });
+
+ test('firing #onClickLine when a drawn line is clicked', () => {
+ const onClickLine = jest.fn();
+
+ render(
+
+
+
+ );
- test('drawing a polygon when the draw mode is for polygons', () => {
+ map.__test.fireHandlers('click', LAYER_IDS.LINES, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ expect(onClickLine).toHaveBeenCalled();
+ });
+
+ test('firing #onClickFill when a drawn polyon\'s fill is clicked', () => {
+ const onClickFill = jest.fn();
+
+ render(
+
+
+
+ );
+
+ map.__test.fireHandlers('click', LAYER_IDS.FILL, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+
+ expect(onClickFill).toHaveBeenCalled();
+ });
+
+ test('firing #onClickLabel when a drawn line\'s label is clicked', () => {
+ const onClickLabel = jest.fn();
+
+ render(
+
+
+
+ );
+
+ map.__test.fireHandlers('click', LAYER_IDS.LABELS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+
+ expect(onClickLabel).toHaveBeenCalled();
+ });
+
+ test('drawing a polygon when the draw mode is for polygons', () => {
+ const onChange = jest.fn();
+
+ render(
+
+
+
+ );
+
+ map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+
+ expect(onChange).toHaveBeenCalledTimes(1);
+ console.log('the geojson', onChange.mock.calls[0][1]);
+ });
+
+ test('drawing a line when the draw mode is for lines', () => {
+ const onChange = jest.fn();
+
+ render(
+
+
+
+ );
+
+ map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+
+ expect(onChange).toHaveBeenCalledTimes(1);
+ console.log('the geojson', onChange.mock.calls[0][1]);
+ });
});
- test('drawing a line when the draw mode is for lines', () => {
+ describe('the cursor popup', () => {
+ test('rendering a cursor popup with point details when drawing and the mouse is moved', async () => {
+ render(
+
+
+
+ );
+
+ const popup = screen.findByTestId('drawing-tools-popup');
+ expect(popup).toHaveTextContent('Bearing');
+ expect(popup).toHaveTextContent('Distance');
+ expect(popup).toHaveTextContent('Click to add a point');
+ });
});
});
diff --git a/src/MapRulerControl/index.js b/src/MapRulerControl/index.js
index df6fb0fab..32cacdbaa 100644
--- a/src/MapRulerControl/index.js
+++ b/src/MapRulerControl/index.js
@@ -149,7 +149,7 @@ const MapRulerControl = (props) => {
}, [drawing, points.length]);
useEffect(() => {
- if (nextClickResetsState) {
+ if (map && nextClickResetsState) {
const onMapClickToReset = (e) => {
const isPointClick = !!map.queryRenderedFeatures(e.point, {
layers: [LAYER_IDS.POINTS],
diff --git a/src/MapRulerControl/index.test.js b/src/MapRulerControl/index.test.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/MouseMarkerLayer/index.js b/src/MouseMarkerLayer/index.js
index 6aa2cf996..d5b964227 100644
--- a/src/MouseMarkerLayer/index.js
+++ b/src/MouseMarkerLayer/index.js
@@ -1,8 +1,8 @@
-import React, { Fragment, memo } from 'react';
+import React, { memo, useMemo } from 'react';
import { point } from '@turf/helpers';
-import { Source, Layer } from 'react-mapbox-gl';
import { SYMBOL_ICON_SIZE_EXPRESSION } from '../constants';
+import { useMapLayer, useMapSource } from '../hooks';
const layout = {
'icon-image': 'marker-icon',
@@ -13,18 +13,17 @@ const layout = {
// eslint-disable-next-line no-unused-vars
const MouseMarkerLayer = ({ map, location, ...rest }) => {
- if (!location.lng || !location.lat) return null;
- const sourceData = {
- type: 'geojson',
- data: point([location.lng, location.lat]),
- };
+ const cursorPoint = useMemo(() => location?.lng ?
+ point([location.lng, location.lat])
+ : null
+ , [location.lat, location.lng]);
- return
-
-
- ;
+ useMapSource('mouse-marker-source', cursorPoint);
+ useMapLayer('mouse-marker-layer', 'symbol', 'mouse-marker-source', null, layout);
+
+ return null;
};
export default memo(MouseMarkerLayer);
\ No newline at end of file
diff --git a/src/PatrolStartStopLayer/layer.js b/src/PatrolStartStopLayer/layer.js
index 73467c96f..16e531769 100644
--- a/src/PatrolStartStopLayer/layer.js
+++ b/src/PatrolStartStopLayer/layer.js
@@ -1,8 +1,6 @@
-import React, { Fragment, memo, useEffect, useMemo, useState } from 'react';
+import React, { memo, useEffect, useMemo, useState } from 'react';
import { connect } from 'react-redux';
-import { Source, Layer } from 'react-mapbox-gl';
-
import { addMapImage } from '../utils/map';
import { calcImgIdFromUrlForMapImages } from '../utils/img';
import { createPatrolDataSelector } from '../selectors/patrols';
@@ -11,6 +9,7 @@ import { withMap } from '../EarthRangerMap';
import { uuid } from '../utils/string';
import LabeledPatrolSymbolLayer from '../LabeledPatrolSymbolLayer';
import withMapViewConfig from '../WithMapViewConfig';
+import { useMapLayer, useMapSource } from '../hooks';
const { PATROL_SYMBOLS } = LAYER_IDS;
@@ -45,6 +44,8 @@ const labelPaint = {
'text-halo-color': 'rgba(0,0,0,0.7)',
};
+const symbolFilter = ['==', ['geometry-type'], 'Point'];
+
const StartStopLayer = (props) => {
const { key, patrolData, map, ...rest } = props;
@@ -82,30 +83,23 @@ const StartStopLayer = (props) => {
].filter(val => !!val);
}, [lines, points]);
- const patrolPointsSourceData = useMemo(() => {
- return {
- type: 'geojson',
- data: {
- type: 'FeatureCollection',
- features: patrolPointFeatures,
- }
- };
- }, [patrolPointFeatures]);
+ const patrolPointsSourceData = useMemo(() => ({
+ type: 'FeatureCollection',
+ features: patrolPointFeatures,
+ }), [patrolPointFeatures]);
- if (!points && !lines) return null;
+ const layerLabelPaint = useMemo(() => ({ ...labelPaint, 'icon-color': ['get', 'stroke'] }), []);
+ const layerSymbolPaint = useMemo(() => ({ ...symbolPaint, 'text-color': ['get', 'stroke'] }), []);
+ const layerLinePaint = useMemo(() => ({ ...linePaint, 'line-color': ['get', 'stroke'] }), []);
- const layerSymbolPaint = { ...symbolPaint, 'text-color': ['get', 'stroke'] };
- const layerLabelPaint = { ...labelPaint, 'icon-color': ['get', 'stroke'] };
+ useMapSource(sourceId, patrolPointsSourceData);
+ useMapLayer(`${layerId}-lines`, 'line', sourceId, layerLinePaint, lineLayout);
- const layerLinePaint = { ...linePaint, 'line-color': ['get', 'stroke'] };
+ if (!points && !lines) return null;
- return
-
-
-
- ;
+ return
;
};
const makeMapStateToProps = () => {
diff --git a/src/PatrolTrackLayer/index.js b/src/PatrolTrackLayer/index.js
index 2902edf25..d689adf28 100644
--- a/src/PatrolTrackLayer/index.js
+++ b/src/PatrolTrackLayer/index.js
@@ -21,7 +21,10 @@ const PatrolTrackLayer = (props) => {
// eslint-disable-next-line no-unused-vars
const { map, patrolData: { trackData, patrol }, showTrackTimepoints, trackTimeEnvelope, tracks, dispatch: _dispatch, onPointClick, ...rest } = props;
- const trimmedTrackData = useMemo(() => !!trackData && trimTrackDataToTimeRange(trackData, trackTimeEnvelope.from, trackTimeEnvelope.until), [trackData, trackTimeEnvelope.from, trackTimeEnvelope.until]);
+ const trimmedTrackData = useMemo(() =>
+ !!trackData
+ && trimTrackDataToTimeRange(trackData, trackTimeEnvelope.from, trackTimeEnvelope.until),
+ [trackData, trackTimeEnvelope.from, trackTimeEnvelope.until]);
const onTimepointClick = useCallback((e) => {
const layer = getPointLayer(e, map);
diff --git a/src/SideBar/index.js b/src/SideBar/index.js
index 2ddeb899c..cb8a214ec 100644
--- a/src/SideBar/index.js
+++ b/src/SideBar/index.js
@@ -268,6 +268,4 @@ const SideBar = () => {
;
};
-SideBar.propTypes = { map: PropTypes.object.isRequired };
-
export default memo(SideBar);
diff --git a/src/SubjectsLayer/index.js b/src/SubjectsLayer/index.js
index bf4724986..8a259edec 100644
--- a/src/SubjectsLayer/index.js
+++ b/src/SubjectsLayer/index.js
@@ -1,7 +1,6 @@
-import React, { memo, useCallback, useEffect, useState } from 'react';
+import React, { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { featureCollection } from '@turf/helpers';
import PropTypes from 'prop-types';
-import { Source } from 'react-mapbox-gl';
import { useSelector } from 'react-redux';
import LabeledPatrolSymbolLayer from '../LabeledPatrolSymbolLayer';
@@ -12,10 +11,27 @@ import { addFeatureCollectionImagesToMap } from '../utils/map';
import { LAYER_IDS, SOURCE_IDS, SUBJECT_FEATURE_CONTENT_TYPE } from '../constants';
import { getMapSubjectFeatureCollectionWithVirtualPositioning } from '../selectors/subjects';
import { getShouldSubjectsBeClustered } from '../selectors/clusters';
+import { useMapSource } from '../hooks';
const { SUBJECT_SYMBOLS } = LAYER_IDS;
const { CLUSTERS_SOURCE_ID } = SOURCE_IDS;
+const unclusteredFilter = [
+ 'all',
+ ['==', 'content_type', SUBJECT_FEATURE_CONTENT_TYPE],
+ ['!=', 'is_static', true],
+];
+
+const clusteredFilter = [
+ 'all',
+ ['==', 'content_type', SUBJECT_FEATURE_CONTENT_TYPE],
+ ['!=', 'is_static', true],
+ ['!has', 'point_count']
+];
+
+const UNCLUSTERED_SOURCE_ID = 'subject-symbol-source';
+const UNCLUSTERED_LAYER_ID = `${SUBJECT_SYMBOLS}-unclustered`;
+
const SubjectsLayer = ({ map, mapImages, onSubjectClick }) => {
const subjectFeatureCollection = useSelector(getMapSubjectFeatureCollectionWithVirtualPositioning);
const shouldSubjectsBeClustered = useSelector(getShouldSubjectsBeClustered);
@@ -23,6 +39,13 @@ const SubjectsLayer = ({ map, mapImages, onSubjectClick }) => {
const [mapSubjectFeatures, setMapSubjectFeatures] = useState(featureCollection([]));
const [subjectLayerIds, setSubjectLayerIds] = useState([]);
+ const onInit = useCallback(() => setSubjectLayerIds([
+ SUBJECT_SYMBOLS,
+ `${SUBJECT_SYMBOLS}-labels`,
+ `${SUBJECT_SYMBOLS}-unclustered`,
+ `${SUBJECT_SYMBOLS}-unclustered-labels`,
+ ]), []);
+
useEffect(() => {
if (!!subjectFeatureCollection?.features?.length) {
addFeatureCollectionImagesToMap(subjectFeatureCollection);
@@ -38,43 +61,27 @@ const SubjectsLayer = ({ map, mapImages, onSubjectClick }) => {
onSubjectClick(({ event, layer: clickedLayer }));
}, [subjectLayerIds, map, onSubjectClick]);
- const sourceData = {
- type: 'geojson',
- data: {
- ...mapSubjectFeatures,
- features: !shouldSubjectsBeClustered ? mapSubjectFeatures.features : [],
- },
- };
- return <>
-
+ const unclusteredData = useMemo(() => ({
+ ...mapSubjectFeatures,
+ features: !shouldSubjectsBeClustered ? mapSubjectFeatures.features : [],
+ }), [mapSubjectFeatures, shouldSubjectsBeClustered]);
+
+ useMapSource(UNCLUSTERED_SOURCE_ID, unclusteredData);
+ return <>
setSubjectLayerIds([
- SUBJECT_SYMBOLS,
- `${SUBJECT_SYMBOLS}-labels`,
- `${SUBJECT_SYMBOLS}-unclustered`,
- `${SUBJECT_SYMBOLS}-unclustered-labels`,
- ])}
- sourceId="subject-symbol-source"
+ onInit={onInit}
+ sourceId={UNCLUSTERED_SOURCE_ID}
type="symbol"
/>
{!!map.getSource(CLUSTERS_SOURCE_ID) && <>
map.queryRenderedFeatures(e.point).filter(item => item.layer.id.includes('track-layer-points-'))[0];
const mapLayerTracker = trackEventFactory(MAP_LAYERS_CATEGORY);
+const LayerComponent = ({ data, map, onPointClick, showTimepoints }) => {
+ const linePaint = useMemo(() => ({
+ 'line-opacity': data.patrolTrackShown ? 0.4 : 1,
+ }), [data.patrolTrackShown]);
+
+ return ;
+};
+
const TracksLayer = (props) => {
const { map, onPointClick, showTimepoints, trackData } = props;
@@ -32,11 +40,10 @@ const TracksLayer = (props) => {
if (!trackData.length) return null;
- return {trackData.map(data => {
- const linePaint = data.patrolTrackShown ? { 'line-opacity': 0.4 } : {};
-
- return ;
- })};
+ return trackData
+ .map((data) =>
+
+ );
};
const mapStateToProps = (state) => ({
diff --git a/src/TracksLayer/track.js b/src/TracksLayer/track.js
index b3ba2ba5d..73770bbb9 100644
--- a/src/TracksLayer/track.js
+++ b/src/TracksLayer/track.js
@@ -1,15 +1,10 @@
-import React, { memo, useMemo, Fragment } from 'react';
+import React, { memo, useMemo } from 'react';
import PropTypes from 'prop-types';
-import { Source, Layer } from 'react-mapbox-gl';
-import debounceRender from 'react-debounce-render';
import { LAYER_IDS, MAP_ICON_SCALE } from '../constants';
+import { useMapEventBinding, useMapLayer, useMapSource } from '../hooks';
const { TRACKS_LINES, SUBJECT_SYMBOLS } = LAYER_IDS;
-
-const DebouncedLayer = debounceRender(Layer, 200);
-const DebouncedSource = debounceRender(Source, 200);
-
const trackLayerLinePaint = {
'line-color': [
'case',
@@ -42,7 +37,12 @@ const timepointLayerPaint = {
],
};
-const TrackLayer = ({ id, map, onPointClick, linePaint = {}, lineLayout = {}, trackData, showTimepoints, before = null, dispatch: _dispatch, ...rest }) => {
+const trackSourceConfig = {
+ tolerance: 1.5,
+ type: 'geojson',
+};
+
+const TrackLayer = ({ id, map, onPointClick, linePaint = {}, lineLayout = {}, trackData, showTimepoints, before = null, dispatch: _dispatch }) => {
const trackLinePaint = useMemo(() => ({
...trackLayerLinePaint,
...linePaint,
@@ -55,35 +55,30 @@ const TrackLayer = ({ id, map, onPointClick, linePaint = {}, lineLayout = {}, tr
const layerBefore = useMemo(() => before || SUBJECT_SYMBOLS, [before]);
-
const { track: trackCollection, points: trackPointCollection } = trackData;
const trackId = id || trackCollection.features[0].properties.id;
const onSymbolMouseEnter = () => map.getCanvas().style.cursor = 'pointer';
const onSymbolMouseLeave = () => map.getCanvas().style.cursor = '';
- const trackSourceConfig = useMemo(() => ({
- tolerance: 1.5,
- type: 'geojson',
- data: trackCollection,
- }), [trackCollection]);
-
- const trackPointSourceConfig = useMemo(() => ({
- type: 'geojson',
- data: trackPointCollection,
- }), [trackPointCollection]);
-
- if (!trackData.track) return null;
-
const sourceId = `track-source-${trackId}`;
const pointSourceId = `${sourceId}-points`;
const layerId = `${TRACKS_LINES}-${trackId}`;
const pointLayerId = `${TRACKS_LINES}-points-${trackId}`;
- return
-
-
+ useMapSource(sourceId, trackCollection, trackSourceConfig);
+ useMapSource(pointSourceId, trackPointCollection);
+
+ useMapLayer(layerId, 'line', sourceId, trackLinePaint, trackLineLayout, { before: layerBefore });
+ useMapLayer(pointLayerId, 'symbol', pointSourceId, timepointLayerPaint, timepointLayerLayout, { before: layerBefore, condition: showTimepoints });
+
+ useMapEventBinding('click', onPointClick, pointLayerId, showTimepoints);
+ useMapEventBinding('mouseenter', onSymbolMouseEnter, pointLayerId, showTimepoints);
+ useMapEventBinding('mouseleave', onSymbolMouseLeave, pointLayerId, showTimepoints);
+
+ return null;
+ /* return
@@ -93,7 +88,7 @@ const TrackLayer = ({ id, map, onPointClick, linePaint = {}, lineLayout = {}, tr
onMouseLeave={onSymbolMouseLeave}
onClick={onPointClick} layout={timepointLayerLayout} paint={timepointLayerPaint} id={pointLayerId} {...rest} />}
- ;
+ ; */
};
export default memo(TrackLayer);
diff --git a/src/UserCurrentLocationLayer/index.js b/src/UserCurrentLocationLayer/index.js
index 945a1c2f3..80c8888ff 100644
--- a/src/UserCurrentLocationLayer/index.js
+++ b/src/UserCurrentLocationLayer/index.js
@@ -1,7 +1,6 @@
-import React, { memo, useMemo, Fragment, useEffect, useState, useRef } from 'react';
+import React, { memo, useCallback, useMemo, useEffect, useState, useRef } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
-import { Source, Layer } from 'react-mapbox-gl';
import { point } from '@turf/helpers';
import booleanContains from '@turf/boolean-contains';
@@ -11,6 +10,7 @@ import { addMapImage } from '../utils/map';
import { MAP_ICON_SCALE } from '../constants';
import { withMap } from '../EarthRangerMap';
import GpsLocationIcon from '../common/images/icons/gps-location-icon-blue.svg';
+import { useMapEventBinding, useMapLayer, useMapSource } from '../hooks';
const framesPerSecond = 20;
const initialOpacity = 1;
@@ -53,9 +53,9 @@ const UserCurrentLocationLayer = (props) => {
strokeWidth: initialStrokeWidth,
});
- const onCurrentLocationIconClick = () => {
+ const onCurrentLocationIconClick = useCallback(() => {
onIconClick(userLocation);
- };
+ }, [onIconClick, userLocation]);
useEffect(() => {
if (map && !map.hasImage('current-location-icon')) {
@@ -81,32 +81,34 @@ const UserCurrentLocationLayer = (props) => {
};
}, [animationState, showLayer]);
- const sourceData = useMemo(() => {
- if (!showLayer) return null;
+ const userLocationPoint = useMemo(() => showLayer && userLocation?.coords?.longitude
+ ? point([
+ userLocation.coords.longitude,
+ userLocation.coords.latitude,
+ ])
+ : null
+ , [showLayer, userLocation?.coords]);
- return {
- type: 'geojson',
- data: point([
- userLocation.coords.longitude,
- userLocation.coords.latitude,
- ]),
- };
- }, [showLayer, userLocation]);
-
-
- return showLayer &&
-
-
-
- ;
+ const circlePaint = useMemo(() => ({
+ 'circle-radius': animationState.radius,
+ 'circle-radius-transition': { duration: 0 },
+ 'circle-opacity-transition': { duration: 0 },
+ 'circle-color': 'rgba(0,0,0,0)',
+ 'circle-stroke-color': '#007cbf',
+ 'circle-stroke-width': animationState.strokeWidth,
+ 'circle-stroke-opacity': animationState.opacity,
+ }), [animationState.radius, animationState.strokeWidth, animationState.opacity]);
+
+ const layerConfig = { minZoom: 6, condition: !!showLayer };
+
+ useMapSource('current-user-location-source', userLocationPoint);
+
+ useMapLayer('current-user-location-icon-layer', 'symbol', 'current-user-location-source', null, symbolLayout, layerConfig);
+ useMapLayer('current-user-location-circle-layer', 'circle', 'current-user-location-source', circlePaint, null, layerConfig);
+
+ useMapEventBinding('click', onCurrentLocationIconClick, 'current-user-location-icon-layer');
+
+ return null;
};
const mapStateToProps = (state) => ({
diff --git a/src/hooks/index.js b/src/hooks/index.js
index edb769512..a394033f6 100644
--- a/src/hooks/index.js
+++ b/src/hooks/index.js
@@ -4,6 +4,10 @@ import isEqual from 'react-fast-compare';
import { useSelector } from 'react-redux';
import noop from 'lodash/noop';
+import { MIN_ZOOM, MAX_ZOOM, LAYER_IDS } from '../constants';
+
+const { TOPMOST_STYLE_LAYER } = LAYER_IDS;
+
export const useFeatureFlag = flag =>
useSelector(state =>
!!state?.view?.systemConfig?.[flag]
@@ -74,22 +78,20 @@ export const useMapEventBinding = (eventType = 'click', handlerFn = noop, layerI
export const useMapSource = (sourceId, data, config = { type: 'geojson' }) => {
const map = useContext(MapContext);
- let source = map.getSource(sourceId);
+ const source = map?.getSource(sourceId);
useEffect(() => {
- if (map) {
- if (!source) {
- map.addSource(sourceId, {
- ...config,
- data,
- });
- }
+ if (map && !source) {
+ map.addSource(sourceId, {
+ ...config,
+ data,
+ });
}
}, [sourceId, source, config, data, map]);
useEffect(() => {
if (source) {
- source.setData(data);
+ source.setData?.(data);
}
}, [data, source]);
@@ -106,13 +108,19 @@ export const useMapSource = (sourceId, data, config = { type: 'geojson' }) => {
return source;
};
-export const useMapLayer = (layerId, type, sourceId, paint, layout, filter) => {
+export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
const map = useContext(MapContext);
+ const layer = map?.getLayer(layerId);
- const layer = map.getLayer(layerId);
+ const before = useMemoCompare(config?.before || TOPMOST_STYLE_LAYER);
+ const condition = useMemoCompare(config?.condition || true);
+ const filter = useMemoCompare(config?.filter);
+ const minzoom = useMemoCompare(config?.minZoom);
+ const maxzoom = useMemoCompare(config?.maxZoom);
useEffect(() => {
- if (map && !layer) {
+ if (condition && map && !layer) {
+ console.log('if (condition && map && !layer)');
const source = map.getSource(sourceId);
if (!!source) {
@@ -122,38 +130,81 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, filter) => {
type,
layout: layout || {},
paint: paint || {},
- });
+ }, before);
}
}
- }, [layer, layerId, layout, map, sourceId, paint, type]);
+ }, [before, condition, layer, layerId, layout, map, sourceId, paint, type]);
useEffect(() => {
- if (layer && layout) {
+ if (condition && layer && layout) {
+ console.log('if (condition && layer && layout)');
Object.entries(layout).forEach(([key, value]) => {
layer.setLayoutProperty(key, value);
});
}
- }, [layer, layout]);
+ }, [condition, layer, layout]);
useEffect(() => {
- if (layer && paint) {
+ if (condition && layer && paint) {
+ console.log('if (condition && layer && paint)');
Object.entries(paint).forEach(([key, value]) => {
layer.setPaintProperty(key, value);
});
}
- }, [layer, paint]);
+ }, [condition, layer, paint]);
useEffect(() => {
- if (layer && filter) {
- layer.setFilter(filter);
+ if (condition && map && layer) {
+ console.log('if (condition && map && layer)');
+ map.setFilter(layerId, filter);
}
- }, [filter, layer]);
+ }, [condition, filter, layer, layerId, map]);
+
+ useEffect(() => {
+ if (!condition && layer) {
+ console.log('if (!condition && layer)');
+ map.removeLayer(layerId);
+ }
+ }, [condition, layer, layerId, map]);
useEffect(() => {
return () => {
- map.getLayer(layerId) && map.removeLayer(layerId);
+ if (map) {
+ map.getLayer(layerId) && map.removeLayer(layerId);
+ }
};
}, [layerId, map]);
+ useEffect(() => {
+ if (condition && map && layer && (minzoom || maxzoom)) {
+ console.log('if (condition && map && layer && (minzoom || maxzoom))');
+ map.setLayerZoomRange(layerId, (minzoom || MIN_ZOOM), (maxzoom || MAX_ZOOM));
+ }
+ }, [condition, layer, layerId, map, minzoom, maxzoom]);
+
+
+ useEffect(() => {
+ if (layer && map && before) {
+ console.log('if (layer && map && before)');
+ map.moveLayer(layerId, before);
+ }
+ }, [before, layer, layerId, map]);
+
return layer;
+};
+
+
+const useMemoCompare = (next, compare = isEqual) => {
+ const previousRef = useRef();
+ const previous = previousRef.current;
+
+ const isEqual = compare(previous, next);
+
+ useEffect(() => {
+ if (!isEqual) {
+ previousRef.current = next;
+ }
+ }, [isEqual, next]);
+ // Finally, if equal then return the previous value
+ return isEqual ? previous : next;
};
\ No newline at end of file
diff --git a/src/utils/subjects.js b/src/utils/subjects.js
index 84c0efb56..b66dbb400 100644
--- a/src/utils/subjects.js
+++ b/src/utils/subjects.js
@@ -16,7 +16,6 @@ export const RECENT_RADIO_DECAY_THRESHOLD = (30 * 60); // 30 minutes
export const subjectIsARadio = subject => RADIO_SUBTYPES.includes(subject.subject_subtype);
export const subjectIsAFixedPositionRadio = subject => STATIONARY_RADIO_SUBTYPES.includes(subject.subject_subtype);
-export const subjectIsAMobileRadio = subject => MOBILE_RADIO_SUBTYPES.includes(subject.subject_subtype);
export const subjectIsARadioWithRecentVoiceActivity = (properties) => {
return subjectIsARadio(properties)
From 5cd996cf74eb0539077565461459d469a235adbf Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Wed, 10 Aug 2022 21:59:35 -0700
Subject: [PATCH 10/19] using renderHook to test (and scaffold tests for) new
custom map integration hooks.
---
src/MapDrawingTools/hooks.test.js | 0
src/MapDrawingTools/index.test.js | 16 +-
src/__test-helpers/mocks.js | 3 +-
src/hooks/index.js | 19 +--
src/hooks/index.test.js | 235 ++++++++++++++++++++++++++++++
5 files changed, 251 insertions(+), 22 deletions(-)
delete mode 100644 src/MapDrawingTools/hooks.test.js
diff --git a/src/MapDrawingTools/hooks.test.js b/src/MapDrawingTools/hooks.test.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/MapDrawingTools/index.test.js b/src/MapDrawingTools/index.test.js
index e7aeab9c9..5568ac372 100644
--- a/src/MapDrawingTools/index.test.js
+++ b/src/MapDrawingTools/index.test.js
@@ -68,7 +68,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onChange).toHaveBeenCalled();
});
@@ -82,7 +82,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('dblclick', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('dblclick', { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onChange).toHaveBeenCalledTimes(1);
@@ -97,7 +97,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', LAYER_IDS.POINTS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', LAYER_IDS.POINTS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onClickPoint).toHaveBeenCalled();
});
@@ -111,7 +111,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', LAYER_IDS.LINES, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', LAYER_IDS.LINES, { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onClickLine).toHaveBeenCalled();
});
@@ -125,7 +125,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', LAYER_IDS.FILL, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', LAYER_IDS.FILL, { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onClickFill).toHaveBeenCalled();
});
@@ -139,7 +139,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', LAYER_IDS.LABELS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', LAYER_IDS.LABELS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onClickLabel).toHaveBeenCalled();
});
@@ -153,7 +153,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onChange).toHaveBeenCalledTimes(1);
console.log('the geojson', onChange.mock.calls[0][1]);
@@ -168,7 +168,7 @@ describe('MapDrawingTools', () => {
);
- map.__test.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
expect(onChange).toHaveBeenCalledTimes(1);
console.log('the geojson', onChange.mock.calls[0][1]);
diff --git a/src/__test-helpers/mocks.js b/src/__test-helpers/mocks.js
index 0215a75c6..a429ecac1 100644
--- a/src/__test-helpers/mocks.js
+++ b/src/__test-helpers/mocks.js
@@ -27,6 +27,7 @@ export const createMapMock = (override = {}) => {
project: jest.fn(),
queryRenderedFeatures: jest.fn(),
setLayoutProperty: jest.fn(),
+ setPaintProperty: jest.fn(),
setTerrain: jest.fn(),
fitBounds: jest.fn(),
setZoom: jest.fn(),
@@ -61,4 +62,4 @@ export const createMapMock = (override = {}) => {
};
return mockMap;
-};
\ No newline at end of file
+};
diff --git a/src/hooks/index.js b/src/hooks/index.js
index a394033f6..99743423e 100644
--- a/src/hooks/index.js
+++ b/src/hooks/index.js
@@ -120,7 +120,6 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
useEffect(() => {
if (condition && map && !layer) {
- console.log('if (condition && map && !layer)');
const source = map.getSource(sourceId);
if (!!source) {
@@ -137,32 +136,28 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
useEffect(() => {
if (condition && layer && layout) {
- console.log('if (condition && layer && layout)');
Object.entries(layout).forEach(([key, value]) => {
- layer.setLayoutProperty(key, value);
+ map.setLayoutProperty(layerId, key, value);
});
}
- }, [condition, layer, layout]);
+ }, [condition, layer, layerId, layout, map]);
useEffect(() => {
if (condition && layer && paint) {
- console.log('if (condition && layer && paint)');
Object.entries(paint).forEach(([key, value]) => {
- layer.setPaintProperty(key, value);
+ map.setPaintProperty(layerId, key, value);
});
}
- }, [condition, layer, paint]);
+ }, [condition, map, layer, layerId, paint]);
useEffect(() => {
if (condition && map && layer) {
- console.log('if (condition && map && layer)');
map.setFilter(layerId, filter);
}
}, [condition, filter, layer, layerId, map]);
useEffect(() => {
if (!condition && layer) {
- console.log('if (!condition && layer)');
map.removeLayer(layerId);
}
}, [condition, layer, layerId, map]);
@@ -177,7 +172,6 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
useEffect(() => {
if (condition && map && layer && (minzoom || maxzoom)) {
- console.log('if (condition && map && layer && (minzoom || maxzoom))');
map.setLayerZoomRange(layerId, (minzoom || MIN_ZOOM), (maxzoom || MAX_ZOOM));
}
}, [condition, layer, layerId, map, minzoom, maxzoom]);
@@ -185,7 +179,6 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
useEffect(() => {
if (layer && map && before) {
- console.log('if (layer && map && before)');
map.moveLayer(layerId, before);
}
}, [before, layer, layerId, map]);
@@ -194,7 +187,7 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
};
-const useMemoCompare = (next, compare = isEqual) => {
+export const useMemoCompare = (next, compare = isEqual) => {
const previousRef = useRef();
const previous = previousRef.current;
@@ -205,6 +198,6 @@ const useMemoCompare = (next, compare = isEqual) => {
previousRef.current = next;
}
}, [isEqual, next]);
- // Finally, if equal then return the previous value
+
return isEqual ? previous : next;
};
\ No newline at end of file
diff --git a/src/hooks/index.test.js b/src/hooks/index.test.js
index e69de29bb..6fcfb5897 100644
--- a/src/hooks/index.test.js
+++ b/src/hooks/index.test.js
@@ -0,0 +1,235 @@
+import React from 'react';
+import { renderHook } from '@testing-library/react-hooks';
+
+import { MapContext } from '../App';
+
+import { createMapMock } from '../__test-helpers/mocks';
+
+import { useMemoCompare, useMapEventBinding, useMapLayer, useMapSource } from './';
+
+describe('#useMapEventBinding', () => {
+ let map, wrapper, handler;
+ const layerId = 'test-layer-id';
+
+ beforeEach(() => {
+ map = createMapMock();
+ handler = jest.fn();
+ wrapper = ({ children }) => {children}; // eslint-disable-line react/display-name
+ });
+
+ /* eventType = 'click', handlerFn = noop, layerId = null, condition = true */
+ test('binding a handler function', () => {
+ renderHook(() => useMapEventBinding('click', handler, layerId), { wrapper });
+ });
+
+ test('not binding if no map is available', () => {
+ renderHook(() => useMapEventBinding('banana', handler, layerId)); // no context wrapper means there's no map available;
+ });
+
+ describe('@param condition', () => {
+ test('binding and unbinding based on the "condition" argument', () => {
+ let condition = false;
+ const { rerender } = renderHook(() => useMapEventBinding('fakebindingname', handler, layerId, condition), { wrapper });
+ condition = true;
+
+ /* expect no calls */
+ rerender();
+
+ /* expect map.on called */
+ condition = false;
+
+ rerender();
+ /* expect map.off called */
+ });
+ });
+});
+
+describe('#useMapSource', () => {
+ test('adding a source to the map', () => {
+
+ });
+
+ describe('@param config', () => {
+
+ });
+});
+
+/* layerId, type, sourceId, paint, layout, config */
+describe('#useMapLayer', () => {
+ let wrapper, map;
+
+ const layerId = 'test-layer-id';
+
+ beforeEach(() => {
+ map = createMapMock();
+ wrapper = ({ children }) => {children}; // eslint-disable-line react/display-name
+ });
+
+ test('adding a layer to the map', () => {
+ renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
+
+ expect(map.addLayer).toHaveBeenCalled();
+ });
+
+ test('not adding a layer if no map is available', () => {
+ renderHook(() => useMapLayer()); // no context wrapper means there's no map available;
+
+ expect(map.addLayer).not.toHaveBeenCalled();
+ });
+
+ describe('when the layer is present', () => {
+ test('setting and changing paint props', () => {
+ let paintObject = { value1: 'yellow', value2: 0.6 };
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', paintObject), { wrapper });
+ paintObject.entries.forEach(([key, value]) => {
+ expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ });
+
+ expect(map.setPaintProperty);
+
+ paintObject = { whatever: true };
+
+ jest.clearAllMocks();
+
+ rerender();
+
+ paintObject.entries.forEach(([key, value]) => {
+ expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ });
+
+ });
+
+ test('setting and changing layout props', () => {
+ let layoutObject = { value1: 'yellow', value2: 0.6 };
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, layoutObject), { wrapper });
+ layoutObject.entries.forEach(([key, value]) => {
+ expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ });
+
+ expect(map.setPaintProperty);
+
+ layoutObject = { whatever: true };
+
+ jest.clearAllMocks();
+
+ rerender();
+
+ layoutObject.entries.forEach(([key, value]) => {
+ expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ });
+
+ });
+
+ test('returning the layer value', () => {
+ const mockValue = { whatever: 'ok this works' };
+
+ map.addLayer.mockReturnValue(mockValue);
+
+ const { result } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
+
+ expect(result).toBe(mockValue);
+ });
+
+ test('removing a layer on unmount', () => {
+ const { unmount } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
+
+ jest.clearAllMocks();
+
+ unmount();
+
+ expect(map.removeLayer).toHaveBeenCalled();
+ });
+
+ describe('@param config', () => {
+ test('.filter sets and changes', () => {
+ let filter = ['==', [['get', 'subject_subtype'], 'ranger']];
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, { filter }), { wrapper });
+ expect(map.setFilter).toHaveBeenCalledWith(layerId, filter);
+
+ filter = 'oh whatever dude';
+ jest.clearAllMocks();
+
+ rerender();
+
+ expect(map.setFilter).toHaveBeenCalledWith(layerId, 'oh whatever dude');
+
+ });
+
+ test('.before sets and changes', () => {
+ let before = 'meow';
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, { before }), { wrapper });
+ expect(map.moveLayer).toHaveBeenCalledWith(layerId, before);
+
+ before = 'how';
+ jest.clearAllMocks();
+
+ rerender();
+
+ expect(map.moveLayer).toHaveBeenCalledWith(layerId, 'how');
+ });
+
+ test('.maxZoom sets and changes', () => {
+ const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+ });
+
+ test('.minZoom sets and changes', () => {
+ const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+ });
+
+ describe('.condition', () => {
+ test('sets and changes', () => {
+ let condition = true;
+
+ const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+
+ condition = false;
+
+ rerender();
+ });
+
+ test('adds and removes a layer when toggled', () => {
+ const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+ });
+
+ });
+ });
+ });
+
+});
+
+describe('#useMemoCompare', () => {
+ test('returning the first value on first render', () => {
+ let value = { whatever: 123 };
+
+ const { result } = renderHook(() => useMemoCompare(value));
+
+ expect(result).toBe(value);
+ });
+
+ test('returning a reference to the first value if an updated value is identical', () => {
+ let value = { whatever: 123 };
+
+ const { result, rerender } = renderHook(() => useMemoCompare(value));
+
+ rerender({ whatever: 123 }); // pass a new object with identical props
+
+ expect(result).toBe(value); // the reference is intact
+ });
+
+ test('returning a reference to the new value if it is updated', () => {
+ let value = { whatever: 123 };
+
+ const { result, rerender } = renderHook(() => useMemoCompare(value));
+
+ value = { hello: false };
+
+ rerender();
+
+ expect(result).toEqual({ hello: false }); // the reference is intact
+
+ });
+});
\ No newline at end of file
From d444c1528d069f796dcd93c0330ba80c40dd07c6 Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 08:52:50 -0700
Subject: [PATCH 11/19] fixing sidebar test scaffolding for more consistent
results. cleaning up empty files, typo correction, build improvements
---
src/MapDrawingTools/utils.test.js | 0
src/MapRulerControl/PointPopup.test.js | 0
src/SideBar/index.test.js | 14 +++++++------
src/__test-helpers/mocks.js | 16 ++++++++++++++-
src/hooks/index.test.js | 28 +++++++++-----------------
5 files changed, 33 insertions(+), 25 deletions(-)
delete mode 100644 src/MapDrawingTools/utils.test.js
delete mode 100644 src/MapRulerControl/PointPopup.test.js
diff --git a/src/MapDrawingTools/utils.test.js b/src/MapDrawingTools/utils.test.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/MapRulerControl/PointPopup.test.js b/src/MapRulerControl/PointPopup.test.js
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/SideBar/index.test.js b/src/SideBar/index.test.js
index e8b332fd3..fb9b74b9a 100644
--- a/src/SideBar/index.test.js
+++ b/src/SideBar/index.test.js
@@ -1,6 +1,6 @@
import React from 'react';
import { Provider } from 'react-redux';
-import { render, screen, waitFor } from '@testing-library/react';
+import { render, screen, waitFor, prettyDOM } from '@testing-library/react';
import { useLocation } from 'react-router-dom';
import userEvent from '@testing-library/user-event';
@@ -27,10 +27,7 @@ jest.mock('../ducks/patrols', () => ({
...jest.requireActual('../ducks/patrols'),
fetchPatrols: jest.fn(),
}));
-jest.mock('../hooks', () => ({
- ...jest.requireActual('../hooks'),
- useFeatureFlag: () => true,
-}));
+
jest.mock('../hooks/useNavigate', () => jest.fn());
describe('SideBar', () => {
@@ -90,6 +87,9 @@ describe('SideBar', () => {
hiddenAnalyzerIDs: [],
userPreferences: {},
sideBar: {},
+ systemConfig: {
+ patrol_enabled: true,
+ },
},
};
});
@@ -314,7 +314,7 @@ describe('SideBar', () => {
test('closes the sidebar tabs when clicking the cross button', () => {
const mockStoreInstance = mockStore(store);
- render(
+ const { baseElement, container } = render(
@@ -326,6 +326,8 @@ describe('SideBar', () => {
);
+ console.log('HERE WE GO', prettyDOM(container.firstChild), prettyDOM(baseElement));
+
expect(navigate).toHaveBeenCalledTimes(0);
const closeButton = screen.getByTestId('sideBar-closeButton');
diff --git a/src/__test-helpers/mocks.js b/src/__test-helpers/mocks.js
index a429ecac1..e36caab0a 100644
--- a/src/__test-helpers/mocks.js
+++ b/src/__test-helpers/mocks.js
@@ -10,6 +10,7 @@ export const createMapMock = (override = {}) => {
setFilter: jest.fn(),
removeSource: jest.fn(),
addLayer: jest.fn(),
+ moveLayer: jest.fn(),
removeLayer: jest.fn(),
on: jest.fn(),
once: jest.fn(),
@@ -55,7 +56,11 @@ export const createMapMock = (override = {}) => {
/* skip the optional layerName arg if it hasn't been passed */
const func = !!layerId ? rest[1] : rest[0];
- func(eventObj);
+ func(
+ createMockMapInteractionEvent(
+ eventObj
+ )
+ );
});
},
}
@@ -63,3 +68,12 @@ export const createMapMock = (override = {}) => {
return mockMap;
};
+
+
+const createMockMapInteractionEvent = (data) => ({
+ preventDefault: jest.fn(),
+ originalEvent: {
+ stopPropagation: jest.fn(),
+ },
+ ...data,
+});
\ No newline at end of file
diff --git a/src/hooks/index.test.js b/src/hooks/index.test.js
index 6fcfb5897..5f497f6e4 100644
--- a/src/hooks/index.test.js
+++ b/src/hooks/index.test.js
@@ -82,7 +82,7 @@ describe('#useMapLayer', () => {
let paintObject = { value1: 'yellow', value2: 0.6 };
const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', paintObject), { wrapper });
- paintObject.entries.forEach(([key, value]) => {
+ Object.entries(paintObject).forEach(([key, value]) => {
expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
});
@@ -90,11 +90,10 @@ describe('#useMapLayer', () => {
paintObject = { whatever: true };
- jest.clearAllMocks();
rerender();
- paintObject.entries.forEach(([key, value]) => {
+ Object.entries(paintObject).forEach(([key, value]) => {
expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
});
@@ -104,7 +103,7 @@ describe('#useMapLayer', () => {
let layoutObject = { value1: 'yellow', value2: 0.6 };
const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, layoutObject), { wrapper });
- layoutObject.entries.forEach(([key, value]) => {
+ Object.entries(layoutObject).forEach(([key, value]) => {
expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
});
@@ -112,11 +111,9 @@ describe('#useMapLayer', () => {
layoutObject = { whatever: true };
- jest.clearAllMocks();
-
rerender();
- layoutObject.entries.forEach(([key, value]) => {
+ Object.entries(layoutObject).forEach(([key, value]) => {
expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
});
@@ -129,17 +126,15 @@ describe('#useMapLayer', () => {
const { result } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
- expect(result).toBe(mockValue);
+ expect(result.current).toEqual(mockValue);
});
test('removing a layer on unmount', () => {
const { unmount } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
- jest.clearAllMocks();
-
unmount();
- expect(map.removeLayer).toHaveBeenCalled();
+ expect(map.removeLayer).toHaveBeenCalledWith(layerId);
});
describe('@param config', () => {
@@ -150,7 +145,6 @@ describe('#useMapLayer', () => {
expect(map.setFilter).toHaveBeenCalledWith(layerId, filter);
filter = 'oh whatever dude';
- jest.clearAllMocks();
rerender();
@@ -159,13 +153,11 @@ describe('#useMapLayer', () => {
});
test('.before sets and changes', () => {
- let before = 'meow';
+ let before = null;
const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, { before }), { wrapper });
- expect(map.moveLayer).toHaveBeenCalledWith(layerId, before);
before = 'how';
- jest.clearAllMocks();
rerender();
@@ -207,7 +199,7 @@ describe('#useMemoCompare', () => {
const { result } = renderHook(() => useMemoCompare(value));
- expect(result).toBe(value);
+ expect(result.current).toEqual(value);
});
test('returning a reference to the first value if an updated value is identical', () => {
@@ -217,7 +209,7 @@ describe('#useMemoCompare', () => {
rerender({ whatever: 123 }); // pass a new object with identical props
- expect(result).toBe(value); // the reference is intact
+ expect(result.current).toEqual(value); // the reference is intact
});
test('returning a reference to the new value if it is updated', () => {
@@ -229,7 +221,7 @@ describe('#useMemoCompare', () => {
rerender();
- expect(result).toEqual({ hello: false }); // the reference is intact
+ expect(result.current).toEqual({ hello: false }); // the reference is intact
});
});
\ No newline at end of file
From 30b52eedf78d032e2b7f7c97448269dc54dc85da Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 13:03:08 -0700
Subject: [PATCH 12/19] PR feedback, test tweaks
---
src/FriendlyFilterString/index.test.js | 52 --------------------------
src/HeatLayer/index.js | 7 +---
src/MapDrawingTools/MapLayers.js | 28 +++++---------
src/MapDrawingTools/index.js | 2 +-
src/MapDrawingTools/index.test.js | 10 +++--
5 files changed, 17 insertions(+), 82 deletions(-)
delete mode 100644 src/FriendlyFilterString/index.test.js
diff --git a/src/FriendlyFilterString/index.test.js b/src/FriendlyFilterString/index.test.js
deleted file mode 100644
index f7f38d4a0..000000000
--- a/src/FriendlyFilterString/index.test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import React from 'react';
-import { render, screen } from '@testing-library/react';
-
-import FriendlyFilterString from '.';
-import { EVENT_SORT_OPTIONS, SORT_DIRECTION } from '../utils/event-filter';
-
-describe('FriendlyFilterString', () => {
- beforeAll(() => {
- const mockSystemTime = new Date('2022-02-20');
- mockSystemTime.setUTCHours(20);
-
- jest.useFakeTimers('modern').setSystemTime(mockSystemTime.getTime());
- });
-
- test('prints a friendly string for a non-filtered case', async () => {
- render();
-
- expect(await screen.findByText('20 results')).toBeDefined();
- expect(await screen.findByText('from')).toBeDefined();
- expect(await screen.findByText('6 days ago until 22 days from now')).toBeDefined();
- });
-
- test('prints a friendly string for a filtered case', async () => {
- render();
-
- expect(await screen.findByText('7 results')).toBeDefined();
- expect(await screen.findByText('filtered from')).toBeDefined();
- expect(await screen.findByText('3 days ago until 26 days from now')).toBeDefined();
- });
-
- test('prints a friendly string for a sorted case', async () => {
- render();
-
- expect(await screen.findByText('50 results')).toBeDefined();
- expect(await screen.findByText('filtered from')).toBeDefined();
- expect(await screen.findByText('30 days ago until 1 day from now')).toBeDefined();
- expect(await screen.findByText(', sorted ascending by')).toBeDefined();
- expect(await screen.findByText('created date')).toBeDefined();
- });
-});
diff --git a/src/HeatLayer/index.js b/src/HeatLayer/index.js
index 9e9328eed..a07739d54 100644
--- a/src/HeatLayer/index.js
+++ b/src/HeatLayer/index.js
@@ -29,14 +29,9 @@ const HeatLayer = ({ heatmapStyles, points }) => {
}), [heatmapStyles.intensity, latitude, heatmapStyles.radiusInMeters]);
useMapSource(`heatmap-source-${idRef.current}`, points);
- useMapLayer(`${HEATMAP_LAYER}-${idRef.current}`, 'heatmap', `heatmap-source-${idRef.current}`, paint);
+ useMapLayer(`${HEATMAP_LAYER}-${idRef.current}`, 'heatmap', `heatmap-source-${idRef.current}`, paint, null, { before: TOPMOST_STYLE_LAYER });
return null;
-
- /* return
- ;
-
- ; */
};
const mapStateToProps = (state) => ({ heatmapStyles: state.view.heatmapStyles });
diff --git a/src/MapDrawingTools/MapLayers.js b/src/MapDrawingTools/MapLayers.js
index f5e25ad8e..e8c18c400 100644
--- a/src/MapDrawingTools/MapLayers.js
+++ b/src/MapDrawingTools/MapLayers.js
@@ -1,7 +1,7 @@
-import React, { memo, useContext, useEffect } from 'react';
+import React, { memo, useCallback, useContext, useEffect } from 'react';
import { MapContext } from '../App';
-import { useMapLayer, useMapSource } from '../hooks';
+import { useMapEventBinding, useMapLayer, useMapSource } from '../hooks';
import { linePaint, lineLayout, circlePaint, fillLayout, fillPaint, symbolPaint, symbolLayout } from './layerStyles';
@@ -21,34 +21,24 @@ export const SOURCE_IDS = {
const MapDrawingLayers = (props) => {
const {
- data,
+ drawnLineSegments, fillPolygon,
} = props;
const map = useContext(MapContext);
- useMapSource(SOURCE_IDS.LINE_SOURCE, data?.drawnLineSegments, { type: 'geojson' });
- useMapSource(SOURCE_IDS.FILL_SOURCE, data?.fillPolygon, { type: 'geojson' });
+ useMapSource(SOURCE_IDS.LINE_SOURCE, drawnLineSegments, { type: 'geojson' });
+ useMapSource(SOURCE_IDS.FILL_SOURCE, fillPolygon, { type: 'geojson' });
+ const onCircleMouseEnter = useCallback(() => map.getCanvas().style.cursor = 'pointer', [map]);
+ const onCircleMouseLeave = useCallback(() => map.getCanvas().style.cursor = '', [map]);
useMapLayer(LAYER_IDS.LINES, 'line', SOURCE_IDS.LINE_SOURCE, linePaint, lineLayout);
useMapLayer(LAYER_IDS.LABELS, 'symbol', SOURCE_IDS.LINE_SOURCE, symbolPaint, symbolLayout);
useMapLayer(LAYER_IDS.FILL, 'fill', SOURCE_IDS.FILL_SOURCE, fillPaint, fillLayout);
const circleLayer = useMapLayer(LAYER_IDS.POINTS, 'circle', SOURCE_IDS.LINE_SOURCE, circlePaint);
- useEffect(() => {
- if (map && circleLayer) {
- const onCircleMouseEnter = () => map.getCanvas().style.cursor = 'pointer';
- const onCircleMouseLeave = () => map.getCanvas().style.cursor = '';
-
- map.on('mouseenter', LAYER_IDS.POINTS, onCircleMouseEnter);
- map.on('mouseleave', LAYER_IDS.POINTS, onCircleMouseLeave);
-
- return () => {
- map.off('mouseenter', LAYER_IDS.POINTS, onCircleMouseEnter);
- map.off('mouseleave', LAYER_IDS.POINTS, onCircleMouseLeave);
- };
- }
- }, [circleLayer, map]);
+ useMapEventBinding('mouseenter', onCircleMouseEnter, LAYER_IDS.POINTS, !!circleLayer);
+ useMapEventBinding('mouseleave', onCircleMouseLeave, LAYER_IDS.POINTS, !!circleLayer);
return null;
};
diff --git a/src/MapDrawingTools/index.js b/src/MapDrawingTools/index.js
index 471f9c5d3..bb13b5f86 100644
--- a/src/MapDrawingTools/index.js
+++ b/src/MapDrawingTools/index.js
@@ -89,7 +89,7 @@ const MapDrawingTools = (props) => {
return <>
{drawing && }
-
+
{children}
>;
};
diff --git a/src/MapDrawingTools/index.test.js b/src/MapDrawingTools/index.test.js
index 5568ac372..91688925e 100644
--- a/src/MapDrawingTools/index.test.js
+++ b/src/MapDrawingTools/index.test.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { render, screen } from '@testing-library/react';
+import { render, screen, waitFor } from '@testing-library/react';
import { createMapMock } from '../__test-helpers/mocks';
import { MapContext } from '../App';
@@ -48,15 +48,17 @@ describe('MapDrawingTools', () => {
points = [[1, 2], [2, 3], [3, 4], [1, 2]];
});
- test('creating map layers and sources', () => {
+ fit('creating map layers and sources', async () => {
render(
);
- expect(map.addSource).toHaveBeenCalled();
- expect(map.addLayer).toHaveBeenCalled();
+ await waitFor(() => {
+ expect(map.addSource).toHaveBeenCalled();
+ expect(map.addLayer).toHaveBeenCalled();
+ });
});
test('firing #onChange when the map is clicked', () => {
From 964d485c5a67a43ada9c0e812a7774fb9c2c1d46 Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 14:28:39 -0700
Subject: [PATCH 13/19] test coverage across the board
---
src/MapDrawingTools/index.test.js | 99 +++++++++++++++---------
src/hooks/index.js | 2 +-
src/hooks/index.test.js | 121 ++++++++++++++++++++++--------
3 files changed, 155 insertions(+), 67 deletions(-)
diff --git a/src/MapDrawingTools/index.test.js b/src/MapDrawingTools/index.test.js
index 91688925e..922e5e890 100644
--- a/src/MapDrawingTools/index.test.js
+++ b/src/MapDrawingTools/index.test.js
@@ -28,6 +28,12 @@ describe('MapDrawingTools', () => {
beforeEach(() => {
map = createMapMock();
drawing = true;
+
+ jest.useFakeTimers();
+ });
+
+ afterEach(() => {
+ jest.useRealTimers();
});
describe('with no point data', () => {
@@ -48,34 +54,33 @@ describe('MapDrawingTools', () => {
points = [[1, 2], [2, 3], [3, 4], [1, 2]];
});
- fit('creating map layers and sources', async () => {
+ test('adding a source for the draw data', () => {
+ map.getSource.mockReturnValue(null);
+
render(
);
- await waitFor(() => {
- expect(map.addSource).toHaveBeenCalled();
- expect(map.addLayer).toHaveBeenCalled();
- });
+ expect(map.addSource).toHaveBeenCalled();
+ expect(map.addLayer).not.toHaveBeenCalled();
});
- test('firing #onChange when the map is clicked', () => {
- const onChange = jest.fn();
+ test('adding a layer if the source exists', () => {
+ map.getSource.mockReturnValue({ whatever: 'yes' });
render(
-
+
);
- map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
-
- expect(onChange).toHaveBeenCalled();
+ expect(map.addSource).not.toHaveBeenCalled();
+ expect(map.addLayer).toHaveBeenCalled();
});
- test('only firing #onChange once on double click', () => {
+ test('firing #onChange when the map is clicked', async () => {
const onChange = jest.fn();
render(
@@ -84,13 +89,14 @@ describe('MapDrawingTools', () => {
);
- map.__test__.fireHandlers('dblclick', { lngLat: { lat: [2, 3], lng: [3, 4] } });
-
- expect(onChange).toHaveBeenCalledTimes(1);
+ map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
+ await waitFor(() => {
+ expect(onChange).toHaveBeenCalled();
+ });
});
- test('firing #onClickPoint when a drawn point is clicked', () => {
+ test('firing #onClickPoint when a drawn point is clicked', async () => {
const onClickPoint = jest.fn();
render(
@@ -101,10 +107,12 @@ describe('MapDrawingTools', () => {
map.__test__.fireHandlers('click', LAYER_IDS.POINTS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onClickPoint).toHaveBeenCalled();
+ await waitFor(() => {
+ expect(onClickPoint).toHaveBeenCalled();
+ });
});
- test('firing #onClickLine when a drawn line is clicked', () => {
+ test('firing #onClickLine when a drawn line is clicked', async () => {
const onClickLine = jest.fn();
render(
@@ -115,10 +123,12 @@ describe('MapDrawingTools', () => {
map.__test__.fireHandlers('click', LAYER_IDS.LINES, { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onClickLine).toHaveBeenCalled();
+ await waitFor(() => {
+ expect(onClickLine).toHaveBeenCalled();
+ });
});
- test('firing #onClickFill when a drawn polyon\'s fill is clicked', () => {
+ test('firing #onClickFill when a drawn polyon\'s fill is clicked', async () => {
const onClickFill = jest.fn();
render(
@@ -129,10 +139,12 @@ describe('MapDrawingTools', () => {
map.__test__.fireHandlers('click', LAYER_IDS.FILL, { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onClickFill).toHaveBeenCalled();
+ await waitFor(() => {
+ expect(onClickFill).toHaveBeenCalled();
+ });
});
- test('firing #onClickLabel when a drawn line\'s label is clicked', () => {
+ test('firing #onClickLabel when a drawn line\'s label is clicked', async () => {
const onClickLabel = jest.fn();
render(
@@ -143,10 +155,12 @@ describe('MapDrawingTools', () => {
map.__test__.fireHandlers('click', LAYER_IDS.LABELS, { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onClickLabel).toHaveBeenCalled();
+ await waitFor(() => {
+ expect(onClickLabel).toHaveBeenCalled();
+ });
});
- test('drawing a polygon when the draw mode is for polygons', () => {
+ test('drawing a polygon when the draw mode is for polygons', async () => {
const onChange = jest.fn();
render(
@@ -157,39 +171,54 @@ describe('MapDrawingTools', () => {
map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onChange).toHaveBeenCalledTimes(1);
- console.log('the geojson', onChange.mock.calls[0][1]);
+ await waitFor(() => {
+ expect(onChange).toHaveBeenCalledTimes(1);
+
+ const [, callbackData] = onChange.mock.calls[0];
+
+ expect(callbackData?.drawnLineSegments?.type).toBe('FeatureCollection');
+ expect(callbackData?.fillPolygon?.geometry?.type).toBe('Polygon');
+ });
});
- test('drawing a line when the draw mode is for lines', () => {
+ test('drawing a line when the draw mode is for lines', async () => {
const onChange = jest.fn();
render(
-
+
);
map.__test__.fireHandlers('click', { lngLat: { lat: [2, 3], lng: [3, 4] } });
- expect(onChange).toHaveBeenCalledTimes(1);
- console.log('the geojson', onChange.mock.calls[0][1]);
+ await waitFor(() => {
+ expect(onChange).toHaveBeenCalledTimes(1);
+
+ const [, callbackData] = onChange.mock.calls[0];
+
+ expect(callbackData.fillPolygon).not.toBeDefined();
+ expect(callbackData?.drawnLineSegments?.type).toBe('FeatureCollection');
+ });
});
});
describe('the cursor popup', () => {
test('rendering a cursor popup with point details when drawing and the mouse is moved', async () => {
- render(
+ const points = [[1, 2], [2, 3], [4, 5]];
+
+ const { container } = render(
);
- const popup = screen.findByTestId('drawing-tools-popup');
+ await waitFor(() => {
+ expect(container).toHaveTextContent('Bearing');
+ expect(container).toHaveTextContent('Distance');
+ expect(container).toHaveTextContent('Click to add a point');
+ });
- expect(popup).toHaveTextContent('Bearing');
- expect(popup).toHaveTextContent('Distance');
- expect(popup).toHaveTextContent('Click to add a point');
});
});
});
diff --git a/src/hooks/index.js b/src/hooks/index.js
index 99743423e..7347d936d 100644
--- a/src/hooks/index.js
+++ b/src/hooks/index.js
@@ -113,7 +113,7 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
const layer = map?.getLayer(layerId);
const before = useMemoCompare(config?.before || TOPMOST_STYLE_LAYER);
- const condition = useMemoCompare(config?.condition || true);
+ const condition = useMemoCompare(config.hasOwnProperty('condition') ? config.condition : true);
const filter = useMemoCompare(config?.filter);
const minzoom = useMemoCompare(config?.minZoom);
const maxzoom = useMemoCompare(config?.maxZoom);
diff --git a/src/hooks/index.test.js b/src/hooks/index.test.js
index 5f497f6e4..bd51cf00c 100644
--- a/src/hooks/index.test.js
+++ b/src/hooks/index.test.js
@@ -1,11 +1,13 @@
import React from 'react';
import { renderHook } from '@testing-library/react-hooks';
+import { point } from '@turf/helpers';
import { MapContext } from '../App';
import { createMapMock } from '../__test-helpers/mocks';
import { useMemoCompare, useMapEventBinding, useMapLayer, useMapSource } from './';
+import { waitFor } from '@testing-library/dom';
describe('#useMapEventBinding', () => {
let map, wrapper, handler;
@@ -17,7 +19,6 @@ describe('#useMapEventBinding', () => {
wrapper = ({ children }) => {children}; // eslint-disable-line react/display-name
});
- /* eventType = 'click', handlerFn = noop, layerId = null, condition = true */
test('binding a handler function', () => {
renderHook(() => useMapEventBinding('click', handler, layerId), { wrapper });
});
@@ -30,31 +31,62 @@ describe('#useMapEventBinding', () => {
test('binding and unbinding based on the "condition" argument', () => {
let condition = false;
const { rerender } = renderHook(() => useMapEventBinding('fakebindingname', handler, layerId, condition), { wrapper });
+
+ expect(map.on).not.toHaveBeenCalled();
+
condition = true;
- /* expect no calls */
rerender();
- /* expect map.on called */
+ expect(map.on).toHaveBeenCalledWith('fakebindingname', layerId, handler);
+
condition = false;
rerender();
- /* expect map.off called */
+
+ expect(map.off).toHaveBeenCalledWith('fakebindingname', layerId, handler);
});
});
});
describe('#useMapSource', () => {
- test('adding a source to the map', () => {
+ let map, data, wrapper;
+ const sourceId = 'source-id-ok';
+
+ beforeEach(() => {
+ map = createMapMock();
+ data = point([-1, -4]);
+ wrapper = ({ children }) => {children}; /* eslint-disable-line react/display-name */
+ });
+ test('adding a source to the map', async () => {
+ map.getSource.mockReturnValue(null);
+ renderHook(() => useMapSource(sourceId, data), { wrapper });
+
+ await waitFor(() => {
+ expect(map.addSource).toHaveBeenCalledWith(sourceId, {
+ type: 'geojson',
+ data,
+ });
+ });
});
- describe('@param config', () => {
+ test('@param config adds configuration to the source creation options', async () => {
+ const mockConfig = { type: 'bananas', hello: true };
+
+ map.getSource.mockReturnValue(null);
+
+ renderHook(() => useMapSource(sourceId, data, mockConfig), { wrapper });
+ await waitFor(() => {
+ expect(map.addSource).toHaveBeenCalledWith(sourceId, {
+ ...mockConfig,
+ data,
+ });
+ });
});
});
-/* layerId, type, sourceId, paint, layout, config */
describe('#useMapLayer', () => {
let wrapper, map;
@@ -78,6 +110,9 @@ describe('#useMapLayer', () => {
});
describe('when the layer is present', () => {
+ beforeEach(() => {
+ map.getLayer.mockReturnValue({ whatever: 'ok' });
+ });
test('setting and changing paint props', () => {
let paintObject = { value1: 'yellow', value2: 0.6 };
@@ -86,8 +121,6 @@ describe('#useMapLayer', () => {
expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
});
- expect(map.setPaintProperty);
-
paintObject = { whatever: true };
@@ -104,29 +137,24 @@ describe('#useMapLayer', () => {
const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, layoutObject), { wrapper });
Object.entries(layoutObject).forEach(([key, value]) => {
- expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ expect(map.setLayoutProperty).toHaveBeenCalledWith(layerId, key, value);
});
- expect(map.setPaintProperty);
-
layoutObject = { whatever: true };
rerender();
Object.entries(layoutObject).forEach(([key, value]) => {
- expect(map.setPaintProperty).toHaveBeenCalledWith(layerId, key, value);
+ expect(map.setLayoutProperty).toHaveBeenCalledWith(layerId, key, value);
});
});
test('returning the layer value', () => {
- const mockValue = { whatever: 'ok this works' };
-
- map.addLayer.mockReturnValue(mockValue);
const { result } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id'), { wrapper });
- expect(result.current).toEqual(mockValue);
+ expect(result.current).toEqual({ whatever: 'ok' });
});
test('removing a layer on unmount', () => {
@@ -152,7 +180,7 @@ describe('#useMapLayer', () => {
});
- test('.before sets and changes', () => {
+ test('.before sets and changes', async () => {
let before = null;
const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, { before }), { wrapper });
@@ -161,30 +189,61 @@ describe('#useMapLayer', () => {
rerender();
- expect(map.moveLayer).toHaveBeenCalledWith(layerId, 'how');
+ await waitFor(() => {
+ expect(map.moveLayer).toHaveBeenCalledWith(layerId, 'how');
+ });
});
- test('.maxZoom sets and changes', () => {
- const { rerender } = renderHook(() => useMapLayer(), { wrapper });
- });
+ test('zoom config sets and changes', () => {
+ const config = {
+ maxZoom: 15,
+ minZoom: 1
+ };
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, config), { wrapper });
+
+ expect(map.setLayerZoomRange).toHaveBeenCalledWith(layerId, 1, 15);
+
+ config.maxZoom = 20;
+
+ rerender();
+
+ expect(map.setLayerZoomRange).toHaveBeenCalledWith(layerId, 1, 20);
+
+ config.minZoom = 7;
+
+ rerender();
+
+ expect(map.setLayerZoomRange).toHaveBeenCalledWith(layerId, 7, 20);
- test('.minZoom sets and changes', () => {
- const { rerender } = renderHook(() => useMapLayer(), { wrapper });
});
describe('.condition', () => {
- test('sets and changes', () => {
- let condition = true;
+ fit('adds and removes a layer when toggled', async () => {
+ map.getLayer.mockReturnValue(undefined);
+
+ const config = { condition: false };
+
+ const { rerender } = renderHook(() => useMapLayer(layerId, 'string', 'whatever-source-id', null, null, config), { wrapper });
- const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+ expect(map.addLayer).not.toHaveBeenCalled();
- condition = false;
+ config.condition = true;
rerender();
- });
- test('adds and removes a layer when toggled', () => {
- const { rerender } = renderHook(() => useMapLayer(), { wrapper });
+ await waitFor(() => {
+ expect(map.removeLayer).not.toHaveBeenCalled();
+ expect(map.addLayer).toHaveBeenCalled();
+ });
+
+ map.getLayer.mockReturnValue({ whatever: 'ok' });
+ config.condition = false;
+
+ rerender();
+ await waitFor(() => {
+ expect(map.removeLayer).toHaveBeenCalled();
+ });
});
});
From ee0a97f6f3a5eea1d73095f36197ce690ff374b8 Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 14:32:44 -0700
Subject: [PATCH 14/19] guard clause for optional method
---
src/hooks/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/index.js b/src/hooks/index.js
index 7347d936d..b3c4d693e 100644
--- a/src/hooks/index.js
+++ b/src/hooks/index.js
@@ -113,7 +113,7 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
const layer = map?.getLayer(layerId);
const before = useMemoCompare(config?.before || TOPMOST_STYLE_LAYER);
- const condition = useMemoCompare(config.hasOwnProperty('condition') ? config.condition : true);
+ const condition = useMemoCompare(config.hasOwnProperty?.('condition') ? config.condition : true);
const filter = useMemoCompare(config?.filter);
const minzoom = useMemoCompare(config?.minZoom);
const maxzoom = useMemoCompare(config?.maxZoom);
From 008f6faed4ca6d9cd1f52f15e09abd610f1d96df Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 14:34:52 -0700
Subject: [PATCH 15/19] guard clause for optional method
---
src/hooks/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/index.js b/src/hooks/index.js
index b3c4d693e..2e9c5dbb4 100644
--- a/src/hooks/index.js
+++ b/src/hooks/index.js
@@ -113,7 +113,7 @@ export const useMapLayer = (layerId, type, sourceId, paint, layout, config) => {
const layer = map?.getLayer(layerId);
const before = useMemoCompare(config?.before || TOPMOST_STYLE_LAYER);
- const condition = useMemoCompare(config.hasOwnProperty?.('condition') ? config.condition : true);
+ const condition = useMemoCompare(config?.hasOwnProperty('condition') ? config.condition : true);
const filter = useMemoCompare(config?.filter);
const minzoom = useMemoCompare(config?.minZoom);
const maxzoom = useMemoCompare(config?.maxZoom);
From 98d5d8cb2eb8e36fbd97f8ba15d9cd6c140bcbed Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Thu, 11 Aug 2022 14:36:51 -0700
Subject: [PATCH 16/19] removing test focus
---
package.json | 10 +++++-----
src/hooks/index.test.js | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index 89aeac02c..453a5fd4a 100644
--- a/package.json
+++ b/package.json
@@ -93,10 +93,10 @@
"jest": {
"coverageThreshold": {
"global": {
- "branches": 33.03,
- "functions": 33.59,
- "lines": 45.82,
- "statements": 44.2
+ "branches": 37.11,
+ "functions": 37.74,
+ "lines": 49.51,
+ "statements": 48.01
}
},
"coverageReporters": [
@@ -115,4 +115,4 @@
"node-fetch": "2.6.7",
"immer": "9.0.6"
}
-}
+}
\ No newline at end of file
diff --git a/src/hooks/index.test.js b/src/hooks/index.test.js
index bd51cf00c..0ea051a41 100644
--- a/src/hooks/index.test.js
+++ b/src/hooks/index.test.js
@@ -219,7 +219,7 @@ describe('#useMapLayer', () => {
});
describe('.condition', () => {
- fit('adds and removes a layer when toggled', async () => {
+ test('adds and removes a layer when toggled', async () => {
map.getLayer.mockReturnValue(undefined);
const config = { condition: false };
From 437326bb7ae6dfde7513a922c3960c1d42efeabd Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Fri, 12 Aug 2022 15:14:29 -0700
Subject: [PATCH 17/19] bootstrap update to fix broken dropdowns
---
package.json | 2 +-
yarn.lock | 321 ++++++++++++++++++++++++---------------------------
2 files changed, 151 insertions(+), 172 deletions(-)
diff --git a/package.json b/package.json
index c8fddcbab..710b5f65d 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
"pluralize": "^8.0.0",
"prop-types": "^15.7.2",
"react": "^18.2.0",
- "react-bootstrap": "1.0.0",
+ "react-bootstrap": "1.6.4",
"react-collapsible": "^2.6.2",
"react-css-loaders": "^0.0.5",
"react-datepicker": "^4.7.0",
diff --git a/yarn.lock b/yarn.lock
index 056874309..76f941e5f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1043,7 +1043,7 @@
core-js-pure "^3.20.2"
regenerator-runtime "^0.13.4"
-"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
+"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.14.0", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.18.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a"
integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==
@@ -1587,10 +1587,10 @@
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
-"@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9":
- version "0.3.14"
- resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed"
- integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==
+"@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.9":
+ version "0.3.15"
+ resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774"
+ integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==
dependencies:
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
@@ -1711,23 +1711,30 @@
schema-utils "^3.0.0"
source-map "^0.7.3"
-"@popperjs/core@^2.0.0", "@popperjs/core@^2.9.2":
- version "2.11.5"
- resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.5.tgz#db5a11bf66bdab39569719555b0f76e138d7bd64"
- integrity sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==
+"@popperjs/core@^2.8.6", "@popperjs/core@^2.9.2":
+ version "2.11.6"
+ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45"
+ integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==
"@restart/context@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@restart/context/-/context-2.1.4.tgz#a99d87c299a34c28bd85bb489cb07bfd23149c02"
integrity sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==
-"@restart/hooks@^0.3.12", "@restart/hooks@^0.3.21":
+"@restart/hooks@^0.3.26":
version "0.3.27"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.3.27.tgz#91f356d66d4699a8cd8b3d008402708b6a9dc505"
integrity sha512-s984xV/EapUIfkjlf8wz9weP2O9TNKR96C68FfMEy2bE69+H4cNv3RD4Mf97lW7Htt7PjZrYTjSC8f3SB9VCXw==
dependencies:
dequal "^2.0.2"
+"@restart/hooks@^0.4.7":
+ version "0.4.7"
+ resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.4.7.tgz#d79ca6472c01ce04389fc73d4a79af1b5e33cd39"
+ integrity sha512-ZbjlEHcG+FQtpDPHd7i4FzNNvJf2enAwZfJbpM8CW7BhmOAbsHpZe3tsHwfQUrBuyrxWqPYp2x5UMnilWcY22A==
+ dependencies:
+ dequal "^2.0.2"
+
"@rollup/plugin-babel@^5.2.0":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283"
@@ -1771,9 +1778,9 @@
integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA==
"@sinclair/typebox@^0.24.1":
- version "0.24.27"
- resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.27.tgz#d55643516a1546174e10da681a8aaa81e757452d"
- integrity sha512-K7C7IlQ3zLePEZleUN21ceBA2aLcMnLHTLph8QWk1JK37L90obdpY+QGY8bXMKxf1ht1Z0MNewvXxWv0oGDYFg==
+ version "0.24.28"
+ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.28.tgz#15aa0b416f82c268b1573ab653e4413c965fe794"
+ integrity sha512-dgJd3HLOkLmz4Bw50eZx/zJwtBq65nms3N9VBYu5LTjJ883oBFkTyXRlCB/ZGGwqYpJJHA5zW2Ibhl5ngITfow==
"@sinonjs/commons@^1.7.0":
version "1.8.3"
@@ -1918,9 +1925,9 @@
loader-utils "^2.0.0"
"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.1.0":
- version "8.16.1"
- resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.16.1.tgz#96e528c9752d60061128f043e2b43566c0aba2d9"
- integrity sha512-XEV2mBxgv6DKjL3+U3WEUzBgT2CjYksoXGlLrrJXYP8OvRfGkBonvelkorazpFlp8tkEecO06r43vN4DIEyegQ==
+ version "8.17.1"
+ resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.17.1.tgz#2d7af4ff6dad8d837630fecd08835aee08320ad7"
+ integrity sha512-KnH2MnJUzmFNPW6RIKfd+zf2Wue8mEKX0M3cpX6aKl5ZXrJM1/c/Pc8c2xDNYQCnJO48Sm5ITbMXgqTr3h4jxQ==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.12.5"
@@ -3400,6 +3407,11 @@
dependencies:
"@types/node" "*"
+"@types/invariant@^2.2.33":
+ version "2.2.35"
+ resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.35.tgz#cd3ebf581a6557452735688d8daba6cf0bd5a3be"
+ integrity sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==
+
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
@@ -3460,9 +3472,9 @@
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
"@types/node@*":
- version "18.6.4"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39"
- integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg==
+ version "18.7.2"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.2.tgz#22306626110c459aedd2cdf131c749ec781e3b34"
+ integrity sha512-ce7MIiaYWCFv6A83oEultwhBXb22fxwNOQf5DIxWA4WXvDQ7K+L0fbWl/YOfCzlR5B/uFkSnVBhPcOfOECcWvA==
"@types/normalize-package-data@^2.4.0":
version "2.4.1"
@@ -3479,7 +3491,7 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc"
integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==
-"@types/prop-types@*":
+"@types/prop-types@*", "@types/prop-types@^15.7.3":
version "15.7.5"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
@@ -3516,7 +3528,14 @@
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"
-"@types/react@*", "@types/react@>=16.9.11":
+"@types/react-transition-group@^4.4.1":
+ version "4.4.5"
+ resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.5.tgz#aae20dcf773c5aa275d5b9f7cdbca638abc5e416"
+ integrity sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==
+ dependencies:
+ "@types/react" "*"
+
+"@types/react@*", "@types/react@>=16.14.8", "@types/react@>=16.9.11":
version "18.0.17"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4"
integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==
@@ -3525,15 +3544,6 @@
"@types/scheduler" "*"
csstype "^3.0.2"
-"@types/react@^16.9.23":
- version "16.14.30"
- resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.30.tgz#a1d83f73f4326798d65fe6b58cb4caeacee47623"
- integrity sha512-tG+xGtDDSuIl1l63mN0LnaROAc99knkYyN4YTheE80iPzYvSy0U8LVie+OBZkrgjVrpkQV6bMCkSphPBnVNk6g==
- dependencies:
- "@types/prop-types" "*"
- "@types/scheduler" "*"
- csstype "^3.0.2"
-
"@types/react@^17":
version "17.0.48"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.48.tgz#a4532a8b91d7b27b8768b6fc0c3bccb760d15a6c"
@@ -3650,13 +3660,13 @@
"@types/yargs-parser" "*"
"@typescript-eslint/eslint-plugin@^5.5.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.32.0.tgz#e27e38cffa4a61226327c874a7be965e9a861624"
- integrity sha512-CHLuz5Uz7bHP2WgVlvoZGhf0BvFakBJKAD/43Ty0emn4wXWv5k01ND0C0fHcl/Im8Td2y/7h44E9pca9qAu2ew==
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.33.0.tgz#059798888720ec52ffa96c5f868e31a8f70fa3ec"
+ integrity sha512-jHvZNSW2WZ31OPJ3enhLrEKvAZNyAFWZ6rx9tUwaessTc4sx9KmgMNhVcqVAl1ETnT5rU5fpXTLmY9YvC1DCNg==
dependencies:
- "@typescript-eslint/scope-manager" "5.32.0"
- "@typescript-eslint/type-utils" "5.32.0"
- "@typescript-eslint/utils" "5.32.0"
+ "@typescript-eslint/scope-manager" "5.33.0"
+ "@typescript-eslint/type-utils" "5.33.0"
+ "@typescript-eslint/utils" "5.33.0"
debug "^4.3.4"
functional-red-black-tree "^1.0.1"
ignore "^5.2.0"
@@ -3665,36 +3675,36 @@
tsutils "^3.21.0"
"@typescript-eslint/experimental-utils@^5.0.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.32.0.tgz#e3e664e7e00be2a3fb1a53c49b51b66c20fdd906"
- integrity sha512-/x72MkqLAoOQSOHFxdm17irJ1PNDWtdrMmfacaYniGT26nibak8vxEf9xmoVE+yTYL8N77I2icPtw89Yx6HvNg==
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-5.33.0.tgz#94ca44da43731f2c62d91eb0c75917588bc483a2"
+ integrity sha512-NvRsNe+T90QrSVlgdV9/U8/chfqGmShvKUE7hWZTAUUCF6hZty/R+eMPVGldKcUDq7uRQaK6+V8gv5OwVDqC+g==
dependencies:
- "@typescript-eslint/utils" "5.32.0"
+ "@typescript-eslint/utils" "5.33.0"
"@typescript-eslint/parser@^5.5.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.32.0.tgz#1de243443bc6186fb153b9e395b842e46877ca5d"
- integrity sha512-IxRtsehdGV9GFQ35IGm5oKKR2OGcazUoiNBxhRV160iF9FoyuXxjY+rIqs1gfnd+4eL98OjeGnMpE7RF/NBb3A==
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.33.0.tgz#26ec3235b74f0667414613727cb98f9b69dc5383"
+ integrity sha512-cgM5cJrWmrDV2KpvlcSkelTBASAs1mgqq+IUGKJvFxWrapHpaRy5EXPQz9YaKF3nZ8KY18ILTiVpUtbIac86/w==
dependencies:
- "@typescript-eslint/scope-manager" "5.32.0"
- "@typescript-eslint/types" "5.32.0"
- "@typescript-eslint/typescript-estree" "5.32.0"
+ "@typescript-eslint/scope-manager" "5.33.0"
+ "@typescript-eslint/types" "5.33.0"
+ "@typescript-eslint/typescript-estree" "5.33.0"
debug "^4.3.4"
-"@typescript-eslint/scope-manager@5.32.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.32.0.tgz#763386e963a8def470580cc36cf9228864190b95"
- integrity sha512-KyAE+tUON0D7tNz92p1uetRqVJiiAkeluvwvZOqBmW9z2XApmk5WSMV9FrzOroAcVxJZB3GfUwVKr98Dr/OjOg==
+"@typescript-eslint/scope-manager@5.33.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.33.0.tgz#509d7fa540a2c58f66bdcfcf278a3fa79002e18d"
+ integrity sha512-/Jta8yMNpXYpRDl8EwF/M8It2A9sFJTubDo0ATZefGXmOqlaBffEw0ZbkbQ7TNDK6q55NPHFshGBPAZvZkE8Pw==
dependencies:
- "@typescript-eslint/types" "5.32.0"
- "@typescript-eslint/visitor-keys" "5.32.0"
+ "@typescript-eslint/types" "5.33.0"
+ "@typescript-eslint/visitor-keys" "5.33.0"
-"@typescript-eslint/type-utils@5.32.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.32.0.tgz#45a14506fe3fb908600b4cef2f70778f7b5cdc79"
- integrity sha512-0gSsIhFDduBz3QcHJIp3qRCvVYbqzHg8D6bHFsDMrm0rURYDj+skBK2zmYebdCp+4nrd9VWd13egvhYFJj/wZg==
+"@typescript-eslint/type-utils@5.33.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.33.0.tgz#92ad1fba973c078d23767ce2d8d5a601baaa9338"
+ integrity sha512-2zB8uEn7hEH2pBeyk3NpzX1p3lF9dKrEbnXq1F7YkpZ6hlyqb2yZujqgRGqXgRBTHWIUG3NGx/WeZk224UKlIA==
dependencies:
- "@typescript-eslint/utils" "5.32.0"
+ "@typescript-eslint/utils" "5.33.0"
debug "^4.3.4"
tsutils "^3.21.0"
@@ -3703,18 +3713,18 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72"
integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ==
-"@typescript-eslint/types@5.32.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.32.0.tgz#484273021eeeae87ddb288f39586ef5efeb6dcd8"
- integrity sha512-EBUKs68DOcT/EjGfzywp+f8wG9Zw6gj6BjWu7KV/IYllqKJFPlZlLSYw/PTvVyiRw50t6wVbgv4p9uE2h6sZrQ==
+"@typescript-eslint/types@5.33.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.33.0.tgz#d41c584831805554b063791338b0220b613a275b"
+ integrity sha512-nIMt96JngB4MYFYXpZ/3ZNU4GWPNdBbcB5w2rDOCpXOVUkhtNlG2mmm8uXhubhidRZdwMaMBap7Uk8SZMU/ppw==
-"@typescript-eslint/typescript-estree@5.32.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.32.0.tgz#282943f34babf07a4afa7b0ff347a8e7b6030d12"
- integrity sha512-ZVAUkvPk3ITGtCLU5J4atCw9RTxK+SRc6hXqLtllC2sGSeMFWN+YwbiJR9CFrSFJ3w4SJfcWtDwNb/DmUIHdhg==
+"@typescript-eslint/typescript-estree@5.33.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.33.0.tgz#02d9c9ade6f4897c09e3508c27de53ad6bfa54cf"
+ integrity sha512-tqq3MRLlggkJKJUrzM6wltk8NckKyyorCSGMq4eVkyL5sDYzJJcMgZATqmF8fLdsWrW7OjjIZ1m9v81vKcaqwQ==
dependencies:
- "@typescript-eslint/types" "5.32.0"
- "@typescript-eslint/visitor-keys" "5.32.0"
+ "@typescript-eslint/types" "5.33.0"
+ "@typescript-eslint/visitor-keys" "5.33.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
@@ -3734,15 +3744,15 @@
semver "^7.3.5"
tsutils "^3.21.0"
-"@typescript-eslint/utils@5.32.0", "@typescript-eslint/utils@^5.13.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.32.0.tgz#eccb6b672b94516f1afc6508d05173c45924840c"
- integrity sha512-W7lYIAI5Zlc5K082dGR27Fczjb3Q57ECcXefKU/f0ajM5ToM0P+N9NmJWip8GmGu/g6QISNT+K6KYB+iSHjXCQ==
+"@typescript-eslint/utils@5.33.0", "@typescript-eslint/utils@^5.13.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.33.0.tgz#46797461ce3146e21c095d79518cc0f8ec574038"
+ integrity sha512-JxOAnXt9oZjXLIiXb5ZIcZXiwVHCkqZgof0O8KPgz7C7y0HS42gi75PdPlqh1Tf109M0fyUw45Ao6JLo7S5AHw==
dependencies:
"@types/json-schema" "^7.0.9"
- "@typescript-eslint/scope-manager" "5.32.0"
- "@typescript-eslint/types" "5.32.0"
- "@typescript-eslint/typescript-estree" "5.32.0"
+ "@typescript-eslint/scope-manager" "5.33.0"
+ "@typescript-eslint/types" "5.33.0"
+ "@typescript-eslint/typescript-estree" "5.33.0"
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"
@@ -3754,12 +3764,12 @@
"@typescript-eslint/types" "4.33.0"
eslint-visitor-keys "^2.0.0"
-"@typescript-eslint/visitor-keys@5.32.0":
- version "5.32.0"
- resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.32.0.tgz#b9715d0b11fdb5dd10fd0c42ff13987470525394"
- integrity sha512-S54xOHZgfThiZ38/ZGTgB2rqx51CMJ5MCfVT2IplK4Q7hgzGfe0nLzLCcenDnc/cSjP568hdeKfeDcBgqNHD/g==
+"@typescript-eslint/visitor-keys@5.33.0":
+ version "5.33.0"
+ resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.33.0.tgz#fbcbb074e460c11046e067bc3384b5d66b555484"
+ integrity sha512-/XsqCzD4t+Y9p5wd9HZiptuGKBlaZO5showwqODii5C0nZawxWLF+Q6k5wYHBrQv96h6GYKyqqMHCSTqta8Kiw==
dependencies:
- "@typescript-eslint/types" "5.32.0"
+ "@typescript-eslint/types" "5.33.0"
eslint-visitor-keys "^3.3.0"
"@webassemblyjs/ast@1.11.1":
@@ -4755,9 +4765,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
- version "1.0.30001374"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001374.tgz#3dab138e3f5485ba2e74bd13eca7fe1037ce6f57"
- integrity sha512-mWvzatRx3w+j5wx/mpFN5v5twlPrabG8NqX2c6e45LCpymdoGqNvRkRutFUqpRTXKFQFNQJasvK0YT7suW6/Hw==
+ version "1.0.30001375"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001375.tgz#8e73bc3d1a4c800beb39f3163bf0190d7e5d7672"
+ integrity sha512-kWIMkNzLYxSvnjy0hL8w1NOaWNr2rn39RTAVyIwcw8juu60bZDWiF1/loOYANzjtJmy6qPgNmn38ro5Pygagdw==
case-sensitive-paths-webpack-plugin@^2.4.0:
version "2.4.0"
@@ -4888,7 +4898,7 @@ cjs-module-lexer@^1.0.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==
-classnames@^2.2.5, classnames@^2.2.6:
+classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
@@ -5001,9 +5011,9 @@ color-name@^1.1.4, color-name@~1.1.4:
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
colord@^2.9.1:
- version "2.9.2"
- resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.2.tgz#25e2bacbbaa65991422c07ea209e2089428effb1"
- integrity sha512-Uqbg+J445nc1TKn4FoDPS6ZZqAvEDnwrH42yo8B40JSOgSLxMZ/gt3h4nmCtPLQeXhjJJkqBx7SCY35WnIixaQ==
+ version "2.9.3"
+ resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.3.tgz#4f8ce919de456f1d5c1c368c307fe20f3e59fb43"
+ integrity sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==
colorette@^2.0.10:
version "2.0.19"
@@ -5396,9 +5406,9 @@ cssnano-utils@^3.1.0:
integrity sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==
cssnano@^5.0.6:
- version "5.1.12"
- resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.12.tgz#bcd0b64d6be8692de79332c501daa7ece969816c"
- integrity sha512-TgvArbEZu0lk/dvg2ja+B7kYoD7BBCmn3+k58xD0qjrGHsFzXY/wKTo9M5egcUCabPol05e/PVoIu79s2JN4WQ==
+ version "5.1.13"
+ resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.13.tgz#83d0926e72955332dc4802a7070296e6258efc0a"
+ integrity sha512-S2SL2ekdEz6w6a2epXn4CmMKU4K3KpcyXLKfAYc9UQQqJRkD/2eLUG0vJ3Db/9OvO5GuAdgXw3pFbR6abqghDQ==
dependencies:
cssnano-preset-default "^5.2.12"
lilconfig "^2.0.3"
@@ -5852,7 +5862,7 @@ dom-converter@^0.2.0:
dependencies:
utila "~0.4"
-dom-helpers@^5.0.1, dom-helpers@^5.1.0, dom-helpers@^5.1.2:
+dom-helpers@^5.0.1, dom-helpers@^5.2.0, dom-helpers@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902"
integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==
@@ -5974,9 +5984,9 @@ ejs@^3.1.6:
jake "^10.8.5"
electron-to-chromium@^1.4.202:
- version "1.4.211"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.211.tgz#afaa8b58313807501312d598d99b953568d60f91"
- integrity sha512-BZSbMpyFQU0KBJ1JG26XGeFI3i4op+qOYGxftmZXFZoHkhLgsSv4DHDJfl8ogII3hIuzGt51PaZ195OVu0yJ9A==
+ version "1.4.217"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.217.tgz#f1f51b319435f4c1587a850806a0dfebe9774598"
+ integrity sha512-iX8GbAMij7cOtJPZo02CClpaPMWjvN5meqXiJXkBgwvraNWTNH0Z7F9tkznI34JRPtWASoPM/xWamq3oNb49GA==
emittery@^0.10.2:
version "0.10.2"
@@ -6228,12 +6238,11 @@ eslint-loader@3.0.2:
schema-utils "^2.2.0"
eslint-module-utils@^2.7.3:
- version "2.7.3"
- resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee"
- integrity sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==
+ version "2.7.4"
+ resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974"
+ integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==
dependencies:
debug "^3.2.7"
- find-up "^2.1.0"
eslint-plugin-flowtype@^8.0.3:
version "8.0.3"
@@ -6744,13 +6753,6 @@ find-up@^1.0.0:
path-exists "^2.0.0"
pinkie-promise "^2.0.0"
-find-up@^2.1.0:
- version "2.1.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7"
- integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==
- dependencies:
- locate-path "^2.0.0"
-
find-up@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
@@ -8713,12 +8715,12 @@ jsprim@^1.2.2:
verror "1.10.0"
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2:
- version "3.3.2"
- resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.2.tgz#afe5efe4332cd3515c065072bd4d6b0aa22152bd"
- integrity sha512-4ZCADZHRkno244xlNnn4AOG6sRQ7iBZ5BbgZ4vW4y5IZw7cVUD1PPeblm1xx/nfmMxPdt/LHsXZW8z/j58+l9Q==
+ version "3.3.3"
+ resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea"
+ integrity sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==
dependencies:
array-includes "^3.1.5"
- object.assign "^4.1.2"
+ object.assign "^4.1.3"
kdbush@^3.0.0:
version "3.0.0"
@@ -8843,14 +8845,6 @@ localforage@^1.7.3:
dependencies:
lie "3.1.1"
-locate-path@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
- integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==
- dependencies:
- p-locate "^2.0.0"
- path-exists "^3.0.0"
-
locate-path@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
@@ -9608,7 +9602,7 @@ object-keys@^1.1.1:
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
-object.assign@^4.1.0, object.assign@^4.1.2:
+object.assign@^4.1.0, object.assign@^4.1.2, object.assign@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.3.tgz#d36b7700ddf0019abb6b1df1bb13f6445f79051f"
integrity sha512-ZFJnX3zltyjcYJL0RoCJuzb+11zWGyaDbjgxZbdV7rFEcHQuYxrZqhow67aA7xpes6LhojyFDaBKAFfogQrikA==
@@ -9752,13 +9746,6 @@ outvariant@^1.2.1:
resolved "https://registry.yarnpkg.com/outvariant/-/outvariant-1.3.0.tgz#c39723b1d2cba729c930b74bf962317a81b9b1c9"
integrity sha512-yeWM9k6UPfG/nzxdaPlJkB2p08hCg4xP6Lx99F+vP8YF7xyZVfTmJjrrNalkmzudD4WFvNLVudQikqUmF8zhVQ==
-p-limit@^1.1.0:
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8"
- integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==
- dependencies:
- p-try "^1.0.0"
-
p-limit@^2.0.0, p-limit@^2.2.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
@@ -9773,13 +9760,6 @@ p-limit@^3.0.2:
dependencies:
yocto-queue "^0.1.0"
-p-locate@^2.0.0:
- version "2.0.0"
- resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
- integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==
- dependencies:
- p-limit "^1.1.0"
-
p-locate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
@@ -9809,11 +9789,6 @@ p-retry@^4.5.0:
"@types/retry" "0.12.0"
retry "^0.13.1"
-p-try@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3"
- integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==
-
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
@@ -10900,23 +10875,27 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"
-react-bootstrap@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.0.0.tgz#ed812810205e75b8e4a84b9514d79de090cdc627"
- integrity sha512-Ep6ZNH6wL5m9bytOS6T9mjSz0YE1bEkc+uHItvenRcA3amr5ApkpKYzAWgdglhRPZHPvm+pnqs1z5IPwv/2UZw==
+react-bootstrap@1.6.4:
+ version "1.6.4"
+ resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.6.4.tgz#94d5d2422e26bba277656d3529128e14f838b7ca"
+ integrity sha512-z3BhBD4bEZuLP8VrYqAD7OT7axdcSkkyvWBWnS2U/4MhyabUihrUyucPWkan7aMI1XIHbmH4LCpEtzWGfx/yfA==
dependencies:
- "@babel/runtime" "^7.4.2"
+ "@babel/runtime" "^7.14.0"
"@restart/context" "^2.1.4"
- "@restart/hooks" "^0.3.21"
- "@types/react" "^16.9.23"
- classnames "^2.2.6"
- dom-helpers "^5.1.2"
+ "@restart/hooks" "^0.3.26"
+ "@types/invariant" "^2.2.33"
+ "@types/prop-types" "^15.7.3"
+ "@types/react" ">=16.14.8"
+ "@types/react-transition-group" "^4.4.1"
+ "@types/warning" "^3.0.0"
+ classnames "^2.3.1"
+ dom-helpers "^5.2.1"
invariant "^2.2.4"
prop-types "^15.7.2"
prop-types-extra "^1.1.0"
- react-overlays "^3.0.1"
- react-transition-group "^4.0.0"
- uncontrollable "^7.0.0"
+ react-overlays "^5.1.1"
+ react-transition-group "^4.4.1"
+ uncontrollable "^7.2.1"
warning "^4.0.3"
react-collapsible@^2.6.2:
@@ -11121,18 +11100,18 @@ react-onclickoutside@^6.12.0:
resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz#8e6cf80c7d17a79f2c908399918158a7b02dda01"
integrity sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==
-react-overlays@^3.0.1:
- version "3.2.0"
- resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-3.2.0.tgz#ed8335adb0871e701b0fc8396c44dfd2467e7a55"
- integrity sha512-YTgCmw6l4uBOYylSnc3V8WLX+A0EoGnzDrqkYz0K7MUKbMBZFpaxLXH4EF9eZbspd+syZHQ5XAABI7n/zak1EA==
+react-overlays@^5.1.1:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-5.2.0.tgz#e7ebfdfdfbebd9d23cafd0bc2cac1d08abf1535b"
+ integrity sha512-dKZR/w6qeAsW0z0aIlwq/5H/M6o5T4RSlPnqIKqYVJ++rjoPSFcVggPhDWno8awZQsuMMtkjuksTbE8vOY0s9g==
dependencies:
- "@babel/runtime" "^7.4.5"
- "@popperjs/core" "^2.0.0"
- "@restart/hooks" "^0.3.12"
+ "@babel/runtime" "^7.13.8"
+ "@popperjs/core" "^2.8.6"
+ "@restart/hooks" "^0.4.7"
"@types/warning" "^3.0.0"
- dom-helpers "^5.1.0"
+ dom-helpers "^5.2.0"
prop-types "^15.7.2"
- uncontrollable "^7.0.0"
+ uncontrollable "^7.2.1"
warning "^4.0.3"
react-popper@^2.2.5:
@@ -11254,7 +11233,7 @@ react-toastify@^5.4.0:
prop-types "^15.7.2"
react-transition-group "^4"
-react-transition-group@^4, react-transition-group@^4.0.0, react-transition-group@^4.3.0:
+react-transition-group@^4, react-transition-group@^4.3.0, react-transition-group@^4.4.1:
version "4.4.5"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
integrity sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==
@@ -11684,9 +11663,9 @@ rollup-plugin-terser@^7.0.0:
terser "^5.0.0"
rollup@^2.43.1:
- version "2.77.2"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.2.tgz#6b6075c55f9cc2040a5912e6e062151e42e2c4e3"
- integrity sha512-m/4YzYgLcpMQbxX3NmAqDvwLATZzxt8bIegO78FZLl+lAgKJBd1DRAOeEiZcKOIOPjxE6ewHWHNgGEalFXuz1g==
+ version "2.77.3"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.3.tgz#8f00418d3a2740036e15deb653bed1a90ee0cc12"
+ integrity sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==
optionalDependencies:
fsevents "~2.3.2"
@@ -12708,17 +12687,17 @@ terminal-link@^2.0.0:
supports-hyperlinks "^2.0.0"
terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.2.5:
- version "5.3.3"
- resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.3.tgz#8033db876dd5875487213e87c627bca323e5ed90"
- integrity sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ==
+ version "5.3.4"
+ resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.4.tgz#f4d31e265883d20fda3ca9c0fc6a53f173ae62e3"
+ integrity sha512-SmnkUhBxLDcBfTIeaq+ZqJXLVEyXxSaNcCeSezECdKjfkMrTTnPvapBILylYwyEvHFZAn2cJ8dtiXel5XnfOfQ==
dependencies:
- "@jridgewell/trace-mapping" "^0.3.7"
+ "@jridgewell/trace-mapping" "^0.3.14"
jest-worker "^27.4.5"
schema-utils "^3.1.1"
serialize-javascript "^6.0.0"
- terser "^5.7.2"
+ terser "^5.14.1"
-terser@^5.0.0, terser@^5.10.0, terser@^5.7.2:
+terser@^5.0.0, terser@^5.10.0, terser@^5.14.1:
version "5.14.2"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.14.2.tgz#9ac9f22b06994d736174f4091aa368db896f1c10"
integrity sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==
@@ -13001,7 +12980,7 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"
-uncontrollable@^7.0.0:
+uncontrollable@^7.2.1:
version "7.2.1"
resolved "https://registry.yarnpkg.com/uncontrollable/-/uncontrollable-7.2.1.tgz#1fa70ba0c57a14d5f78905d533cf63916dc75738"
integrity sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==
@@ -13302,9 +13281,9 @@ webpack-dev-middleware@^5.3.1:
schema-utils "^4.0.0"
webpack-dev-server@^4.6.0:
- version "4.9.3"
- resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.3.tgz#2360a5d6d532acb5410a668417ad549ee3b8a3c9"
- integrity sha512-3qp/eoboZG5/6QgiZ3llN8TUzkSpYg1Ko9khWX1h40MIEUNS2mDoIa8aXsPfskER+GbTvs/IJZ1QTBBhhuetSw==
+ version "4.10.0"
+ resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.10.0.tgz#de270d0009eba050546912be90116e7fd740a9ca"
+ integrity sha512-7dezwAs+k6yXVFZ+MaL8VnE+APobiO3zvpp3rBHe/HmWQ+avwh0Q3d0xxacOiBybZZ3syTZw9HXzpa3YNbAZDQ==
dependencies:
"@types/bonjour" "^3.5.9"
"@types/connect-history-api-fallback" "^1.3.5"
From ee3ccf146491ef23e613c4b02346ee7cb2b23a34 Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Mon, 15 Aug 2022 09:07:37 -0700
Subject: [PATCH 18/19] undoing accidental lib updates in the wrong branch :-)
---
package.json | 6 +-
src/StaticSensorsLayer/index.js | 4 +-
src/index.js | 7 +-
yarn.lock | 158 ++++++++++++++------------------
4 files changed, 77 insertions(+), 98 deletions(-)
diff --git a/package.json b/package.json
index 710b5f65d..453a5fd4a 100644
--- a/package.json
+++ b/package.json
@@ -22,13 +22,13 @@
"mb-isochrone": "^0.1.0",
"pluralize": "^8.0.0",
"prop-types": "^15.7.2",
- "react": "^18.2.0",
- "react-bootstrap": "1.6.4",
+ "react": "^16.12.0",
+ "react-bootstrap": "1.0.0",
"react-collapsible": "^2.6.2",
"react-css-loaders": "^0.0.5",
"react-datepicker": "^4.7.0",
"react-debounce-render": "^6.0.0",
- "react-dom": "^18.2.0",
+ "react-dom": "^16.12.0",
"react-error-boundary": "^1.2.5",
"react-fast-compare": "^2.0.4",
"react-flip-toolkit": "^7.0.13",
diff --git a/src/StaticSensorsLayer/index.js b/src/StaticSensorsLayer/index.js
index 087c37edf..b0adf6f47 100644
--- a/src/StaticSensorsLayer/index.js
+++ b/src/StaticSensorsLayer/index.js
@@ -64,7 +64,7 @@ const StaticSensorsLayer = ({ isTimeSliderActive, showMapNames, simplifyMapDataO
const onSourceData = ({ sourceDataType, sourceId }) => {
if (sourceId === currentSourceId
&& sourceDataType !== 'metadata') {
- const features = map.queryRenderedFeatures({ layers: [currentBackgroundLayerId] });
+ const features = map.queryRenderedFeatures({ layers: [currentBackgroundLayerId, currentLayerId] });
addFeatureCollectionImagesToMap(featureCollection(features), { sdf: true });
}
};
@@ -74,7 +74,7 @@ const StaticSensorsLayer = ({ isTimeSliderActive, showMapNames, simplifyMapDataO
map.off('sourcedata', onSourceData);
};
}
- }, [currentBackgroundLayerId, map, currentSourceId]);
+ }, [currentBackgroundLayerId, currentLayerId, map, currentSourceId]);
/* add the marker's background image on load */
useEffect(() => {
diff --git a/src/index.js b/src/index.js
index 414c6df52..00baa7f76 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,5 +1,5 @@
import React, { lazy, Suspense, useEffect, useRef } from 'react';
-import { createRoot } from 'react-dom/client';
+import ReactDOM from 'react-dom';
import ReactGA from 'react-ga';
import { Provider } from 'react-redux';
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
@@ -69,10 +69,7 @@ const PathNormalizationRouteComponent = ({ location }) => {
return {localMatch};
};
-const root = createRoot(document.getElementById('root'));
-
-
-root.render(
+ReactDOM.render(
diff --git a/yarn.lock b/yarn.lock
index 76f941e5f..d1655dba7 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1043,7 +1043,7 @@
core-js-pure "^3.20.2"
regenerator-runtime "^0.13.4"
-"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.8", "@babel/runtime@^7.14.0", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
+"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.9", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.4", "@babel/runtime@^7.4.5", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.4", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.18.9"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a"
integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw==
@@ -1711,7 +1711,7 @@
schema-utils "^3.0.0"
source-map "^0.7.3"
-"@popperjs/core@^2.8.6", "@popperjs/core@^2.9.2":
+"@popperjs/core@^2.0.0", "@popperjs/core@^2.9.2":
version "2.11.6"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45"
integrity sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==
@@ -1721,20 +1721,13 @@
resolved "https://registry.yarnpkg.com/@restart/context/-/context-2.1.4.tgz#a99d87c299a34c28bd85bb489cb07bfd23149c02"
integrity sha512-INJYZQJP7g+IoDUh/475NlGiTeMfwTXUEr3tmRneckHIxNolGOW9CTq83S8cxq0CgJwwcMzMJFchxvlwe7Rk8Q==
-"@restart/hooks@^0.3.26":
+"@restart/hooks@^0.3.12", "@restart/hooks@^0.3.21":
version "0.3.27"
resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.3.27.tgz#91f356d66d4699a8cd8b3d008402708b6a9dc505"
integrity sha512-s984xV/EapUIfkjlf8wz9weP2O9TNKR96C68FfMEy2bE69+H4cNv3RD4Mf97lW7Htt7PjZrYTjSC8f3SB9VCXw==
dependencies:
dequal "^2.0.2"
-"@restart/hooks@^0.4.7":
- version "0.4.7"
- resolved "https://registry.yarnpkg.com/@restart/hooks/-/hooks-0.4.7.tgz#d79ca6472c01ce04389fc73d4a79af1b5e33cd39"
- integrity sha512-ZbjlEHcG+FQtpDPHd7i4FzNNvJf2enAwZfJbpM8CW7BhmOAbsHpZe3tsHwfQUrBuyrxWqPYp2x5UMnilWcY22A==
- dependencies:
- dequal "^2.0.2"
-
"@rollup/plugin-babel@^5.2.0":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283"
@@ -3407,11 +3400,6 @@
dependencies:
"@types/node" "*"
-"@types/invariant@^2.2.33":
- version "2.2.35"
- resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.35.tgz#cd3ebf581a6557452735688d8daba6cf0bd5a3be"
- integrity sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg==
-
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
@@ -3472,9 +3460,9 @@
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
"@types/node@*":
- version "18.7.2"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.2.tgz#22306626110c459aedd2cdf131c749ec781e3b34"
- integrity sha512-ce7MIiaYWCFv6A83oEultwhBXb22fxwNOQf5DIxWA4WXvDQ7K+L0fbWl/YOfCzlR5B/uFkSnVBhPcOfOECcWvA==
+ version "18.7.4"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.4.tgz#95baa50846ae112a7376869d49fec23b2506c69d"
+ integrity sha512-RzRcw8c0B8LzryWOR4Wj7YOTFXvdYKwvrb6xQQyuDfnlTxwYXGCV5RZ/TEbq5L5kn+w3rliHAUyRcG1RtbmTFg==
"@types/normalize-package-data@^2.4.0":
version "2.4.1"
@@ -3491,7 +3479,7 @@
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.0.tgz#ea03e9f0376a4446f44797ca19d9c46c36e352dc"
integrity sha512-RI1L7N4JnW5gQw2spvL7Sllfuf1SaHdrZpCHiBlCXjIlufi1SMNnbu2teze3/QE67Fg2tBlH7W+mi4hVNk4p0A==
-"@types/prop-types@*", "@types/prop-types@^15.7.3":
+"@types/prop-types@*":
version "15.7.5"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
@@ -3528,14 +3516,7 @@
hoist-non-react-statics "^3.3.0"
redux "^4.0.0"
-"@types/react-transition-group@^4.4.1":
- version "4.4.5"
- resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.5.tgz#aae20dcf773c5aa275d5b9f7cdbca638abc5e416"
- integrity sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==
- dependencies:
- "@types/react" "*"
-
-"@types/react@*", "@types/react@>=16.14.8", "@types/react@>=16.9.11":
+"@types/react@*", "@types/react@>=16.9.11":
version "18.0.17"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4"
integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ==
@@ -3544,6 +3525,15 @@
"@types/scheduler" "*"
csstype "^3.0.2"
+"@types/react@^16.9.23":
+ version "16.14.30"
+ resolved "https://registry.yarnpkg.com/@types/react/-/react-16.14.30.tgz#a1d83f73f4326798d65fe6b58cb4caeacee47623"
+ integrity sha512-tG+xGtDDSuIl1l63mN0LnaROAc99knkYyN4YTheE80iPzYvSy0U8LVie+OBZkrgjVrpkQV6bMCkSphPBnVNk6g==
+ dependencies:
+ "@types/prop-types" "*"
+ "@types/scheduler" "*"
+ csstype "^3.0.2"
+
"@types/react@^17":
version "17.0.48"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.48.tgz#a4532a8b91d7b27b8768b6fc0c3bccb760d15a6c"
@@ -4765,9 +4755,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001370, caniuse-lite@^1.0.30001373:
- version "1.0.30001375"
- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001375.tgz#8e73bc3d1a4c800beb39f3163bf0190d7e5d7672"
- integrity sha512-kWIMkNzLYxSvnjy0hL8w1NOaWNr2rn39RTAVyIwcw8juu60bZDWiF1/loOYANzjtJmy6qPgNmn38ro5Pygagdw==
+ version "1.0.30001376"
+ resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001376.tgz#af2450833e5a06873fbb030a9556ca9461a2736d"
+ integrity sha512-I27WhtOQ3X3v3it9gNs/oTpoE5KpwmqKR5oKPA8M0G7uMXh9Ty81Q904HpKUrM30ei7zfcL5jE7AXefgbOfMig==
case-sensitive-paths-webpack-plugin@^2.4.0:
version "2.4.0"
@@ -4898,7 +4888,7 @@ cjs-module-lexer@^1.0.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==
-classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1:
+classnames@^2.2.5, classnames@^2.2.6:
version "2.3.1"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e"
integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==
@@ -5567,9 +5557,9 @@ decamelize@^1.1.0, decamelize@^1.2.0:
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
decimal.js@^10.2.1:
- version "10.3.1"
- resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.3.1.tgz#d8c3a444a9c6774ba60ca6ad7261c3a94fd5e783"
- integrity sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==
+ version "10.4.0"
+ resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.0.tgz#97a7448873b01e92e5ff9117d89a7bca8e63e0fe"
+ integrity sha512-Nv6ENEzyPQ6AItkGwLE2PGKinZZ9g59vSh2BeH6NqPu0OTKZ5ruJsVqh/orbAnqXc9pBbgXAIrc2EyaCj8NpGg==
dedent@^0.7.0:
version "0.7.0"
@@ -5862,7 +5852,7 @@ dom-converter@^0.2.0:
dependencies:
utila "~0.4"
-dom-helpers@^5.0.1, dom-helpers@^5.2.0, dom-helpers@^5.2.1:
+dom-helpers@^5.0.1, dom-helpers@^5.1.0, dom-helpers@^5.1.2:
version "5.2.1"
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902"
integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==
@@ -5984,9 +5974,9 @@ ejs@^3.1.6:
jake "^10.8.5"
electron-to-chromium@^1.4.202:
- version "1.4.217"
- resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.217.tgz#f1f51b319435f4c1587a850806a0dfebe9774598"
- integrity sha512-iX8GbAMij7cOtJPZo02CClpaPMWjvN5meqXiJXkBgwvraNWTNH0Z7F9tkznI34JRPtWASoPM/xWamq3oNb49GA==
+ version "1.4.219"
+ resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.219.tgz#a7a672304b6aa4f376918d3f63a47f2c3906009a"
+ integrity sha512-zoQJsXOUw0ZA0YxbjkmzBumAJRtr6je5JySuL/bAoFs0DuLiLJ+5FzRF7/ZayihxR2QcewlRZVm5QZdUhwjOgA==
emittery@^0.10.2:
version "0.10.2"
@@ -6379,9 +6369,9 @@ eslint-webpack-plugin@^3.1.1:
schema-utils "^4.0.0"
eslint@^8.10.0, eslint@^8.3.0:
- version "8.21.0"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.21.0.tgz#1940a68d7e0573cef6f50037addee295ff9be9ef"
- integrity sha512-/XJ1+Qurf1T9G2M5IHrsjp+xrGT73RZf23xA1z5wB1ZzzEAWSZKvRwhWxTFp1rvkvCfwcvAUNAP31bhKTTGfDA==
+ version "8.22.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.22.0.tgz#78fcb044196dfa7eef30a9d65944f6f980402c48"
+ integrity sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==
dependencies:
"@eslint/eslintrc" "^1.3.0"
"@humanwhocodes/config-array" "^0.10.4"
@@ -10875,27 +10865,23 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"
-react-bootstrap@1.6.4:
- version "1.6.4"
- resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.6.4.tgz#94d5d2422e26bba277656d3529128e14f838b7ca"
- integrity sha512-z3BhBD4bEZuLP8VrYqAD7OT7axdcSkkyvWBWnS2U/4MhyabUihrUyucPWkan7aMI1XIHbmH4LCpEtzWGfx/yfA==
+react-bootstrap@1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/react-bootstrap/-/react-bootstrap-1.0.0.tgz#ed812810205e75b8e4a84b9514d79de090cdc627"
+ integrity sha512-Ep6ZNH6wL5m9bytOS6T9mjSz0YE1bEkc+uHItvenRcA3amr5ApkpKYzAWgdglhRPZHPvm+pnqs1z5IPwv/2UZw==
dependencies:
- "@babel/runtime" "^7.14.0"
+ "@babel/runtime" "^7.4.2"
"@restart/context" "^2.1.4"
- "@restart/hooks" "^0.3.26"
- "@types/invariant" "^2.2.33"
- "@types/prop-types" "^15.7.3"
- "@types/react" ">=16.14.8"
- "@types/react-transition-group" "^4.4.1"
- "@types/warning" "^3.0.0"
- classnames "^2.3.1"
- dom-helpers "^5.2.1"
+ "@restart/hooks" "^0.3.21"
+ "@types/react" "^16.9.23"
+ classnames "^2.2.6"
+ dom-helpers "^5.1.2"
invariant "^2.2.4"
prop-types "^15.7.2"
prop-types-extra "^1.1.0"
- react-overlays "^5.1.1"
- react-transition-group "^4.4.1"
- uncontrollable "^7.2.1"
+ react-overlays "^3.0.1"
+ react-transition-group "^4.0.0"
+ uncontrollable "^7.0.0"
warning "^4.0.3"
react-collapsible@^2.6.2:
@@ -10972,13 +10958,15 @@ react-dom@^15.5.4:
object-assign "^4.1.0"
prop-types "^15.5.10"
-react-dom@^18.2.0:
- version "18.2.0"
- resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
- integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
+react-dom@^16.12.0:
+ version "16.14.0"
+ resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89"
+ integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==
dependencies:
loose-envify "^1.1.0"
- scheduler "^0.23.0"
+ object-assign "^4.1.1"
+ prop-types "^15.6.2"
+ scheduler "^0.19.1"
react-error-boundary@^1.2.5:
version "1.2.5"
@@ -11100,18 +11088,18 @@ react-onclickoutside@^6.12.0:
resolved "https://registry.yarnpkg.com/react-onclickoutside/-/react-onclickoutside-6.12.2.tgz#8e6cf80c7d17a79f2c908399918158a7b02dda01"
integrity sha512-NMXGa223OnsrGVp5dJHkuKxQ4czdLmXSp5jSV9OqiCky9LOpPATn3vLldc+q5fK3gKbEHvr7J1u0yhBh/xYkpA==
-react-overlays@^5.1.1:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-5.2.0.tgz#e7ebfdfdfbebd9d23cafd0bc2cac1d08abf1535b"
- integrity sha512-dKZR/w6qeAsW0z0aIlwq/5H/M6o5T4RSlPnqIKqYVJ++rjoPSFcVggPhDWno8awZQsuMMtkjuksTbE8vOY0s9g==
+react-overlays@^3.0.1:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-3.2.0.tgz#ed8335adb0871e701b0fc8396c44dfd2467e7a55"
+ integrity sha512-YTgCmw6l4uBOYylSnc3V8WLX+A0EoGnzDrqkYz0K7MUKbMBZFpaxLXH4EF9eZbspd+syZHQ5XAABI7n/zak1EA==
dependencies:
- "@babel/runtime" "^7.13.8"
- "@popperjs/core" "^2.8.6"
- "@restart/hooks" "^0.4.7"
+ "@babel/runtime" "^7.4.5"
+ "@popperjs/core" "^2.0.0"
+ "@restart/hooks" "^0.3.12"
"@types/warning" "^3.0.0"
- dom-helpers "^5.2.0"
+ dom-helpers "^5.1.0"
prop-types "^15.7.2"
- uncontrollable "^7.2.1"
+ uncontrollable "^7.0.0"
warning "^4.0.3"
react-popper@^2.2.5:
@@ -11233,7 +11221,7 @@ react-toastify@^5.4.0:
prop-types "^15.7.2"
react-transition-group "^4"
-react-transition-group@^4, react-transition-group@^4.3.0, react-transition-group@^4.4.1:
+react-transition-group@^4, react-transition-group@^4.0.0, react-transition-group@^4.3.0:
version "4.4.5"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
integrity sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==
@@ -11243,7 +11231,7 @@ react-transition-group@^4, react-transition-group@^4.3.0, react-transition-group
loose-envify "^1.4.0"
prop-types "^15.6.2"
-"react@15.x.x - 16.x.x":
+"react@15.x.x - 16.x.x", react@^16.12.0:
version "16.14.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d"
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
@@ -11263,13 +11251,6 @@ react@^15.5.4:
object-assign "^4.1.0"
prop-types "^15.5.10"
-react@^18.2.0:
- version "18.2.0"
- resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
- integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
- dependencies:
- loose-envify "^1.1.0"
-
read-cache@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774"
@@ -11663,9 +11644,9 @@ rollup-plugin-terser@^7.0.0:
terser "^5.0.0"
rollup@^2.43.1:
- version "2.77.3"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.3.tgz#8f00418d3a2740036e15deb653bed1a90ee0cc12"
- integrity sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==
+ version "2.78.0"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.78.0.tgz#00995deae70c0f712ea79ad904d5f6b033209d9e"
+ integrity sha512-4+YfbQC9QEVvKTanHhIAFVUFSRsezvQF8vFOJwtGfb9Bb+r014S+qryr9PSmw8x6sMnPkmFBGAvIFVQxvJxjtg==
optionalDependencies:
fsevents "~2.3.2"
@@ -11750,12 +11731,13 @@ saxes@^5.0.1:
dependencies:
xmlchars "^2.2.0"
-scheduler@^0.23.0:
- version "0.23.0"
- resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
- integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
+scheduler@^0.19.1:
+ version "0.19.1"
+ resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
+ integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
dependencies:
loose-envify "^1.1.0"
+ object-assign "^4.1.1"
schema-utils@2.7.0:
version "2.7.0"
@@ -12980,7 +12962,7 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"
-uncontrollable@^7.2.1:
+uncontrollable@^7.0.0:
version "7.2.1"
resolved "https://registry.yarnpkg.com/uncontrollable/-/uncontrollable-7.2.1.tgz#1fa70ba0c57a14d5f78905d533cf63916dc75738"
integrity sha512-svtcfoTADIB0nT9nltgjujTi7BzVmwjZClOmskKu/E8FW9BXzg9os8OLr4f8Dlnk0rYWJIWr4wv9eKUXiQvQwQ==
From d228b941011af9b220a1260b09285831d0b7afe2 Mon Sep 17 00:00:00 2001
From: JoshuaVulcan <38018017+JoshuaVulcan@users.noreply.github.com>
Date: Mon, 15 Aug 2022 17:18:40 -0700
Subject: [PATCH 19/19] toggling drawing mode feature flag back to line
---
src/MapRulerControl/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/MapRulerControl/index.js b/src/MapRulerControl/index.js
index 32cacdbaa..d1db582cf 100644
--- a/src/MapRulerControl/index.js
+++ b/src/MapRulerControl/index.js
@@ -185,7 +185,7 @@ const MapRulerControl = (props) => {
{drawing && }
{!drawing && popupPointSelected && }
>}
- {active && }
+ {active && }
>;
};