@eeacms/volto-cca-policy 0.2.82 → 0.2.83

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,19 @@ 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.2.83](https://github.com/eea/volto-cca-policy/compare/0.2.82...0.2.83) - 16 December 2024
8
+
9
+ #### :rocket: Dependency updates
10
+
11
+ - Release @eeacms/volto-searchlib@2.0.5 [EEA Jenkins - [`4adc1dc`](https://github.com/eea/volto-cca-policy/commit/4adc1dc79bca9439b2bd5b79d231c1e2243fc74b)]
12
+ - Release @eeacms/volto-searchlib@2.0.4 [EEA Jenkins - [`3b5547c`](https://github.com/eea/volto-cca-policy/commit/3b5547c8a7be40a44fd978efe9ea4736e3fa7bed)]
13
+
14
+ #### :hammer_and_wrench: Others
15
+
16
+ - Don't expose all the languages [Tiberiu Ichim - [`80e20af`](https://github.com/eea/volto-cca-policy/commit/80e20af2f56d164e6efbd90370307f7317c38909)]
17
+ - Add 2 new fields to download [Tiberiu Ichim - [`c8f71ba`](https://github.com/eea/volto-cca-policy/commit/c8f71ba52d8e39568e3ad00cf6e6bc45650e66b8)]
18
+ - Ad Maps/Graphs height, handle iframe src and URL for indicators [kreafox - [`4f314c0`](https://github.com/eea/volto-cca-policy/commit/4f314c0f8b5e316d67f3c871276e92128ebf129b)]
19
+ - Set download fields [Tiberiu Ichim - [`6677ee0`](https://github.com/eea/volto-cca-policy/commit/6677ee0fa1f863387488db9adb2d5730b4099016)]
7
20
  ### [0.2.82](https://github.com/eea/volto-cca-policy/compare/0.2.81...0.2.82) - 12 December 2024
8
21
 
9
22
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.82",
3
+ "version": "0.2.83",
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",
@@ -35,7 +35,7 @@
35
35
  "@eeacms/volto-globalsearch": "^1.1.0",
36
36
  "@eeacms/volto-hero-block": "^7.1.0",
37
37
  "@eeacms/volto-openlayers-map": "*",
38
- "@eeacms/volto-searchlib": "2.0.3",
38
+ "@eeacms/volto-searchlib": "2.0.5",
39
39
  "@eeacms/volto-slate-label": "^0.6.0",
40
40
  "@eeacms/volto-tabs-block": "^7.5.1",
41
41
  "@elastic/search-ui": "1.21.2",
@@ -94,15 +94,26 @@ const MaybeFlourishVisualization = ({ content }) => {
94
94
  };
95
95
 
96
96
  function getFirstIframeSrc(htmlString) {
97
- const regex = /<iframe[^>]+src=["']([^"']+)["']/;
98
- const match = htmlString.match(regex);
99
- return match ? match[1] : null;
97
+ const iframeRegex = /<iframe[^>]+src=["']([^"']+)["']/;
98
+
99
+ const iframeMatch = htmlString.match(iframeRegex);
100
+ if (iframeMatch) {
101
+ return iframeMatch[1];
102
+ }
103
+
104
+ try {
105
+ const url = new URL(htmlString);
106
+ return url.href;
107
+ } catch (e) {
108
+ return null;
109
+ }
100
110
  }
101
111
 
102
112
  const MaybeIframeVisualization = ({ content }) => {
103
- const { map_graphs } = content;
113
+ const { map_graphs, map_graphs_height } = content;
104
114
 
105
115
  const url = getFirstIframeSrc(map_graphs || '');
116
+ const height = map_graphs_height || 800;
106
117
 
107
118
  const [isClient, setIsClient] = React.useState();
108
119
 
@@ -110,7 +121,6 @@ const MaybeIframeVisualization = ({ content }) => {
110
121
 
111
122
  if (!(isClient && url)) return null;
112
123
 
113
- // <div dangerouslySetInnerHTML={{ __html: map_graphs }} />
114
124
  return (
115
125
  <PrivacyProtection
116
126
  data={{
@@ -119,7 +129,7 @@ const MaybeIframeVisualization = ({ content }) => {
119
129
  }}
120
130
  >
121
131
  <iframe
122
- height="980"
132
+ height={height}
123
133
  width="100%"
124
134
  src={url}
125
135
  title="Interactive or visual content"
@@ -525,6 +525,7 @@ export const EU_COUNTRIES = [
525
525
  'LV',
526
526
  'MT',
527
527
  'NL',
528
+ 'NO',
528
529
  'PL',
529
530
  'PT',
530
531
  'RO',
@@ -141,40 +141,40 @@ export const language = {
141
141
  type: 'any',
142
142
  },
143
143
  facetValues: [
144
- 'ar',
145
- 'sr',
146
- 'sq',
147
- 'bg',
148
- 'bs',
149
- 'cs',
150
- 'hr',
151
- 'da',
152
- 'nl',
153
- 'el',
144
+ 'de',
154
145
  'en',
155
- 'et',
156
- 'fi',
146
+ 'es',
157
147
  'fr',
158
- 'ga',
159
- 'de',
160
- 'hu',
161
- 'is',
162
148
  'it',
163
- 'lv',
164
- 'lt',
165
- 'mk',
166
- 'mt',
167
- 'no',
168
149
  'pl',
169
- 'pt',
170
- 'ro',
171
- 'ru',
172
- 'sh',
173
- 'sk',
174
- 'sl',
175
- 'es',
176
- 'sv',
177
- 'tr',
150
+ // 'ar',
151
+ // 'bg',
152
+ // 'bs',
153
+ // 'cs',
154
+ // 'da',
155
+ // 'el',
156
+ // 'et',
157
+ // 'fi',
158
+ // 'ga',
159
+ // 'hr',
160
+ // 'hu',
161
+ // 'is',
162
+ // 'lt',
163
+ // 'lv',
164
+ // 'mk',
165
+ // 'mt',
166
+ // 'nl',
167
+ // 'no',
168
+ // 'pt',
169
+ // 'ro',
170
+ // 'ru',
171
+ // 'sh',
172
+ // 'sk',
173
+ // 'sl',
174
+ // 'sq',
175
+ // 'sr',
176
+ // 'sv',
177
+ // 'tr',
178
178
  ],
179
179
  sortOn: 'custom',
180
180
  sortOnCustomLabel: 'Alphabetical',
@@ -70,6 +70,22 @@ export default function installMainSearch(config) {
70
70
 
71
71
  // console.log('config.searchui.ccaSearch clusers', clusters);
72
72
  // debugger;
73
+ config.searchui.globalsearch.download_fields = [
74
+ { field: 'about', name: 'About' },
75
+ { field: 'title', name: 'title' },
76
+ { field: 'issued', name: 'Issued' },
77
+ { field: 'objectProvides', name: 'Content type' },
78
+ { field: 'cca_adaptation_sectors', name: 'Sectors' },
79
+ { field: 'cca_climate_impacts', name: 'Climate impact' },
80
+ { field: 'transnational_regions', name: 'Transnational regions' },
81
+ { field: 'cca_adaptation_elements', name: 'Adaptation Approaches' },
82
+ { field: 'cca_funding_programme', name: 'Funding programme' },
83
+ { field: 'cca_key_type_measure', name: 'Key type measure' },
84
+ { field: 'cca_geographic_countries', name: 'Countries' },
85
+ { field: 'cca_origin_websites', name: 'Origin website' },
86
+ { field: 'cca_health_impacts', name: 'Health impacts' },
87
+ { field: 'cca_partner_contributors', name: 'Observatory impacts' },
88
+ ];
73
89
  config.searchui.ccaSearch = {
74
90
  ...mergeConfig(envConfig, config.searchui.globalsearchbase),
75
91
  elastic_index: '_es/globalsearch',
@@ -206,5 +222,6 @@ export default function installMainSearch(config) {
206
222
  process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
207
223
  }
208
224
 
225
+ // console.log(config);
209
226
  return config;
210
227
  }