@eeacms/volto-cca-policy 1.0.8 → 1.0.9

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,8 @@ 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.9](https://github.com/eea/volto-cca-policy/compare/1.0.8...1.0.9) - 18 August 2026
8
+
7
9
  ### [1.0.8](https://github.com/eea/volto-cca-policy/compare/1.0.7...1.0.8) - 17 August 2026
8
10
 
9
11
  #### :house: Internal changes
@@ -243,7 +245,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
243
245
  #### :hammer_and_wrench: Others
244
246
 
245
247
  - test: pin Chromium version 149 to work with Cypress [valentinab25 - [`659ec82`](https://github.com/eea/volto-cca-policy/commit/659ec823dd71fe592a3a7accda22effbe1fb07bc)]
246
- ## [1.0.0](https://github.com/eea/volto-cca-policy/compare/1.0.0-alpha.18...1.0.0) - 12 June 2026
248
+ ## [1.0.0](https://github.com/eea/volto-cca-policy/compare/1.0.0-alpha.20...1.0.0) - 12 June 2026
249
+
250
+ ### [1.0.0-alpha.20](https://github.com/eea/volto-cca-policy/compare/1.0.0-alpha.19...1.0.0-alpha.20) - 18 August 2026
251
+
252
+ ### [1.0.0-alpha.19](https://github.com/eea/volto-cca-policy/compare/1.0.0-alpha.18...1.0.0-alpha.19) - 18 August 2026
247
253
 
248
254
  ### [1.0.0-alpha.18](https://github.com/eea/volto-cca-policy/compare/1.0.0-alpha.17...1.0.0-alpha.18) - 13 August 2026
249
255
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "@eeacms/volto-cca-policy: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -32,11 +32,8 @@ import {
32
32
 
33
33
  const SHARE_EEA = ['https://cmshare.eea.eu', 'shareit.eea.europa.eu'];
34
34
 
35
- const getVisualizationEmbedCode = (visualization) =>
36
- visualization?.embed_code || visualization?.map_graphs || '';
37
-
38
35
  const MaybeFlourishVisualization = ({ visualization }) => {
39
- const embedCode = getVisualizationEmbedCode(visualization);
36
+ const embedCode = visualization?.embed_code || '';
40
37
  // https://helpcenter.flourish.studio/hc/en-us/articles/8761537208463-How-to-embed-Flourish-charts-in-your-CMS
41
38
  const flourishPath = getDataSrcFromEmbedCode(embedCode);
42
39
  const flourishUrl = buildFlourishUrl(flourishPath);
@@ -78,7 +75,7 @@ function getFirstIframeSrc(htmlString) {
78
75
  }
79
76
 
80
77
  const MaybeIframeVisualization = ({ visualization }) => {
81
- const embedCode = getVisualizationEmbedCode(visualization);
78
+ const embedCode = visualization?.embed_code || '';
82
79
  const url = getFirstIframeSrc(embedCode);
83
80
  const height = visualization?.height || 800;
84
81
  const title = visualization?.title || 'Interactive or visual content';
@@ -127,21 +124,9 @@ const Visualizations = ({ visualizations }) => (
127
124
  );
128
125
 
129
126
  const getVisualizations = (content) => {
130
- const visualizations = Array.isArray(content?.visualizations)
127
+ return Array.isArray(content?.visualizations)
131
128
  ? content.visualizations.filter((item) => item?.embed_code)
132
129
  : [];
133
-
134
- return content?.map_graphs
135
- ? [
136
- ...visualizations,
137
- {
138
- title: '',
139
- embed_code: content.map_graphs,
140
- height: content.map_graphs_height,
141
- full_width: content.map_graphs_full_width,
142
- },
143
- ]
144
- : visualizations;
145
130
  };
146
131
 
147
132
  const BottomInfo = (props) => {
@@ -44,6 +44,14 @@ const baseContent = {
44
44
  const visualizationEmbedCode =
45
45
  '<div class="flourish-embed" data-src="visualisation/12345"></div>';
46
46
 
47
+ const getVisualization = (overrides = {}) => ({
48
+ title: '',
49
+ embed_code: visualizationEmbedCode,
50
+ height: '',
51
+ full_width: false,
52
+ ...overrides,
53
+ });
54
+
47
55
  const renderDatabaseItemView = (content = baseContent) => {
48
56
  const store = mockStore({
49
57
  userSession: { token: '1234' },
@@ -89,7 +97,7 @@ describe('DatabaseItemView', () => {
89
97
  it('renders the visualizations field in the left column by default', () => {
90
98
  const component = renderDatabaseItemView({
91
99
  ...baseContent,
92
- map_graphs: visualizationEmbedCode,
100
+ visualizations: [getVisualization()],
93
101
  });
94
102
  const colLeft = findColumnByClassName(component, 'col-left');
95
103
  const fullWidthColumns = component.root.findAll(
@@ -106,8 +114,7 @@ describe('DatabaseItemView', () => {
106
114
  it('renders the visualizations field full width when enabled', () => {
107
115
  const component = renderDatabaseItemView({
108
116
  ...baseContent,
109
- map_graphs: visualizationEmbedCode,
110
- map_graphs_full_width: true,
117
+ visualizations: [getVisualization({ full_width: true })],
111
118
  });
112
119
  const colLeft = findColumnByClassName(component, 'col-left');
113
120
  const fullWidthColumn = component.root.findAll(
@@ -121,8 +128,7 @@ describe('DatabaseItemView', () => {
121
128
  it('does not render a visualization when the visualizations field is empty', () => {
122
129
  const component = renderDatabaseItemView({
123
130
  ...baseContent,
124
- map_graphs: '',
125
- map_graphs_full_width: true,
131
+ visualizations: [],
126
132
  });
127
133
 
128
134
  expect(component.root.findAllByType('iframe')).toHaveLength(0);