@eeacms/volto-eea-map 1.0.0 → 1.0.1
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
CHANGED
|
@@ -4,7 +4,17 @@ 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
|
-
### [1.0.
|
|
7
|
+
### [1.0.1](https://github.com/eea/volto-eea-map/compare/1.0.0...1.0.1) - 19 June 2023
|
|
8
|
+
|
|
9
|
+
#### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
- feat: use map_viz endpoint in eea.api.dataconnector [andreiggr - [`e6ce6dd`](https://github.com/eea/volto-eea-map/commit/e6ce6dd0a87343be8dae945780ef4b9ace6d830a)]
|
|
12
|
+
|
|
13
|
+
#### :house: Internal changes
|
|
14
|
+
|
|
15
|
+
- chore: useeffect updates improvements & cleanup unused layer wwidget [andreiggr - [`1b30d99`](https://github.com/eea/volto-eea-map/commit/1b30d99b481262d0184c8e5ad10331f0315d4f2a)]
|
|
16
|
+
|
|
17
|
+
## [1.0.0](https://github.com/eea/volto-eea-map/compare/0.1.35...1.0.0) - 15 June 2023
|
|
8
18
|
|
|
9
19
|
#### :bug: Bug Fixes
|
|
10
20
|
|
|
@@ -54,6 +64,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
54
64
|
|
|
55
65
|
- chore: clear unused #254131 [andreiggr - [`ccec2ea`](https://github.com/eea/volto-eea-map/commit/ccec2eaab173c905cd4ea0190a9c6cfd630250f9)]
|
|
56
66
|
- chore: clear block style #254131 [andreiggr - [`af500bc`](https://github.com/eea/volto-eea-map/commit/af500bc10a5f280eff0335f45bae1596d66a7e6b)]
|
|
67
|
+
- chore: [JENKINS] Remove alpha testing version [valentinab25 - [`76b29e5`](https://github.com/eea/volto-eea-map/commit/76b29e510f5156590723831a524bc39dfba6deba)]
|
|
57
68
|
|
|
58
69
|
#### :hammer_and_wrench: Others
|
|
59
70
|
|
|
@@ -63,6 +74,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
63
74
|
- * versions [andreiggr - [`6d9ff2b`](https://github.com/eea/volto-eea-map/commit/6d9ff2b26a236b6445678e3d84698d1c3c0826f4)]
|
|
64
75
|
- add razzle-plugin-scss dep [andreiggr - [`d74cee5`](https://github.com/eea/volto-eea-map/commit/d74cee51d30c866afe55730e5b25e0bf11d2caea)]
|
|
65
76
|
- volto-object-widget [andreiggr - [`18d0ed7`](https://github.com/eea/volto-eea-map/commit/18d0ed72c1ba7b0f7159a0eefc09ccea9acee5cb)]
|
|
77
|
+
- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`5911d01`](https://github.com/eea/volto-eea-map/commit/5911d01f7f3bc79a2c834fab75a9a4ac05d2d042)]
|
|
66
78
|
### [0.1.32](https://github.com/eea/volto-eea-map/compare/0.1.31...0.1.32) - 20 February 2023
|
|
67
79
|
|
|
68
80
|
#### :hammer_and_wrench: Others
|
|
@@ -70,6 +82,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
70
82
|
- remove console.log [tedw87 - [`3aeb3e8`](https://github.com/eea/volto-eea-map/commit/3aeb3e8ec5474387f3cd22eb9b387c6681e17120)]
|
|
71
83
|
- refactor code [tedw87 - [`6d7830e`](https://github.com/eea/volto-eea-map/commit/6d7830eb934f56c255eea5642bdefba30d892946)]
|
|
72
84
|
- add Blossom basemap layer [tedw87 - [`5226ee2`](https://github.com/eea/volto-eea-map/commit/5226ee218df3401cf467afbc7a4d720dc30719e1)]
|
|
85
|
+
- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`1dad5c6`](https://github.com/eea/volto-eea-map/commit/1dad5c6617096ff85223165a6dd2b1d5d7deea6a)]
|
|
73
86
|
### [0.1.31](https://github.com/eea/volto-eea-map/compare/0.1.30...0.1.31) - 11 November 2022
|
|
74
87
|
|
|
75
88
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -4,8 +4,6 @@ import { SidebarPortal } from '@plone/volto/components';
|
|
|
4
4
|
import { connect } from 'react-redux';
|
|
5
5
|
import { compose } from 'redux';
|
|
6
6
|
|
|
7
|
-
import { getContent } from '@plone/volto/actions';
|
|
8
|
-
|
|
9
7
|
import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
|
|
10
8
|
import Webmap from '@eeacms/volto-eea-map/components/Webmap';
|
|
11
9
|
import ExtraViews from '@eeacms/volto-eea-map/components/ExtraViews';
|
|
@@ -16,15 +14,10 @@ import {
|
|
|
16
14
|
updateBlockQueryFromPageQuery,
|
|
17
15
|
} from '@eeacms/volto-eea-map/utils';
|
|
18
16
|
|
|
17
|
+
import { getVisualization } from '@eeacms/volto-eea-map/actions';
|
|
18
|
+
|
|
19
19
|
const Edit = (props) => {
|
|
20
|
-
const {
|
|
21
|
-
block,
|
|
22
|
-
data,
|
|
23
|
-
onChangeBlock,
|
|
24
|
-
selected,
|
|
25
|
-
id,
|
|
26
|
-
data_provenance = {},
|
|
27
|
-
} = props;
|
|
20
|
+
const { block, data, onChangeBlock, selected, data_provenance = {} } = props;
|
|
28
21
|
const { height = '' } = data;
|
|
29
22
|
const schema = Schema(props);
|
|
30
23
|
const [mapData, setMapData] = React.useState('');
|
|
@@ -52,7 +45,7 @@ const Edit = (props) => {
|
|
|
52
45
|
}, [data.show_legend, data.show_sources, data.dataprotection]);
|
|
53
46
|
|
|
54
47
|
React.useEffect(() => {
|
|
55
|
-
props.
|
|
48
|
+
props.getVisualization(props.data.vis_url);
|
|
56
49
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
50
|
}, [props.data.vis_url]);
|
|
58
51
|
|
|
@@ -91,7 +84,11 @@ const Edit = (props) => {
|
|
|
91
84
|
setMapData(updatedMapData);
|
|
92
85
|
|
|
93
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
|
-
}, [
|
|
87
|
+
}, [
|
|
88
|
+
props.map_visualization,
|
|
89
|
+
props.data.data_query_params,
|
|
90
|
+
props.data.enable_queries,
|
|
91
|
+
]);
|
|
95
92
|
|
|
96
93
|
return (
|
|
97
94
|
<>
|
|
@@ -132,13 +129,15 @@ export default compose(
|
|
|
132
129
|
connect(
|
|
133
130
|
(state, props) => ({
|
|
134
131
|
data_query: state.content.data.data_query,
|
|
135
|
-
|
|
136
|
-
state.
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
map_visualization: props.data.vis_url
|
|
133
|
+
? state.map_visualizations?.data[props.data.vis_url]?.data
|
|
134
|
+
: '',
|
|
135
|
+
data_provenance: props.data.vis_url
|
|
136
|
+
? state.map_visualizations?.data[props.data.vis_url]?.data_provenance
|
|
137
|
+
: '',
|
|
139
138
|
}),
|
|
140
139
|
{
|
|
141
|
-
|
|
140
|
+
getVisualization,
|
|
142
141
|
},
|
|
143
142
|
),
|
|
144
143
|
)(Edit);
|
|
@@ -5,19 +5,19 @@ import { compose } from 'redux';
|
|
|
5
5
|
|
|
6
6
|
import { PrivacyProtection } from '@eeacms/volto-embed';
|
|
7
7
|
|
|
8
|
-
import { getContent } from '@plone/volto/actions';
|
|
9
8
|
import Webmap from '@eeacms/volto-eea-map/components/Webmap';
|
|
10
9
|
import ExtraViews from '@eeacms/volto-eea-map/components/ExtraViews';
|
|
11
10
|
import { applyQueriesToMapLayers } from '@eeacms/volto-eea-map/utils';
|
|
11
|
+
import { getVisualization } from '@eeacms/volto-eea-map/actions';
|
|
12
12
|
|
|
13
13
|
const View = (props) => {
|
|
14
|
-
const { data,
|
|
14
|
+
const { data, data_provenance = {} } = props || {};
|
|
15
15
|
const { height = '' } = data;
|
|
16
16
|
|
|
17
17
|
const [mapData, setMapData] = React.useState('');
|
|
18
18
|
|
|
19
19
|
React.useEffect(() => {
|
|
20
|
-
props.
|
|
20
|
+
props.getVisualization(props.data.vis_url);
|
|
21
21
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
22
|
}, [props.data.vis_url]);
|
|
23
23
|
|
|
@@ -30,7 +30,11 @@ const View = (props) => {
|
|
|
30
30
|
|
|
31
31
|
setMapData(updatedMapData);
|
|
32
32
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
33
|
-
}, [
|
|
33
|
+
}, [
|
|
34
|
+
props.map_visualization,
|
|
35
|
+
props.data.data_query_params,
|
|
36
|
+
props.data.enable_queries,
|
|
37
|
+
]);
|
|
34
38
|
|
|
35
39
|
return (
|
|
36
40
|
<PrivacyProtection data={data} height={height} {...props}>
|
|
@@ -56,13 +60,15 @@ const View = (props) => {
|
|
|
56
60
|
export default compose(
|
|
57
61
|
connect(
|
|
58
62
|
(state, props) => ({
|
|
59
|
-
|
|
60
|
-
state.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
map_visualization: props.data.vis_url
|
|
64
|
+
? state.map_visualizations?.data[props.data.vis_url]?.data
|
|
65
|
+
: '',
|
|
66
|
+
data_provenance: props.data.vis_url
|
|
67
|
+
? state.map_visualizations?.data[props.data.vis_url]?.data_provenance
|
|
68
|
+
: '',
|
|
63
69
|
}),
|
|
64
70
|
{
|
|
65
|
-
|
|
71
|
+
getVisualization,
|
|
66
72
|
},
|
|
67
73
|
),
|
|
68
74
|
)(View);
|
|
@@ -30,9 +30,7 @@ const Webmap = (props) => {
|
|
|
30
30
|
props.data.layers,
|
|
31
31
|
]);
|
|
32
32
|
const base = React.useMemo(() => props?.data?.base || {}, [props.data.base]);
|
|
33
|
-
|
|
34
|
-
props.data.legend,
|
|
35
|
-
]);
|
|
33
|
+
|
|
36
34
|
const general = React.useMemo(() => props?.data?.general || {}, [
|
|
37
35
|
props.data.general,
|
|
38
36
|
]);
|
|
@@ -49,10 +47,6 @@ const Webmap = (props) => {
|
|
|
49
47
|
.filter(({ map_layer }) => map_layer)
|
|
50
48
|
.map((l, i) => l.map_layer);
|
|
51
49
|
|
|
52
|
-
const options = {
|
|
53
|
-
css: true,
|
|
54
|
-
};
|
|
55
|
-
|
|
56
50
|
const mapRef = React.useRef();
|
|
57
51
|
const [modules, setModules] = React.useState({});
|
|
58
52
|
|
|
@@ -61,7 +55,9 @@ const Webmap = (props) => {
|
|
|
61
55
|
React.useEffect(() => {
|
|
62
56
|
if (!modules_loaded.current) {
|
|
63
57
|
modules_loaded.current = true;
|
|
64
|
-
loadModules(MODULES,
|
|
58
|
+
loadModules(MODULES, {
|
|
59
|
+
css: true,
|
|
60
|
+
}).then((modules) => {
|
|
65
61
|
const [
|
|
66
62
|
Map,
|
|
67
63
|
MapView,
|
|
@@ -92,7 +88,7 @@ const Webmap = (props) => {
|
|
|
92
88
|
});
|
|
93
89
|
});
|
|
94
90
|
}
|
|
95
|
-
}, [setModules
|
|
91
|
+
}, [setModules]);
|
|
96
92
|
|
|
97
93
|
var customFeatureLayerRenderer = {
|
|
98
94
|
type: 'simple', // autocasts as new SimpleRenderer()
|
|
@@ -312,27 +308,6 @@ const Webmap = (props) => {
|
|
|
312
308
|
});
|
|
313
309
|
view.ui.add(zoomWidget, zoomPosition);
|
|
314
310
|
}
|
|
315
|
-
|
|
316
|
-
if (legend?.legend?.show_legend) {
|
|
317
|
-
const legendPosition =
|
|
318
|
-
legend && legend.legend && legend.legend.position
|
|
319
|
-
? legend.legend.position
|
|
320
|
-
: 'top-right';
|
|
321
|
-
|
|
322
|
-
const legendWidget = new Expand({
|
|
323
|
-
content: new Legend({
|
|
324
|
-
view: view,
|
|
325
|
-
style: 'classic',
|
|
326
|
-
}),
|
|
327
|
-
view: view,
|
|
328
|
-
expanded: false,
|
|
329
|
-
expandIconClass: 'esri-icon-legend',
|
|
330
|
-
expandTooltip: 'Legend',
|
|
331
|
-
classNames: 'some-cool-expand',
|
|
332
|
-
});
|
|
333
|
-
view.ui.add(legendWidget, legendPosition);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
311
|
const printPosition =
|
|
337
312
|
general && general.print_position ? general.print_position : '';
|
|
338
313
|
|