Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlkoch committed May 27, 2024
1 parent 757d032 commit 30d9b90
Show file tree
Hide file tree
Showing 13 changed files with 963 additions and 1,012 deletions.
3 changes: 2 additions & 1 deletion jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module.exports = {
'<rootDir>/dist/'
],
transformIgnorePatterns: [
'node_modules/(?!(ol|@camptocamp/inkmap|@terrestris/react-util|d3-selection|color-*[a-z]*)|(rc-*[a-z]*)/)'
'node_modules/(?!(ol|@camptocamp/inkmap|@terrestris/*[a-z]*-util|d3-selection|color-*[a-z]*)|(rc-*[a-z]*)|' +
'filter-obj|query-string|decode-uri-component|split-on-first|shpjs/)'
],
setupFiles: [
'<rootDir>/jest/__mocks__/matchMediaMock.js'
Expand Down
1,864 changes: 904 additions & 960 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"pretest": "npm run typecheck && npm run lint",
"start:styleguide": "styleguidist server",
"test": "npm run test:jest",
"test:jest": "jest --maxWorkers=4 --coverage -c jest.config.cjs",
"test:jest": "jest --maxWorkers=50% --coverage -c jest.config.cjs",
"test:watch": "jest --watchAll -c jest.config.cjs",
"typecheck": "tsc --noEmit --project tsconfig.json"
},
Expand All @@ -72,47 +72,47 @@
"@fortawesome/free-brands-svg-icons": "^6.5.2",
"@fortawesome/free-regular-svg-icons": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@terrestris/base-util": "^1.1.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@terrestris/base-util": "^2.0.0",
"@terrestris/ol-util": ">=18",
"@terrestris/react-util": "^5.2.0",
"@terrestris/react-util": "^6.0.2",
"@types/geojson": "^7946.0.14",
"@types/lodash": "^4.17.1",
"ag-grid-community": "^31.3.1",
"ag-grid-react": "^31.3.1",
"@types/lodash": "^4.17.4",
"ag-grid-community": "^31.3.2",
"ag-grid-react": "^31.3.2",
"jspdf": "^2.5.1",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"proj4": "^2.11.0",
"prop-types": "^15.8.1"
},
"devDependencies": {
"@babel/cli": "^7.24.5",
"@babel/core": "^7.24.5",
"@babel/eslint-parser": "^7.24.5",
"@babel/cli": "^7.24.6",
"@babel/core": "^7.24.6",
"@babel/eslint-parser": "^7.24.6",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@babel/plugin-transform-modules-commonjs": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@babel/preset-react": "^7.24.6",
"@babel/preset-typescript": "^7.24.6",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@terrestris/eslint-config-typescript": "^5.0.0",
"@terrestris/eslint-config-typescript-react": "^2.0.0",
"@terrestris/ol-util": "^18.0.0",
"@terrestris/ol-util": "^19.0.0",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.6",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.10",
"@types/react": "^18.3.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"antd": "^5.17.0",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"antd": "^5.17.4",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"babel-plugin-dynamic-import-node": "^2.3.3",
Expand All @@ -122,7 +122,7 @@
"copy-to-clipboard": "^3.3.3",
"copy-webpack-plugin": "^12.0.2",
"copyfiles": "^2.4.1",
"css-loader": "^7.1.1",
"css-loader": "^7.1.2",
"eslint": "^8.57.0",
"eslint-plugin-jest-dom": "^5.4.0",
"eslint-plugin-markdown": "^5.0.0",
Expand All @@ -138,14 +138,14 @@
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"less-loader": "^12.2.0",
"ol": "^9.1.0",
"ol": "^9.2.3",
"ol-mapbox-style": "^12.3.2",
"react": "^18.3.1",
"react-docgen-typescript": "^2.2.2",
"react-dom": "^18.3.1",
"react-styleguidist": "^13.1.2",
"rimraf": "^5.0.5",
"semantic-release": "^23.0.8",
"semantic-release": "^23.1.1",
"style-loader": "^4.0.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "^5.4.5",
Expand Down
11 changes: 6 additions & 5 deletions src/Button/CopyButton/CopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import {
UseSelectFeaturesProps
} from '@terrestris/react-util/dist/Hooks/useSelectFeatures/useSelectFeatures';
import { DigitizeUtil } from '@terrestris/react-util/dist/Util/DigitizeUtil';
import OlFeature from 'ol/Feature';
import OlFeature, {
FeatureLike as OlFeatureLike
} from 'ol/Feature';
import { SelectEvent as OlSelectEvent } from 'ol/interaction/Select';
import OlVectorLayer from 'ol/layer/Vector';
import OlVectorSource from 'ol/source/Vector';
import OlLayerVector from 'ol/layer/Vector';
import OlStyle from 'ol/style/Style';
import React, {
useCallback,
Expand All @@ -24,7 +25,7 @@ interface OwnProps {
* The vector layer which will be used for digitize features.
* The standard digitizeLayer can be retrieved via `DigitizeUtil.getDigitizeLayer(map)`.
*/
digitizeLayer?: OlVectorLayer<OlVectorSource<OlFeature>>;
digitizeLayer?: OlLayerVector<OlFeature>;
/**
* Listener function for the 'select' event of the ol.interaction.Select
* if in `Copy` mode.
Expand Down Expand Up @@ -76,7 +77,7 @@ const CopyButton: React.FC<CopyButtonProps> = ({

AnimateUtil.moveFeature(
map,
layer,
layer as OlLayerVector<OlFeatureLike>,
copy,
500,
50,
Expand Down
3 changes: 1 addition & 2 deletions src/Button/DeleteButton/DeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { DigitizeUtil } from '@terrestris/react-util/dist/Util/DigitizeUtil';
import OlFeature from 'ol/Feature';
import { SelectEvent as OlSelectEvent } from 'ol/interaction/Select';
import OlVectorLayer from 'ol/layer/Vector';
import OlVectorSource from 'ol/source/Vector';
import * as React from 'react';
import {useCallback, useMemo} from 'react';

Expand All @@ -20,7 +19,7 @@ interface OwnProps {
* The vector layer which will be used for digitize features.
* The standard digitizeLayer can be retrieved via `DigitizeUtil.getDigitizeLayer(map)`.
*/
digitizeLayer?: OlVectorLayer<OlVectorSource<OlFeature>>;
digitizeLayer?: OlVectorLayer<OlFeature>;
/**
* Listener function for the 'select' event of the ol.interaction.Select
* if in `Delete` mode.
Expand Down
4 changes: 2 additions & 2 deletions src/Button/SelectFeaturesButton/SelectFeaturesButton.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ describe('<SelectFeaturesButton />', () => {

const coord = [829729, 6708850];
let map: OlMap;
let layer: OlVectorLayer<OlVectorSource>;
let feature: OlFeature<OlPoint>;
let layer: OlVectorLayer<OlFeature>;
let feature: OlFeature;

beforeEach(() => {
feature = new OlFeature(new OlPoint(coord));
Expand Down
2 changes: 1 addition & 1 deletion src/Container/AddWmsPanel/AddWmsPanel.example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ The capabilities of this WMS are fetched and parsed to OL layer instances using
An `AddWmsPanel` shows a list of the parsed layers and each checked layer (or the entire set) can be added to the map.

```jsx
import { WmsLayer } from '@terrestris/ol-util';
import CapabilitiesUtil from '@terrestris/ol-util/dist/CapabilitiesUtil/CapabilitiesUtil';
import SimpleButton from '@terrestris/react-geo/dist/Button/SimpleButton/SimpleButton';
import AddWmsPanel from '@terrestris/react-geo/dist/Container/AddWmsPanel/AddWmsPanel';
import MapComponent from '@terrestris/react-geo/dist/Map/MapComponent/MapComponent';
import MapContext from '@terrestris/react-util/dist/Context/MapContext/MapContext';
import useMap from '@terrestris/react-util/dist/Hooks/useMap/useMap';
import { WmsLayer } from '@terrestris/ol-util';
import OlLayerTile from 'ol/layer/Tile';
import OlMap from 'ol/Map';
import { fromLonLat } from 'ol/proj';
Expand Down
7 changes: 3 additions & 4 deletions src/Container/AddWmsPanel/AddWmsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Logger from '@terrestris/base-util/dist/Logger';
import { WmsLayer } from '@terrestris/ol-util';
import useMap from '@terrestris/react-util/dist/Hooks/useMap/useMap';
import { Checkbox } from 'antd';
import { CheckboxValueType } from 'antd/lib/checkbox/Group';
import React, { useState } from 'react';

import SimpleButton from '../../Button/SimpleButton/SimpleButton';
Expand Down Expand Up @@ -63,8 +62,8 @@ export const AddWmsPanel: React.FC<AddWmsPanelProps> = ({

const map = useMap();

const onSelectedLayersChange = (selection: CheckboxValueType[]) => {
const newSelection = selection.map(s => s as string);
const onSelectedLayersChange = (selection: string[]) => {
const newSelection = selection.map(s => s);
onSelectionChange(newSelection);
setSelectedWmsLayers(newSelection);
};
Expand Down Expand Up @@ -122,7 +121,7 @@ export const AddWmsPanel: React.FC<AddWmsPanelProps> = ({
<div role="listitem" key={idx}>
<AddWmsLayerEntry
wmsLayer={layer}
map={map}
map={map || undefined}
/>
</div>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ const CoordinateReferenceSystemCombo: FC<CRSComboProps> = ({
...passThroughOpts
}) => {

const [projectionDefinitions, setProjectionDefinitions] = useState<Record<string, ProjectionDefinition>>({});
const [projectionDefinitions, setProjectionDefinitions] = useState<Record<string,
ProjectionDefinition | undefined>>({});
const [searchValue, setSearchValue] = useState<string>();
const [selected, setSelected] = useState<ProjectionDefinition>();

Expand Down Expand Up @@ -95,7 +96,7 @@ const CoordinateReferenceSystemCombo: FC<CRSComboProps> = ({
* @param option The selected OptionData
*/
const onCrsItemSelect = (_: string, option: DefaultOptionType) => {
const selectedProjection = _find(crsObjects, (p: ProjectionDefinition) => p.code === option.code);
const selectedProjection = _find(crsObjects, (p?: ProjectionDefinition) => p?.code === option.code);
setSelected(selectedProjection);
if (!_isNil(selectedProjection)) {
setSearchValue(undefined);
Expand All @@ -110,7 +111,11 @@ const CoordinateReferenceSystemCombo: FC<CRSComboProps> = ({
*
* @return Option component to render
*/
const transformCrsObjectsToOptions = ([, projDefinition]: [string, ProjectionDefinition]) => {
const transformCrsObjectsToOptions = ([, projDefinition]: [string, ProjectionDefinition | undefined]) => {
if (!projDefinition) {
return;
}

const epsgDescription = getEpsgDescription(projDefinition);
return (
<Option
Expand Down
9 changes: 4 additions & 5 deletions src/Grid/AgFeatureGrid/AgFeatureGrid.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import OlGeometry from 'ol/geom/Geometry';
import OlGeomGeometryCollection from 'ol/geom/GeometryCollection';
import OlLayerVector from 'ol/layer/Vector';
import OlMap from 'ol/Map';
import OlSourceVector from 'ol/source/Vector';
import OlStyle from 'ol/style/Style';
import React from 'react';

Expand Down Expand Up @@ -78,7 +77,7 @@ describe('<AgFeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

expect((layerCand as OlLayerVector<OlSourceVector>)?.getStyle()).toBe(featureStyle);
expect((layerCand as OlLayerVector<OlFeature>)?.getStyle()).toBe(featureStyle);
});

it('removes the vector layer from the map on unmount', () => {
Expand All @@ -104,7 +103,7 @@ describe('<AgFeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

expect((layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures()).toHaveLength(3);
expect((layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures()).toHaveLength(3);

data.forEach( ({ name }) => {
expect(screen.getByText(name)).toBeVisible();
Expand Down Expand Up @@ -153,7 +152,7 @@ describe('<AgFeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

const feats = (layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures() || [];
const feats = (layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures() || [];

for (const feat of feats) {
expect(feat.getStyle()).toBeDefined(); // TODO
Expand Down Expand Up @@ -187,7 +186,7 @@ describe('<AgFeatureGrid />', () => {
await userEvent.hover(row);

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);
const featCand = (layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures()
const featCand = (layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures()
.find(feat => feat.get('name') === 'Shinji Kagawa');

expect(featCand?.getStyle()).toBe(hoverStyle);
Expand Down
9 changes: 4 additions & 5 deletions src/Grid/FeatureGrid/FeatureGrid.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import userEvent from '@testing-library/user-event';
import OlFeature from 'ol/Feature';
import OlLayerVector from 'ol/layer/Vector';
import OlMap from 'ol/Map';
import OlSourceVector from 'ol/source/Vector';
import OlStyle from 'ol/style/Style';
import React from 'react';

Expand Down Expand Up @@ -78,7 +77,7 @@ describe('<FeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

expect((layerCand as OlLayerVector<OlSourceVector>)?.getStyle()).toBe(featureStyle);
expect((layerCand as OlLayerVector<OlFeature>)?.getStyle()).toBe(featureStyle);
});

it('removes the vector layer from the map on unmount', () => {
Expand All @@ -104,7 +103,7 @@ describe('<FeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

expect((layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures()).toHaveLength(3);
expect((layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures()).toHaveLength(3);

expect(screen.getByText('Shinji Kagawa')).toBeVisible();
expect(screen.getByText('Marco Reus')).toBeVisible();
Expand Down Expand Up @@ -139,7 +138,7 @@ describe('<FeatureGrid />', () => {
await userEvent.hover(row);

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);
const featCand = (layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures()
const featCand = (layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures()
.find(feat => feat.get('name') === 'Shinji Kagawa');

expect(featCand?.getStyle()).toBe(hoverStyle);
Expand All @@ -166,7 +165,7 @@ describe('<FeatureGrid />', () => {

const layerCand = map.getLayers().getArray().find(layer => layer.get('name') === defaultFeatureGridLayerName);

const feats = (layerCand as OlLayerVector<OlSourceVector>)?.getSource()?.getFeatures() || [];
const feats = (layerCand as OlLayerVector<OlFeature>)?.getSource()?.getFeatures() || [];

for (const feat of feats) {
expect(feat.getStyle()).toBe(selectStyle);
Expand Down
4 changes: 4 additions & 0 deletions src/LayerTree/LayerTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const LayerTree: React.FC<LayerTreeProps> = ({
}, []);

const treeNodeFromLayer = useCallback((layer: OlLayerBase) => {
if (!map) {
return;
}

let childNodes: TreeDataNode[] = [];

if (filterFunction && [layer].filter(filterFunction).length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/Panel/SearchResultsPanel/SearchResultsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface SearchResultsPanelProps extends Partial<CollapseProps> {
}

const SearchResultsPanel = (props: SearchResultsPanelProps) => {
const [highlightLayer, setHighlightLayer] = useState<OlLayerVector<OlSourceVector> | null>(null);
const [highlightLayer, setHighlightLayer] = useState<OlLayerVector<OlFeature> | null>(null);
const map = useMap();

const {
Expand Down

0 comments on commit 30d9b90

Please sign in to comment.