@eeacms/volto-eea-map 2.0.2 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/docker-compose.yml +5 -1
- package/package.json +1 -1
- package/src/components/Blocks/EmbedEEAMap/Edit.jsx +23 -0
- package/src/components/Blocks/EmbedEEAMap/Schema.js +0 -2
- package/src/components/Blocks/EmbedEEAMap/View.jsx +1 -1
- package/src/components/Webmap.jsx +27 -12
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [2.0.5](https://github.com/eea/volto-eea-map/compare/2.0.4...2.0.5) - 23 August 2023
|
|
8
|
+
|
|
9
|
+
#### :bug: Bug Fixes
|
|
10
|
+
|
|
11
|
+
- fix: remove height on PP [Andrei Grigore - [`9039dd5`](https://github.com/eea/volto-eea-map/commit/9039dd5b037c0f3dcdf44bc74f2b58bbb525f0e4)]
|
|
12
|
+
|
|
13
|
+
### [2.0.4](https://github.com/eea/volto-eea-map/compare/2.0.3...2.0.4) - 23 August 2023
|
|
14
|
+
|
|
15
|
+
#### :bug: Bug Fixes
|
|
16
|
+
|
|
17
|
+
- fix: remove height on PP [Andrei Grigore - [`ee786bf`](https://github.com/eea/volto-eea-map/commit/ee786bf82281acac87050916992fe4735b2e94a7)]
|
|
18
|
+
|
|
19
|
+
#### :hammer_and_wrench: Others
|
|
20
|
+
|
|
21
|
+
- test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`ce5c385`](https://github.com/eea/volto-eea-map/commit/ce5c3857ebbeac1d3e9e53dbbcd432a796bdee9c)]
|
|
22
|
+
### [2.0.3](https://github.com/eea/volto-eea-map/compare/2.0.2...2.0.3) - 16 August 2023
|
|
23
|
+
|
|
24
|
+
#### :bug: Bug Fixes
|
|
25
|
+
|
|
26
|
+
- fix: fullscreen changes parent height #256519 [andreiggr - [`f4c4183`](https://github.com/eea/volto-eea-map/commit/f4c4183a2f7523dd2fc6957e4cc967d100be2b45)]
|
|
27
|
+
|
|
7
28
|
### [2.0.2](https://github.com/eea/volto-eea-map/compare/2.0.1...2.0.2) - 14 August 2023
|
|
8
29
|
|
|
9
30
|
#### :bug: Bug Fixes
|
package/docker-compose.yml
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
version: "3"
|
|
2
2
|
services:
|
|
3
3
|
backend:
|
|
4
|
-
image:
|
|
4
|
+
image: eeacms/plone-backend
|
|
5
5
|
ports:
|
|
6
6
|
- "8080:8080"
|
|
7
7
|
environment:
|
|
8
8
|
SITE: "Plone"
|
|
9
|
+
PROFILES: "eea.kitkat:testing"
|
|
9
10
|
|
|
10
11
|
frontend:
|
|
11
12
|
build:
|
|
@@ -23,6 +24,9 @@ services:
|
|
|
23
24
|
volumes:
|
|
24
25
|
- ./:/app/src/addons/${ADDON_PATH}
|
|
25
26
|
environment:
|
|
27
|
+
CI: "true"
|
|
28
|
+
NODE_ENV: "development"
|
|
29
|
+
RAZZLE_JEST_CONFIG: "src/addons/${ADDON_PATH}/jest-addon.config.js"
|
|
26
30
|
RAZZLE_INTERNAL_API_PATH: "http://backend:8080/Plone"
|
|
27
31
|
RAZZLE_DEV_PROXY_API_PATH: "http://backend:8080/Plone"
|
|
28
32
|
HOST: "0.0.0.0"
|
package/package.json
CHANGED
|
@@ -21,6 +21,29 @@ const Edit = (props) => {
|
|
|
21
21
|
const [mapData, setMapData] = React.useState('');
|
|
22
22
|
const data = React.useMemo(() => props.data, [props.data]);
|
|
23
23
|
const { height = '' } = data;
|
|
24
|
+
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (!Object.hasOwn(data, 'show_legend')) {
|
|
27
|
+
onChangeBlock(block, {
|
|
28
|
+
...data,
|
|
29
|
+
show_legend: true,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (!Object.hasOwn(data, 'show_sources')) {
|
|
33
|
+
onChangeBlock(block, {
|
|
34
|
+
...data,
|
|
35
|
+
show_sources: true,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
if (!Object.hasOwn(data, 'dataprotection')) {
|
|
39
|
+
onChangeBlock(block, {
|
|
40
|
+
...data,
|
|
41
|
+
dataprotection: { enabled: true },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
+
}, [data.show_legend, data.show_sources, data.dataprotection]);
|
|
46
|
+
|
|
24
47
|
React.useEffect(() => {
|
|
25
48
|
if (props.data.vis_url) {
|
|
26
49
|
props.getVisualization(expandToBackendURL(props.data.vis_url));
|
|
@@ -111,12 +111,10 @@ export const Schema = (props) => {
|
|
|
111
111
|
title: 'Show sources',
|
|
112
112
|
description: 'Will show sources set in this page Data provenance',
|
|
113
113
|
type: 'boolean',
|
|
114
|
-
defaultValue: true,
|
|
115
114
|
},
|
|
116
115
|
show_legend: {
|
|
117
116
|
title: 'Show legend',
|
|
118
117
|
type: 'boolean',
|
|
119
|
-
defaultValue: true,
|
|
120
118
|
},
|
|
121
119
|
show_viewer: {
|
|
122
120
|
title: 'Show API link',
|
|
@@ -17,6 +17,7 @@ const MODULES = [
|
|
|
17
17
|
'esri/widgets/Print',
|
|
18
18
|
'esri/widgets/Zoom',
|
|
19
19
|
'esri/widgets/ScaleBar',
|
|
20
|
+
'esri/widgets/Fullscreen',
|
|
20
21
|
];
|
|
21
22
|
|
|
22
23
|
const Webmap = (props) => {
|
|
@@ -71,6 +72,7 @@ const Webmap = (props) => {
|
|
|
71
72
|
Print,
|
|
72
73
|
Zoom,
|
|
73
74
|
ScaleBar,
|
|
75
|
+
Fullscreen,
|
|
74
76
|
] = modules;
|
|
75
77
|
setModules({
|
|
76
78
|
Map,
|
|
@@ -85,6 +87,7 @@ const Webmap = (props) => {
|
|
|
85
87
|
Print,
|
|
86
88
|
Zoom,
|
|
87
89
|
ScaleBar,
|
|
90
|
+
Fullscreen,
|
|
88
91
|
});
|
|
89
92
|
});
|
|
90
93
|
}
|
|
@@ -134,6 +137,7 @@ const Webmap = (props) => {
|
|
|
134
137
|
Print,
|
|
135
138
|
Zoom,
|
|
136
139
|
ScaleBar,
|
|
140
|
+
Fullscreen,
|
|
137
141
|
} = modules;
|
|
138
142
|
let layers =
|
|
139
143
|
map_layers && map_layers.length > 0
|
|
@@ -281,6 +285,14 @@ const Webmap = (props) => {
|
|
|
281
285
|
});
|
|
282
286
|
}
|
|
283
287
|
|
|
288
|
+
const fullscreenWidget = new Fullscreen({
|
|
289
|
+
view: view,
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
view.ui.add(fullscreenWidget, 'top-right');
|
|
293
|
+
|
|
294
|
+
//detect when fullscreen is on
|
|
295
|
+
|
|
284
296
|
if (layers && layers[0] && general && general.centerOnExtent) {
|
|
285
297
|
const firstLayer = layers[0];
|
|
286
298
|
if (firstLayer.type === 'feature') {
|
|
@@ -334,20 +346,23 @@ const Webmap = (props) => {
|
|
|
334
346
|
return { view, map };
|
|
335
347
|
}, [modules, data, data.layers, map_layers]);
|
|
336
348
|
|
|
349
|
+
const heightPx =
|
|
350
|
+
height && !editMode
|
|
351
|
+
? `${height}px`
|
|
352
|
+
: device === 'tablet' || device === 'mobile'
|
|
353
|
+
? '300px'
|
|
354
|
+
: '500px';
|
|
355
|
+
|
|
356
|
+
const dynamicStyle = `
|
|
357
|
+
.esri-map {
|
|
358
|
+
height: ${heightPx} !important
|
|
359
|
+
}
|
|
360
|
+
`;
|
|
361
|
+
|
|
337
362
|
return (
|
|
338
363
|
<div>
|
|
339
|
-
<
|
|
340
|
-
|
|
341
|
-
height:
|
|
342
|
-
height && !editMode
|
|
343
|
-
? `${height}px`
|
|
344
|
-
: device === 'tablet' || device === 'mobile'
|
|
345
|
-
? '300px'
|
|
346
|
-
: '500px',
|
|
347
|
-
}}
|
|
348
|
-
ref={mapRef}
|
|
349
|
-
className="esri-map"
|
|
350
|
-
></div>
|
|
364
|
+
<style>{dynamicStyle}</style>
|
|
365
|
+
<div ref={mapRef} className="esri-map"></div>
|
|
351
366
|
</div>
|
|
352
367
|
);
|
|
353
368
|
};
|