Skip to content

Commit a0cb06b

Browse files
JannikBrackjannik brackcioddi
authored
Storybook changes (#220)
Fix - MlLayerSwitcher - useCameraFollowPath - MlVectorTileLayer - MlPdfForm - MlSpatialElevationProfile - MlThreeJsLayer - MlNavigationCompass Remove - MlComponentTemplate --------- Co-authored-by: jannik brack <[email protected]> Co-authored-by: Max Tobias Weber <[email protected]>
1 parent 991480c commit a0cb06b

File tree

13 files changed

+550
-3952
lines changed

13 files changed

+550
-3952
lines changed

package.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
"@emotion/react": "^11.14.0",
2929
"@emotion/styled": "^11.14.0",
3030
"@eslint/eslintrc": "^3.3.1",
31-
"@eslint/js": "^9.23.0",
31+
"@eslint/js": "^9.24.0",
3232
"@mapbox/mapbox-gl-draw": "1.4.3",
3333
"@mapbox/mapbox-gl-sync-move": "^0.3.1",
34-
"@mui/icons-material": "^7.0.0",
35-
"@mui/material": "^7.0.0",
34+
"@mui/icons-material": "^7.0.1",
35+
"@mui/material": "^7.0.1",
3636
"@reduxjs/toolkit": "^2.6.1",
3737
"@rollup/plugin-json": "^6.1.0",
38-
"@storybook/theming": "^8.6.11",
38+
"@storybook/theming": "^8.6.12",
3939
"@testing-library/dom": "^10.4.0",
4040
"@tmcw/togeojson": "^7.0.0",
4141
"@turf/turf": "^7.2.0",
@@ -56,7 +56,7 @@
5656
"react-redux": "^9.2.0",
5757
"redux": "^5.0.1",
5858
"redux-thunk": "^3.1.0",
59-
"three": "^0.174.0",
59+
"three": "^0.175.0",
6060
"topojson-client": "^3.1.0",
6161
"uuid": "^11.1.0",
6262
"wms-capabilities": "^0.6.0"
@@ -68,17 +68,17 @@
6868
"@rollup/plugin-babel": "^6.0.4",
6969
"@rollup/plugin-commonjs": "^28.0.3",
7070
"@rollup/plugin-url": "^8.0.2",
71-
"@storybook/addon-actions": "^8.6.11",
72-
"@storybook/addon-docs": "^8.6.11",
73-
"@storybook/addon-essentials": "^8.6.11",
74-
"@storybook/addon-links": "^8.6.11",
71+
"@storybook/addon-actions": "^8.6.12",
72+
"@storybook/addon-docs": "^8.6.12",
73+
"@storybook/addon-essentials": "^8.6.12",
74+
"@storybook/addon-links": "^8.6.12",
7575
"@storybook/addons": "^7.6.17",
76-
"@storybook/node-logger": "^8.6.11",
77-
"@storybook/react": "^8.6.11",
78-
"@storybook/react-webpack5": "^8.6.11",
79-
"@storybook/test": "^8.6.11",
76+
"@storybook/node-logger": "^8.6.12",
77+
"@storybook/react": "^8.6.12",
78+
"@storybook/react-webpack5": "^8.6.12",
79+
"@storybook/test": "^8.6.12",
8080
"@storybook/testing-react": "^2.0.1",
81-
"@testing-library/react": "^16.2.0",
81+
"@testing-library/react": "^16.3.0",
8282
"@types/chai": "^5.2.1",
8383
"@types/elasticlunr": "^0.9.5",
8484
"@types/enzyme": "^3.10.18",
@@ -89,13 +89,13 @@
8989
"@types/mapbox__vector-tile": "^2.0.0",
9090
"@types/mocha": "^10.0.10",
9191
"@types/pako": "^2.0.3",
92-
"@types/react": "^19.0.12",
93-
"@types/react-dom": "^19.0.4",
92+
"@types/react": "^19.1.0",
93+
"@types/react-dom": "^19.1.1",
9494
"@types/sql.js": "^1.4.9",
95-
"@types/three": "^0.174.0",
95+
"@types/three": "^0.175.0",
9696
"@types/uuid": "^10.0.0",
97-
"@typescript-eslint/eslint-plugin": "^8.28.0",
98-
"@typescript-eslint/parser": "^8.28.0",
97+
"@typescript-eslint/eslint-plugin": "^8.29.0",
98+
"@typescript-eslint/parser": "^8.29.0",
9999
"avj": "^0.0.0",
100100
"babel-jest": "^29.7.0",
101101
"babel-loader": "^10.0.0",
@@ -105,9 +105,9 @@
105105
"chai": "^5.2.0",
106106
"cypress": "^14.2.1",
107107
"elasticlunr": "^0.9.5",
108-
"eslint": "^9.23.0",
108+
"eslint": "^9.24.0",
109109
"eslint-config-prettier": "^10.1.1",
110-
"eslint-plugin-react": "^7.37.4",
110+
"eslint-plugin-react": "^7.37.5",
111111
"eslint-plugin-storybook": "^0.12.0",
112112
"glob": "^11.0.1",
113113
"jest": "29.7.0",
@@ -120,25 +120,25 @@
120120
"node-fetch": "^3.3.2",
121121
"postcss": "^8.5.3",
122122
"prettier": "3.5.3",
123-
"react": "^19.0.0",
123+
"react": "^19.1.0",
124124
"react-app-polyfill": "^3.0.0",
125125
"react-dev-utils": "^12.0.1",
126-
"react-dom": "^19.0.0",
126+
"react-dom": "^19.1.0",
127127
"react-draggable": "^4.4.6",
128128
"react-i18next": "^15.4.1",
129-
"rollup": "^4.37.0",
129+
"rollup": "^4.39.0",
130130
"rollup-plugin-delete": "^3.0.1",
131131
"rollup-plugin-import-css": "^3.5.8",
132132
"rollup-plugin-node-externals": "^8.0.0",
133133
"rollup-plugin-typescript2": "^0.36.0",
134134
"showdown": "^2.1.0",
135135
"sql.js": "^1.13.0",
136-
"storybook": "^8.6.11",
136+
"storybook": "^8.6.12",
137137
"storybook-source-link": "^4.0.1",
138-
"ts-jest": "^29.3.0",
138+
"ts-jest": "^29.3.1",
139139
"ts-loader": "^9.5.2",
140140
"ts-node": "^10.9.2",
141-
"typescript": "^5.8.2"
141+
"typescript": "^5.8.3"
142142
},
143143
"jest": {
144144
"roots": [
@@ -167,7 +167,7 @@
167167
"^.+\\.svg$": "<rootDir>/config/jest/fileTransform.js"
168168
},
169169
"transformIgnorePatterns": [
170-
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$",
170+
"[/\\\\]node_modules[/\\\\](?!three/examples/jsm/).+\\.(js|jsx|mjs|cjs|ts|tsx)$",
171171
"^.+\\.module\\.(css|sass|scss)$"
172172
],
173173
"modulePaths": [],

scripts/create-map-component.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ ! -d "$target_path$component_name" ]; then
2020

2121
mv $target_path$component_name/$template_name.meta_.json $target_path$component_name/$component_name.meta_.json
2222

23-
mv $target_path$component_name/$template_name.stories.tsx $target_path$component_name/$component_name.stories.tsx
23+
mv $target_path$component_name/$template_name.stories_.tsx $target_path$component_name/$component_name.stories.tsx
2424

2525
sed -i "s/$template_name/$component_name/g" $target_path$component_name/$component_name.tsx
2626
sed -i "s/$template_name/$component_name/g" $target_path$component_name/$component_name.meta_.json

src/components/MlComponentTemplate/MlComponentTemplate.stories.tsx renamed to src/components/MlComponentTemplate/MlComponentTemplate.stories_.tsx

File renamed without changes.

src/components/MlCreatePdfForm/MlCreatePdfForm.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const MlDialog = ({
4040
hideBackdrop={true}
4141
PaperComponent={PaperComponent}
4242
aria-labelledby="draggable-dialog-title"
43+
disableScrollLock
4344
sx={{
4445
justifyContent: 'flex-start',
4546
minHeight: '40px',

src/components/MlGpxViewer/util/MlGpxDemoLoader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const MlGpxDemoLoader = (props: MlGpxDemoLoaderProps) => {
8282
};
8383

8484
useEffect(() => {
85-
loadSample('assets/sample2.gpx');
85+
loadSample('assets/sample1.gpx');
8686
}, []);
8787

8888
return (
@@ -104,7 +104,7 @@ const MlGpxDemoLoader = (props: MlGpxDemoLoaderProps) => {
104104
</Grid>
105105
</Grid>
106106
<Divider />
107-
<Grid container>
107+
<Grid container key={"demo-container"}>
108108
<List>
109109
{samples.map((el, idx) => (
110110
<>

src/components/MlLayerSwitcher/MlLayerSwitcher.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ const MlLayerSwitcher: React.FC<MlLayerSwitcherProps> = (props) => {
145145
};
146146

147147
const changeLayerState = (layer: string, visible: 'none' | 'visible' = 'none') => {
148-
mapContext.map?.setLayoutProperty(layer, 'visibility', visible);
148+
if (mapContext.map?.getLayer(layer)) {
149+
mapContext.map.setLayoutProperty(layer, 'visibility', visible);
150+
} else {
151+
console.warn(`Layer "${layer}" does not exist on the map.`);
152+
}
149153
};
150154

151155
return (

src/components/MlNavigationCompass/MlNavigationCompass.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CatalogueDemo.args = {
1717
position: { xs: 'absolute' },
1818
transform: { xs: 'scale(4)' },
1919
left: { xs: '75%', sm: '65%', md: '55%' },
20-
top: { xs: '50%', md: '55%' },
20+
top: { xs: '50%', md: '75%' },
2121
},
2222
};
2323
export const StyleExample = Template.bind({});

src/components/MlThreeJsLayer/MlThreeJsLayer.stories.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Button from '@mui/material/Button';
55
import MlThreeJsLayer from './MlThreeJsLayer';
66
import { LoadingOverlayContext } from '../../ui_components/LoadingOverlayContext';
77
import MlNavigationTools from '../MlNavigationTools/MlNavigationTools';
8+
import { useMap } from '../../index';
89

910
const storyoptions = {
1011
title: 'MapComponents/MlThreeJsLayer',
@@ -28,6 +29,10 @@ const Template = () => {
2829
setLoadingDone?: (done: boolean) => void;
2930
};
3031

32+
const mapHook = useMap();
33+
mapHook.map?.setZoom(14.5);
34+
mapHook.map?.setCenter([7.1, 50.736]);
35+
3136
return (
3237
<>
3338
{showLayer &&

src/components/MlThreeJsLayer/MlThreeJsLayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useContext, useRef, useEffect } from 'react';
22
import MapContext from '../../contexts/MapContext';
33
import maplibregl, { CustomLayerInterface, LngLatLike, Map } from 'maplibre-gl';
44
import * as THREE from 'three';
5-
import GLTFLoader from './lib/GLTFLoader';
5+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
66
import MapLibreGlWrapper from '../MapLibreMap/lib/MapLibreGlWrapper';
77

88
/**

0 commit comments

Comments
 (0)