@eeacms/volto-cca-policy 0.1.64 → 0.1.66

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,12 +4,32 @@ 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.66](https://github.com/eea/volto-cca-policy/compare/0.1.65...0.1.66) - 26 January 2024
8
+
9
+ #### :hammer_and_wrench: Others
10
+
11
+ - Revert "test: Update jest,Jenkinsfile,lint to volto-addons-template PR30". [GhitaB - [`692d7ad`](https://github.com/eea/volto-cca-policy/commit/692d7ad68da6bbb56598dac5e7a16b51d41fed16)]
12
+ - Improve code - fix duplicate common facets: objectProvides, language, issued_date. [GhitaB - [`a19ded5`](https://github.com/eea/volto-cca-policy/commit/a19ded5032d6542ccddfde3f276cc609bde1a35f)]
13
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`0ec53e4`](https://github.com/eea/volto-cca-policy/commit/0ec53e43f9bede8fc404897f30132a70d8288934)]
14
+ - Improve code - fix duplicate common facets: include_archived. [GhitaB - [`4936864`](https://github.com/eea/volto-cca-policy/commit/4936864997032fba0f69f7605aa5d66de25f363e)]
15
+ - Improve code - fix duplicate common facets: include_archived. [GhitaB - [`1685bab`](https://github.com/eea/volto-cca-policy/commit/1685bab113a231e08b8db2ca334fd8ac109f0e3c)]
16
+ - Improve code - fix duplicate /Blocks/withResponsiveContainer.js. [GhitaB - [`2790a8f`](https://github.com/eea/volto-cca-policy/commit/2790a8f79ddee64f3d333cc13c277b3acd25e45b)]
17
+ - Improve code /components/theme/Views/CaseStudyView.jsx. [GhitaB - [`4fc14e3`](https://github.com/eea/volto-cca-policy/commit/4fc14e32ee2c991a3650a9c67426e6f694c05f99)]
18
+ - Clean code in Blocks/TransRegionSelect/countries.js. [GhitaB - [`7f5a5c6`](https://github.com/eea/volto-cca-policy/commit/7f5a5c69b6cd7126ebe443ec2594b2bc832882d8)]
19
+ - Revert "test: Update jest,Jenkinsfile,lint to volto-addons-template PR30" [David Ichim - [`3cbb0f4`](https://github.com/eea/volto-cca-policy/commit/3cbb0f458e26c4274d96c009b59ad818ecd32e03)]
20
+ - Set main search as default [Tiberiu Ichim - [`379879b`](https://github.com/eea/volto-cca-policy/commit/379879b667289e0d470644b2a861a3d95330f705)]
21
+ - test: Update jest,Jenkinsfile,lint to volto-addons-template PR30 [valentinab25 - [`e82fd72`](https://github.com/eea/volto-cca-policy/commit/e82fd72f0c11cb9d7ebcb2f37f27c29018df8f97)]
22
+ - Fix custom facet values in health observatory [Tiberiu Ichim - [`8f59ab9`](https://github.com/eea/volto-cca-policy/commit/8f59ab966193e2a93a5027fe305abd88ed64f934)]
23
+ ### [0.1.65](https://github.com/eea/volto-cca-policy/compare/0.1.64...0.1.65) - 24 January 2024
24
+
25
+ #### :hammer_and_wrench: Others
26
+
27
+ - Comment code [Tiberiu Ichim - [`c9494d6`](https://github.com/eea/volto-cca-policy/commit/c9494d601166f427d4bb6bc3745af0e13192669f)]
7
28
  ### [0.1.64](https://github.com/eea/volto-cca-policy/compare/0.1.63...0.1.64) - 23 January 2024
8
29
 
9
30
  #### :hammer_and_wrench: Others
10
31
 
11
32
  - Update menu for translated search menu (fix show children) [Ghiță Bizău - [`b151b96`](https://github.com/eea/volto-cca-policy/commit/b151b96cb0dfcfc6ab9354e73260691c6378d65a)]
12
- - Add dependency on volto-searchlib [Tiberiu Ichim - [`c2117c4`](https://github.com/eea/volto-cca-policy/commit/c2117c4b540572141a859c4f6aea95a65c347ba0)]
13
33
  ### [0.1.63](https://github.com/eea/volto-cca-policy/compare/0.1.62...0.1.63) - 23 January 2024
14
34
 
15
35
  ### [0.1.62](https://github.com/eea/volto-cca-policy/compare/0.1.61...0.1.62) - 22 January 2024
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.64",
3
+ "version": "0.1.66",
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",
@@ -46,6 +46,7 @@
46
46
  "@plone/scripts": "*",
47
47
  "babel-plugin-transform-class-properties": "^6.24.1",
48
48
  "cypress-fail-fast": "^5.0.1",
49
+ "dotenv": "^16.3.2",
49
50
  "husky": "^8.0.3",
50
51
  "lint-staged": "^14.0.1",
51
52
  "md5": "^2.3.0"
@@ -5,7 +5,7 @@ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
5
5
  import { Grid } from 'semantic-ui-react';
6
6
  import { compose } from 'redux';
7
7
  import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
8
- import withResponsiveContainer from './withResponsiveContainer.js';
8
+ import withResponsiveContainer from './../withResponsiveContainer.js';
9
9
  import { addAppURL } from '@plone/volto/helpers';
10
10
  import {
11
11
  getFocusCountriesFeature,
@@ -4,7 +4,7 @@ import './styles.css';
4
4
  import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
5
5
  import { compose } from 'redux';
6
6
  import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
7
- import withResponsiveContainer from './withResponsiveContainer.js';
7
+ import withResponsiveContainer from './../withResponsiveContainer.js';
8
8
  import {
9
9
  getFocusCountriesFeature,
10
10
  getFocusCountryNames,
@@ -5,7 +5,7 @@ import { injectLazyLibs } from '@plone/volto/helpers/Loadable/Loadable';
5
5
  import { Grid } from 'semantic-ui-react';
6
6
  import { compose } from 'redux';
7
7
  import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
8
- import withResponsiveContainer from './withResponsiveContainer.js';
8
+ import withResponsiveContainer from './../withResponsiveContainer.js';
9
9
  import { addAppURL } from '@plone/volto/helpers';
10
10
  import {
11
11
  getFocusCountriesFeature,
@@ -31,7 +31,6 @@ export const regionCountries = [
31
31
  ['Finland', '/countries/finland'],
32
32
  ['Ireland', '/countries/ireland'],
33
33
  ['Sweden', '/countries/sweden'],
34
- // ['United Kingdom', '/countries/united-kingdom'],
35
34
  ['Iceland', '/countries/iceland'],
36
35
  ['Norway', '/countries/norway'],
37
36
  ['Greenland', ''],
@@ -45,19 +44,8 @@ export const regionCountries = [
45
44
  ['Ireland', '/countries/ireland'],
46
45
  ['Portugal', '/countries/portugal'],
47
46
  ['Spain', '/countries/spain'],
48
- // ['United Kingdom', '/countries/united-kingdom'],
49
47
  ],
50
48
  },
51
- // {
52
- // region: 'Balkan-Mediterranean',
53
- // countries: [
54
- // ['Bulgaria', '/countries/bulgaria'],
55
- // ['Cyprus', '/countries/cyprus'],
56
- // ['Greece', '/countries/greece'],
57
- // ['Albania', ''],
58
- // ['Republic of North Macedonia', ''],
59
- // ],
60
- // },
61
49
  {
62
50
  region: 'Baltic Sea',
63
51
  countries: [
@@ -70,8 +58,6 @@ export const regionCountries = [
70
58
  ['Poland', '/countries/poland'],
71
59
  ['Sweden', '/countries/sweden'],
72
60
  ['Norway', '/countries/norway'],
73
- // ['Russia', ''],
74
- // ['Belarus', ''],
75
61
  ],
76
62
  },
77
63
  {
@@ -124,7 +110,6 @@ export const regionCountries = [
124
110
  ['Republic of North Macedonia', ''],
125
111
  ['Slovenia', '/countries/slovenia'],
126
112
  ['Spain', '/countries/spain'],
127
- // ['United Kingdom', '/countries/united-kingdom'],
128
113
  ],
129
114
  },
130
115
  {
@@ -136,7 +121,6 @@ export const regionCountries = [
136
121
  ['France', '/countries/france'],
137
122
  ['Netherlands', '/countries/netherlands'],
138
123
  ['Sweden', '/countries/sweden'],
139
- // ['United Kingdom', '/countries/united-kingdom'],
140
124
  ['Norway', '/countries/norway'],
141
125
  ],
142
126
  },
@@ -150,7 +134,6 @@ export const regionCountries = [
150
134
  ['Luxembourg', '/countries/luxembourg'],
151
135
  ['Netherlands', '/countries/netherlands'],
152
136
  ['Switzerland', '/countries/switzerland'],
153
- // ['United Kingdom', '/countries/united-kingdom'],
154
137
  ],
155
138
  },
156
139
  {
@@ -159,12 +142,7 @@ export const regionCountries = [
159
142
  ['France', '/countries/france'],
160
143
  ['Portugal', '/countries/portugal'],
161
144
  ['Spain', '/countries/spain'],
162
- // ['United Kingdom', '/countries/united-kingdom'],
163
145
  ['Andorra', ''],
164
146
  ],
165
147
  },
166
- // {
167
- // region: 'Other regions',
168
- // countries: [],
169
- // },
170
148
  ];
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { Fragment } from 'react';
1
+ import React, { Fragment } from 'react';
3
2
  import {
4
3
  HTMLField,
5
4
  ContentMetadata,
package/src/index.js CHANGED
@@ -143,7 +143,7 @@ const applyConfig = (config) => {
143
143
  },
144
144
  headerSearchBox: [
145
145
  {
146
- isDefault: true,
146
+ isDefault: false,
147
147
  // to replace search path change path to whatever you want and match with the page in volto website
148
148
  matchpath: '/en/mission',
149
149
  path: '/en/mission/knowledge-and-data/search-the-database',
@@ -163,6 +163,16 @@ const applyConfig = (config) => {
163
163
  buttonTitle: 'Go to advanced search',
164
164
  buttonUrl: 'https://www.eea.europa.eu/en/advanced-search',
165
165
  },
166
+ {
167
+ isDefault: true,
168
+ // to replace search path change path to whatever you want and match with the page in volto website
169
+ matchpath: '/',
170
+ path: '/en/data-and-downloads',
171
+ placeholder: 'Search the Climate-ADAPT database',
172
+ description: 'Looking for more information?',
173
+ buttonTitle: 'Explore more on Climate-ADAPT',
174
+ buttonUrl: 'https://climate-adapt.eea.europa.eu/en/data-and-downloads/',
175
+ },
166
176
  ],
167
177
  logoTargetUrl: '/',
168
178
  organisationName: 'Climate-ADAPT',
@@ -0,0 +1,148 @@
1
+ import { booleanFacet } from '@eeacms/search';
2
+ import { getTodayWithTime } from './utils';
3
+
4
+ export const include_archived = booleanFacet(() => ({
5
+ field: 'IncludeArchived',
6
+ label: 'Include archived content',
7
+ id: 'archived-facet',
8
+ showInFacetsList: false,
9
+ showInSecondaryFacetsList: true,
10
+ isFilter: true, // filters don't need facet options to show up
11
+
12
+ // we want this to be applied by default
13
+ // when the facet is checked, then apply the `on` key:
14
+ off: {
15
+ constant_score: {
16
+ filter: {
17
+ bool: {
18
+ should: [
19
+ { bool: { must_not: { exists: { field: 'expires' } } } },
20
+ // Functions should be supported in the buildFilters
21
+ { range: { expires: { gte: getTodayWithTime() } } },
22
+ ],
23
+ },
24
+ },
25
+ },
26
+ },
27
+ on: null,
28
+ }));
29
+
30
+ export const objectProvides = {
31
+ field: 'objectProvides',
32
+ factory: 'MultiTermFacet',
33
+ label: 'Type of item',
34
+ showInFacetsList: true,
35
+ filterType: 'any',
36
+ isFilterable: false,
37
+ show: 10000,
38
+ isMulti: true,
39
+ iconsFamily: 'Content types',
40
+ optionsFilter: 'typesForClustersOptionsFilter',
41
+ };
42
+
43
+ export const issued_date = {
44
+ field: 'issued.date',
45
+ factory: 'DropdownRangeFilter',
46
+ wrapper: 'DummySUIFacetWrapper',
47
+ label: ' ',
48
+ showInFacetsList: false,
49
+ filterType: 'any',
50
+ isFilterable: false,
51
+ activeFilterLabel: 'Published',
52
+ isFilter: true,
53
+ showInSecondaryFacetsList: true,
54
+ isMulti: false,
55
+ ignoreFromNlp: true,
56
+ ranges: [
57
+ {
58
+ key: 'All time',
59
+ },
60
+ {
61
+ key: 'Last week',
62
+ from: 'now-1w',
63
+ to: 'now',
64
+ },
65
+ {
66
+ key: 'Last month',
67
+ from: 'now-1m',
68
+ to: 'now',
69
+ },
70
+ {
71
+ key: 'Last 3 months',
72
+ from: 'now-3m',
73
+ to: 'now',
74
+ },
75
+ {
76
+ key: 'Last year',
77
+ from: 'now-1y',
78
+ to: 'now',
79
+ },
80
+ {
81
+ key: 'Last 2 years',
82
+ from: 'now-2y',
83
+ to: 'now',
84
+ },
85
+ {
86
+ key: 'Last 5 years',
87
+ from: 'now-5y',
88
+ to: 'now',
89
+ },
90
+ ],
91
+ default: {
92
+ values: ['Last 5 years'],
93
+ type: 'any',
94
+ },
95
+ };
96
+
97
+ export const language = {
98
+ field: 'language',
99
+ factory: 'MultiTermFacet',
100
+ label: 'Language',
101
+ showInFacetsList: false,
102
+ filterType: 'any',
103
+ isFilterable: false,
104
+ show: 10000,
105
+ isMulti: true,
106
+ default: {
107
+ values: ['en'],
108
+ type: 'any',
109
+ },
110
+ facetValues: [
111
+ 'ar',
112
+ 'sr',
113
+ 'sq',
114
+ 'bg',
115
+ 'bs',
116
+ 'cs',
117
+ 'hr',
118
+ 'da',
119
+ 'nl',
120
+ 'el',
121
+ 'en',
122
+ 'et',
123
+ 'fi',
124
+ 'fr',
125
+ 'ga',
126
+ 'de',
127
+ 'hu',
128
+ 'is',
129
+ 'it',
130
+ 'lv',
131
+ 'lt',
132
+ 'mk',
133
+ 'mt',
134
+ 'no',
135
+ 'pl',
136
+ 'pt',
137
+ 'ro',
138
+ 'ru',
139
+ 'sh',
140
+ 'sk',
141
+ 'sl',
142
+ 'es',
143
+ 'sv',
144
+ 'tr',
145
+ ],
146
+ sortOn: 'custom',
147
+ sortOnCustomLabel: 'Alphabetical',
148
+ };
@@ -1,5 +1,9 @@
1
- import { booleanFacet } from '@eeacms/search';
2
- import { getTodayWithTime } from './utils';
1
+ import {
2
+ include_archived,
3
+ objectProvides,
4
+ language,
5
+ issued_date,
6
+ } from './common';
3
7
 
4
8
  const adaptation_sectors = {
5
9
  field: 'cca_adaptation_sectors.keyword',
@@ -15,110 +19,17 @@ const adaptation_sectors = {
15
19
  alwaysVisible: true,
16
20
  };
17
21
 
18
- const include_archived = booleanFacet(() => ({
19
- field: 'IncludeArchived',
20
- label: 'Include archived content',
21
- id: 'archived-facet',
22
- showInFacetsList: false,
23
- showInSecondaryFacetsList: true,
24
- isFilter: true, // filters don't need facet options to show up
25
-
26
- // we want this to be applied by default
27
- // when the facet is checked, then apply the `on` key:
28
- off: {
29
- constant_score: {
30
- filter: {
31
- bool: {
32
- should: [
33
- { bool: { must_not: { exists: { field: 'expires' } } } },
34
- // Functions should be supported in the buildFilters
35
- { range: { expires: { gte: getTodayWithTime() } } },
36
- ],
37
- },
38
- },
39
- },
40
- },
41
- on: null,
42
- }));
43
-
44
- const clusters = {
45
- field: 'op_cluster',
46
- factory: 'MultiTermFacet',
47
- isFilterable: true,
48
- isMulti: true,
49
- label: 'Section',
50
- show: 10000,
51
- showInFacetsList: false,
52
- ignoreNLPWhenActive: true,
53
- blacklist: ['Others', 'Publications'],
54
- };
55
-
56
- const objectProvides = {
57
- field: 'objectProvides',
58
- factory: 'MultiTermFacet',
59
- label: 'Type of item',
60
- showInFacetsList: true,
61
- filterType: 'any',
62
- isFilterable: false,
63
- show: 10000,
64
- isMulti: true,
65
- iconsFamily: 'Content types',
66
- optionsFilter: 'typesForClustersOptionsFilter',
67
- };
68
-
69
- const issued = {
70
- field: 'issued.date',
71
- factory: 'DropdownRangeFilter',
72
- wrapper: 'DummySUIFacetWrapper',
73
- label: ' ',
74
- showInFacetsList: false,
75
- filterType: 'any',
76
- isFilterable: false,
77
- activeFilterLabel: 'Published',
78
- isFilter: true,
79
- showInSecondaryFacetsList: true,
80
- isMulti: false,
81
- ignoreFromNlp: true,
82
- ranges: [
83
- {
84
- key: 'All time',
85
- },
86
- {
87
- key: 'Last week',
88
- from: 'now-1w',
89
- to: 'now',
90
- },
91
- {
92
- key: 'Last month',
93
- from: 'now-1m',
94
- to: 'now',
95
- },
96
- {
97
- key: 'Last 3 months',
98
- from: 'now-3m',
99
- to: 'now',
100
- },
101
- {
102
- key: 'Last year',
103
- from: 'now-1y',
104
- to: 'now',
105
- },
106
- {
107
- key: 'Last 2 years',
108
- from: 'now-2y',
109
- to: 'now',
110
- },
111
- {
112
- key: 'Last 5 years',
113
- from: 'now-5y',
114
- to: 'now',
115
- },
116
- ],
117
- default: {
118
- values: ['Last 5 years'],
119
- type: 'any',
120
- },
121
- };
22
+ // const clusters = {
23
+ // field: 'op_cluster',
24
+ // factory: 'MultiTermFacet',
25
+ // isFilterable: true,
26
+ // isMulti: true,
27
+ // label: 'Section',
28
+ // show: 10000,
29
+ // showInFacetsList: false,
30
+ // ignoreNLPWhenActive: true,
31
+ // blacklist: ['Others', 'Publications'],
32
+ // };
122
33
 
123
34
  const climate_impacts = {
124
35
  field: 'cca_climate_impacts.keyword',
@@ -129,8 +40,8 @@ const climate_impacts = {
129
40
  isFilterable: false,
130
41
  show: 10000,
131
42
  isMulti: true,
132
- sortOn: 'custom',
133
- sortOnCustomLabel: 'Alphabetical',
43
+ // sortOn: 'custom',
44
+ // sortOnCustomLabel: 'Alphabetical',
134
45
  alwaysVisible: true,
135
46
  };
136
47
 
@@ -143,8 +54,8 @@ const transnational_regions = {
143
54
  isFilterable: false,
144
55
  show: 10000,
145
56
  isMulti: true,
146
- sortOn: 'custom',
147
- sortOnCustomLabel: 'Alphabetical',
57
+ // sortOn: 'custom',
58
+ // sortOnCustomLabel: 'Alphabetical',
148
59
  };
149
60
 
150
61
  const adaptation_elements = {
@@ -156,8 +67,8 @@ const adaptation_elements = {
156
67
  isFilterable: false,
157
68
  show: 10000,
158
69
  isMulti: true,
159
- sortOn: 'custom',
160
- sortOnCustomLabel: 'Alphabetical',
70
+ // sortOn: 'custom',
71
+ // sortOnCustomLabel: 'Alphabetical',
161
72
  };
162
73
 
163
74
  const key_type_measure = {
@@ -169,8 +80,8 @@ const key_type_measure = {
169
80
  isFilterable: false,
170
81
  show: 10000,
171
82
  isMulti: true,
172
- sortOn: 'custom',
173
- sortOnCustomLabel: 'Alphabetical',
83
+ // sortOn: 'custom',
84
+ // sortOnCustomLabel: 'Alphabetical',
174
85
  };
175
86
 
176
87
  const funding_programme = {
@@ -182,8 +93,8 @@ const funding_programme = {
182
93
  isFilterable: false,
183
94
  show: 10000,
184
95
  isMulti: true,
185
- sortOn: 'custom',
186
- sortOnCustomLabel: 'Alphabetical',
96
+ // sortOn: 'custom',
97
+ // sortOnCustomLabel: 'Alphabetical',
187
98
  };
188
99
 
189
100
  const origin_websites = {
@@ -195,8 +106,8 @@ const origin_websites = {
195
106
  isFilterable: false,
196
107
  show: 10000,
197
108
  isMulti: true,
198
- sortOn: 'custom',
199
- sortOnCustomLabel: 'Alphabetical',
109
+ // sortOn: 'custom',
110
+ // sortOnCustomLabel: 'Alphabetical',
200
111
  };
201
112
 
202
113
  const geographic_countries = {
@@ -208,69 +119,16 @@ const geographic_countries = {
208
119
  isFilterable: false,
209
120
  show: 10000,
210
121
  isMulti: true,
211
- sortOn: 'custom',
212
- sortOnCustomLabel: 'Alphabetical',
213
- };
214
-
215
- const language = {
216
- field: 'language',
217
- factory: 'MultiTermFacet',
218
- label: 'Language',
219
- showInFacetsList: false,
220
- filterType: 'any',
221
- isFilterable: false,
222
- show: 10000,
223
- isMulti: true,
224
- default: {
225
- values: ['en'],
226
- type: 'any',
227
- },
228
- facetValues: [
229
- 'ar',
230
- 'sr',
231
- 'sq',
232
- 'bg',
233
- 'bs',
234
- 'cs',
235
- 'hr',
236
- 'da',
237
- 'nl',
238
- 'el',
239
- 'en',
240
- 'et',
241
- 'fi',
242
- 'fr',
243
- 'ga',
244
- 'de',
245
- 'hu',
246
- 'is',
247
- 'it',
248
- 'lv',
249
- 'lt',
250
- 'mk',
251
- 'mt',
252
- 'no',
253
- 'pl',
254
- 'pt',
255
- 'ro',
256
- 'ru',
257
- 'sh',
258
- 'sk',
259
- 'sl',
260
- 'es',
261
- 'sv',
262
- 'tr',
263
- ],
264
- sortOn: 'custom',
265
- sortOnCustomLabel: 'Alphabetical',
122
+ // sortOn: 'custom',
123
+ // sortOnCustomLabel: 'Alphabetical',
266
124
  };
267
125
 
268
126
  const facets = [
269
127
  adaptation_sectors,
270
128
  include_archived,
271
- clusters,
129
+ // clusters,
272
130
  objectProvides,
273
- issued,
131
+ issued_date,
274
132
  climate_impacts,
275
133
  transnational_regions,
276
134
  adaptation_elements,