@eeacms/volto-eea-map 3.0.0 → 3.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,14 @@ 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
- ### [3.0.0](https://github.com/eea/volto-eea-map/compare/2.0.7...3.0.0) - 23 November 2023
7
+ ### [3.0.1](https://github.com/eea/volto-eea-map/compare/3.0.0...3.0.1) - 24 November 2023
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - fix [Miu Razvan - [`d9267ec`](https://github.com/eea/volto-eea-map/commit/d9267eca557518241ba30f5d525ebd30a606bf94)]
12
+ - fix [Miu Razvan - [`0ad99a6`](https://github.com/eea/volto-eea-map/commit/0ad99a60a3edfd19ad11b0023b456e82bb335dc5)]
13
+ - fix [Miu Razvan - [`fd0260d`](https://github.com/eea/volto-eea-map/commit/fd0260d46e356377ce388b967e78651da8cfa543)]
14
+ ## [3.0.0](https://github.com/eea/volto-eea-map/compare/2.0.7...3.0.0) - 23 November 2023
8
15
 
9
16
  #### :hammer_and_wrench: Others
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
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",
@@ -81,4 +81,4 @@
81
81
  "cypress:open": "make cypress-open",
82
82
  "prepare": "husky install"
83
83
  }
84
- }
84
+ }
@@ -7,13 +7,23 @@ import { applyQueriesToMapLayers } from '@eeacms/volto-eea-map/utils';
7
7
  import { getMapVisualizationData } from './helpers';
8
8
 
9
9
  const View = (props) => {
10
- const { data_query_params, enable_queries, height = '' } = props.data;
10
+ const { data } = props;
11
+ const {
12
+ data_query_params,
13
+ enable_queries,
14
+ show_legend = true,
15
+ show_note = true,
16
+ show_sources = true,
17
+ show_more_info = true,
18
+ show_share = true,
19
+ dataprotection = { enabled: true },
20
+ height = '',
21
+ } = data;
11
22
 
12
23
  const map_visualization_data = useMemo(() => getMapVisualizationData(props), [
13
24
  props,
14
25
  ]);
15
26
 
16
- const { data_provenance = {}, figure_note = [] } = map_visualization_data;
17
27
  const [mapData, setMapData] = React.useState('');
18
28
 
19
29
  React.useEffect(() => {
@@ -27,7 +37,7 @@ const View = (props) => {
27
37
 
28
38
  return (
29
39
  <PrivacyProtection
30
- data={props.data}
40
+ data={data}
31
41
  className="embed-map-visualization"
32
42
  {...props}
33
43
  >
@@ -36,11 +46,14 @@ const View = (props) => {
36
46
  <Webmap data={mapData} height={height} />
37
47
  <ExtraViews
38
48
  data={{
39
- ...props.data,
40
- data_provenance,
41
- figure_note,
42
- map_data: map_visualization_data,
43
- '@id': props['@id'],
49
+ ...data,
50
+ show_legend,
51
+ show_note,
52
+ show_sources,
53
+ show_more_info,
54
+ show_share,
55
+ dataprotection,
56
+ map_visualization_data,
44
57
  }}
45
58
  />
46
59
  </>
@@ -47,12 +47,12 @@ const ExtraViews = ({ data, screen }) => {
47
47
  )}
48
48
  <div className={cx('visualization-toolbar', { mobile })} ref={toolbar}>
49
49
  <div className="left-col">
50
- {show_note && <FigureNote note={figure_note || []} />}
50
+ {show_note && <FigureNote notes={figure_note || []} />}
51
51
  {show_sources && <Sources sources={data_provenance?.data} />}
52
- {show_more_info && <MoreInfo href={data['@id']} />}
52
+ {show_more_info && <MoreInfo href={map_visualization_data['@id']} />}
53
53
  </div>
54
54
  <div className="right-col">
55
- {show_share && <Share href={data['@id']} />}
55
+ {show_share && <Share href={map_visualization_data['@id']} />}
56
56
  </div>
57
57
  </div>
58
58
  {description && serializeNodes(description)}
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import Webmap from '../Webmap';
3
- import LegendView from '../LegendView';
4
2
  import { hasBlocksData } from '@plone/volto/helpers';
5
3
  import RenderBlocks from '@plone/volto/components/theme/View/RenderBlocks';
4
+ import { pickMetadata } from '@eeacms/volto-embed/helpers';
5
+ import Webmap from '../Webmap';
6
+ import ExtraViews from '../ExtraViews';
6
7
 
7
8
  const VisualizationView = (props) => {
8
9
  const { content = {} } = props;
@@ -16,7 +17,20 @@ const VisualizationView = (props) => {
16
17
  ) : (
17
18
  <>
18
19
  <Webmap data={map_visualization_data} />
19
- <LegendView data={map_visualization_data} show_viewer={true} />
20
+ <ExtraViews
21
+ data={{
22
+ show_viewer: true,
23
+ show_legend: true,
24
+ show_note: false,
25
+ show_sources: false,
26
+ show_more_info: false,
27
+ show_share: true,
28
+ map_visualization_data: {
29
+ ...map_visualization_data,
30
+ ...pickMetadata(content),
31
+ },
32
+ }}
33
+ />
20
34
  </>
21
35
  )}
22
36
  </div>
@@ -1,12 +1,32 @@
1
+ import { connect } from 'react-redux';
2
+ import { pickMetadata } from '@eeacms/volto-embed/helpers';
1
3
  import Webmap from '../Webmap';
2
- import LegendView from '../LegendView';
4
+ import ExtraViews from '../ExtraViews';
3
5
 
4
- export default function VisualizationViewWidget(props) {
6
+ function VisualizationViewWidget(props) {
5
7
  const { value: map_visualization_data = {} } = props;
8
+
6
9
  return (
7
10
  <>
8
11
  <Webmap data={map_visualization_data} />
9
- <LegendView data={map_visualization_data} show_viewer={true} />
12
+ <ExtraViews
13
+ data={{
14
+ show_viewer: true,
15
+ show_legend: true,
16
+ show_note: false,
17
+ show_sources: false,
18
+ show_more_info: false,
19
+ show_share: true,
20
+ map_visualization_data: {
21
+ ...map_visualization_data,
22
+ ...pickMetadata(props.content),
23
+ },
24
+ }}
25
+ />
10
26
  </>
11
27
  );
12
28
  }
29
+
30
+ export default connect((state) => ({
31
+ content: state.content.data,
32
+ }))(VisualizationViewWidget);