@eeacms/volto-eea-map 0.1.20 → 0.1.21

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,11 @@ 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
+ ### [0.1.21](https://github.com/eea/volto-eea-map/compare/0.1.20...0.1.21) - 13 September 2022
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - sources expandable also [andreiggr - [`cd89898`](https://github.com/eea/volto-eea-map/commit/cd89898f026a67b43779575219503eb3ce2ae6fc)]
7
12
  ### [0.1.20](https://github.com/eea/volto-eea-map/compare/0.1.19...0.1.20) - 31 August 2022
8
13
 
9
14
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-eea-map",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
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",
@@ -1,9 +1,48 @@
1
1
  import React from 'react';
2
- import { UniversalLink } from '@plone/volto/components';
2
+ import { UniversalLink, Icon } from '@plone/volto/components';
3
3
 
4
4
  import LegendWidget from './widgets/LegendWidget';
5
5
  import { serializeNodes } from 'volto-slate/editor/render';
6
6
 
7
+ import rightKeySVG from '@plone/volto/icons/right-key.svg';
8
+ import downKeySVG from '@plone/volto/icons/down-key.svg';
9
+
10
+ const SourcesWidget = ({ data }) => {
11
+ const [expand, setExpand] = React.useState(true);
12
+
13
+ return (
14
+ <div>
15
+ <button className="legend-action" onClick={() => setExpand(!expand)}>
16
+ <h3>
17
+ <Icon
18
+ name={expand ? downKeySVG : rightKeySVG}
19
+ title={expand ? 'Collapse' : 'Expand'}
20
+ size="17px"
21
+ />
22
+ Sources:
23
+ </h3>
24
+ </button>
25
+ {expand && (
26
+ <ul>
27
+ {data.map((param, i) => (
28
+ <li key={i}>
29
+ <div className="map_source_param_container">
30
+ <UniversalLink className="map_source_title" href={param.link}>
31
+ {param.title}
32
+ </UniversalLink>
33
+ ,
34
+ <span className="map_source_description">
35
+ {param.organisation}
36
+ </span>
37
+ </div>
38
+ </li>
39
+ ))}
40
+ </ul>
41
+ )}
42
+ </div>
43
+ );
44
+ };
45
+
7
46
  const ExtraViews = ({ data }) => {
8
47
  const {
9
48
  map_data = {},
@@ -23,27 +62,7 @@ const ExtraViews = ({ data }) => {
23
62
  {data_provenance &&
24
63
  data_provenance.data &&
25
64
  data_provenance.data.length > 0 ? (
26
- <div>
27
- <h3>Sources:</h3>
28
- <ul>
29
- {data_provenance.data.map((param, i) => (
30
- <li key={i}>
31
- <div className="map_source_param_container">
32
- <UniversalLink
33
- className="map_source_title"
34
- href={param.link}
35
- >
36
- {param.title}
37
- </UniversalLink>
38
- ,
39
- <span className="map_source_description">
40
- {param.organisation}
41
- </span>
42
- </div>
43
- </li>
44
- ))}
45
- </ul>
46
- </div>
65
+ <SourcesWidget data={data_provenance.data} />
47
66
  ) : (
48
67
  <p>Data provenance is not set for visualization used or page</p>
49
68
  )}