@eeacms/volto-eea-map 2.0.1 → 2.0.2

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,6 +4,16 @@ 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.2](https://github.com/eea/volto-eea-map/compare/2.0.1...2.0.2) - 14 August 2023
8
+
9
+ #### :bug: Bug Fixes
10
+
11
+ - fix: test use specif backend url for viz #256519 [andreiggr - [`198bdf8`](https://github.com/eea/volto-eea-map/commit/198bdf85f2f847305d08ffd93514f1086868bce9)]
12
+
13
+ #### :house: Internal changes
14
+
15
+ - chore: allow request to arcgis utility service #256519 [andreiggr - [`4c517a4`](https://github.com/eea/volto-eea-map/commit/4c517a4a86c7dce094513ce988d6e236f91fbd28)]
16
+
7
17
  ### [2.0.1](https://github.com/eea/volto-eea-map/compare/2.0.0...2.0.1) - 8 August 2023
8
18
 
9
19
  #### :bug: Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "@eeacms/volto-eea-map: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -8,6 +8,8 @@ import BlockDataForm from '@plone/volto/components/manage/Form/BlockDataForm';
8
8
  import Webmap from '@eeacms/volto-eea-map/components/Webmap';
9
9
  import ExtraViews from '@eeacms/volto-eea-map/components/ExtraViews';
10
10
 
11
+ import { expandToBackendURL } from '@plone/volto/helpers';
12
+
11
13
  import { Schema } from './Schema';
12
14
  import { applyQueriesToMapLayers } from '@eeacms/volto-eea-map/utils';
13
15
 
@@ -19,9 +21,13 @@ const Edit = (props) => {
19
21
  const [mapData, setMapData] = React.useState('');
20
22
  const data = React.useMemo(() => props.data, [props.data]);
21
23
  const { height = '' } = data;
22
-
23
24
  React.useEffect(() => {
24
- props.getVisualization(props.data.vis_url);
25
+ if (props.data.vis_url) {
26
+ props.getVisualization(expandToBackendURL(props.data.vis_url));
27
+ }
28
+ if (!props.data.vis_url) {
29
+ setMapData('');
30
+ }
25
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
26
32
  }, [props.data.vis_url]);
27
33
 
@@ -76,10 +82,12 @@ export default compose(
76
82
  (state, props) => ({
77
83
  data_query: state.content.data.data_query,
78
84
  map_visualization: props.data.vis_url
79
- ? state.map_visualizations?.data[props.data.vis_url]?.data
85
+ ? state.map_visualizations?.data[expandToBackendURL(props.data.vis_url)]
86
+ ?.data
80
87
  : '',
81
88
  data_provenance: props.data.vis_url
82
- ? state.map_visualizations?.data[props.data.vis_url]?.data_provenance
89
+ ? state.map_visualizations?.data[expandToBackendURL(props.data.vis_url)]
90
+ ?.data_provenance
83
91
  : '',
84
92
  }),
85
93
  {
@@ -3,6 +3,8 @@ import React from 'react';
3
3
  import { connect } from 'react-redux';
4
4
  import { compose } from 'redux';
5
5
 
6
+ import { expandToBackendURL } from '@plone/volto/helpers';
7
+
6
8
  import { PrivacyProtection } from '@eeacms/volto-embed';
7
9
 
8
10
  import Webmap from '@eeacms/volto-eea-map/components/Webmap';
@@ -17,7 +19,12 @@ const View = (props) => {
17
19
  const [mapData, setMapData] = React.useState('');
18
20
 
19
21
  React.useEffect(() => {
20
- props.getVisualization(props.data.vis_url);
22
+ if (props.data.vis_url) {
23
+ props.getVisualization(expandToBackendURL(props.data.vis_url));
24
+ }
25
+ if (!props.data.vis_url) {
26
+ setMapData('');
27
+ }
21
28
  // eslint-disable-next-line react-hooks/exhaustive-deps
22
29
  }, [props.data.vis_url]);
23
30
 
@@ -61,10 +68,12 @@ export default compose(
61
68
  connect(
62
69
  (state, props) => ({
63
70
  map_visualization: props.data.vis_url
64
- ? state.map_visualizations?.data[props.data.vis_url]?.data
71
+ ? state.map_visualizations?.data[expandToBackendURL(props.data.vis_url)]
72
+ ?.data
65
73
  : '',
66
74
  data_provenance: props.data.vis_url
67
- ? state.map_visualizations?.data[props.data.vis_url]?.data_provenance
75
+ ? state.map_visualizations?.data[expandToBackendURL(props.data.vis_url)]
76
+ ?.data_provenance
68
77
  : '',
69
78
  }),
70
79
  {
package/src/index.js CHANGED
@@ -32,6 +32,7 @@ export default (config) => {
32
32
  'water.discomap.eea.europa.eu',
33
33
  'noise.discomap.eea.europa.eu',
34
34
  'copernicus.discomap.eea.europa.eu',
35
+ 'utility.arcgisonline.com',
35
36
  ];
36
37
 
37
38
  config.blocks.blocksConfig.embed_eea_map_block = {