@eeacms/volto-cca-policy 0.2.54 → 0.2.55

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,11 +4,16 @@ 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.54](https://github.com/eea/volto-cca-policy/compare/0.2.53...0.2.54) - 12 July 2024
7
+ ### [0.2.55](https://github.com/eea/volto-cca-policy/compare/0.2.54...0.2.55) - 18 July 2024
8
8
 
9
9
  #### :hammer_and_wrench: Others
10
10
 
11
- - Refs #271901 - allow all events path [Tripon Eugen - [`854acb4`](https://github.com/eea/volto-cca-policy/commit/854acb467008ee11272de953d22eb1f7628b1d23)]
11
+ - Refs #271901 - datablocks version back [Tripon Eugen - [`7ebd292`](https://github.com/eea/volto-cca-policy/commit/7ebd29257ebb11d85d72730e77b8ec48d3fa2a90)]
12
+ - Refs #271901 - datablocks pin version [Tripon Eugen - [`913ef74`](https://github.com/eea/volto-cca-policy/commit/913ef74b7abc324a733700dffe115606d570bd18)]
13
+ - Refs #271901 - typo and filters update [Tripon Eugen - [`242d273`](https://github.com/eea/volto-cca-policy/commit/242d27372a4d7b9361b8e09dbf47c923281183c3)]
14
+ - Refs #271901 - typo and filters update [Tripon Eugen - [`1069116`](https://github.com/eea/volto-cca-policy/commit/1069116d582905d3a9794cead6f1a8a78b386062)]
15
+ ### [0.2.54](https://github.com/eea/volto-cca-policy/compare/0.2.53...0.2.54) - 12 July 2024
16
+
12
17
  ### [0.2.53](https://github.com/eea/volto-cca-policy/compare/0.2.52...0.2.53) - 11 July 2024
13
18
 
14
19
  #### :house: Internal changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.2.54",
3
+ "version": "0.2.55",
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",
@@ -33,12 +33,12 @@
33
33
  "@eeacms/volto-eea-website-theme": "^1.33.2",
34
34
  "@eeacms/volto-embed": "^9.1.1",
35
35
  "@eeacms/volto-globalsearch": "^1.1.0",
36
+ "@eeacms/volto-hero-block": "^7.1.0",
36
37
  "@eeacms/volto-openlayers-map": "*",
37
38
  "@eeacms/volto-searchlib": "2.0.2",
38
- "@elastic/search-ui": "1.21.2",
39
39
  "@eeacms/volto-slate-label": "^0.6.0",
40
40
  "@eeacms/volto-tabs-block": "^7.5.1",
41
- "@eeacms/volto-hero-block": "^7.1.0",
41
+ "@elastic/search-ui": "1.21.2",
42
42
  "d3-array": "^2.12.1",
43
43
  "jotai": "^1.6.0",
44
44
  "query-string": "7.1.0",
package/razzle.extend.js CHANGED
@@ -1,4 +1,8 @@
1
1
  const path = require('path');
2
+
3
+ const makeLoaderFinder = require('razzle-dev-utils/makeLoaderFinder');
4
+ const babelLoaderFinder = makeLoaderFinder('babel-loader');
5
+
2
6
  const plugins = (defaultPlugins) => {
3
7
  return defaultPlugins;
4
8
  };
@@ -20,6 +24,16 @@ const modify = (config, { target, dev }, webpack) => {
20
24
  ? themeLessPath
21
25
  : semanticLessPath;
22
26
 
27
+ const babelLoader = config.module.rules.find(babelLoaderFinder);
28
+ const sanitizePath = path.join(
29
+ path.dirname(require.resolve('sanitize-html')),
30
+ );
31
+ const { include } = babelLoader;
32
+ const htmlParserPath = `${sanitizePath}/node_modules/htmlparser2/lib/esm/`;
33
+
34
+ include.push(sanitizePath);
35
+ include.push(htmlParserPath);
36
+
23
37
  return config;
24
38
  };
25
39
 
@@ -40,25 +40,39 @@ export function filterCases(cases, activeFilters) {
40
40
  )
41
41
  return _case;
42
42
 
43
- let flag = false;
43
+ let flag = {
44
+ sectors: false,
45
+ elements: false,
46
+ measures: false,
47
+ impacts: false,
48
+ };
44
49
 
45
50
  activeFilters.sectors.forEach((filter) => {
46
- if (_case.properties.sectors.includes(',' + filter + ',')) flag = true;
51
+ if (_case.properties.sectors.includes(',' + filter + ','))
52
+ flag.sectors = true;
47
53
  });
48
54
 
49
55
  activeFilters.elements.forEach((filter) => {
50
- if (_case.properties.elements.includes(',' + filter + ',')) flag = true;
56
+ if (_case.properties.elements.includes(',' + filter + ','))
57
+ flag.elements = true;
51
58
  });
52
59
 
53
60
  activeFilters.impacts.forEach((filter) => {
54
- if (_case.properties.impacts.includes(',' + filter + ',')) flag = true;
61
+ if (_case.properties.impacts.includes(',' + filter + ','))
62
+ flag.impacts = true;
55
63
  });
56
64
 
57
65
  activeFilters.measures.forEach((filter) => {
58
- if (_case.properties.ktms.includes(',' + filter + ',')) flag = true;
66
+ if (_case.properties.ktms.includes(',' + filter + ','))
67
+ flag.measures = true;
59
68
  });
60
69
 
61
- return flag ? _case : false;
70
+ return (activeFilters.sectors.length ? flag.sectors : true) &&
71
+ (activeFilters.elements.length ? flag.elements : true) &&
72
+ (activeFilters.impacts.length ? flag.impacts : true) &&
73
+ (activeFilters.measures.length ? flag.measures : true)
74
+ ? _case
75
+ : false;
62
76
  });
63
77
 
64
78
  return data;
@@ -40,18 +40,15 @@ export default function installMainSearch(config) {
40
40
  cluster_name: {
41
41
  cca: 'Mission Portal',
42
42
  },
43
+ objectProvides: {
44
+ 'Funding oportunity': 'Funding opportunity',
45
+ },
43
46
  },
44
47
  runtime_mappings: build_runtime_mappings(clusters),
45
48
  };
46
49
 
47
50
  const { missionAll } = config.searchui;
48
51
 
49
- // missionAll.permanentFilters.push({
50
- // term: {
51
- // cca_include_in_mission: 'true',
52
- // },
53
- // });
54
-
55
52
  missionAll.permanentFilters.push({
56
53
  term: {
57
54
  cluster_name: 'cca',
@@ -68,38 +65,10 @@ export default function installMainSearch(config) {
68
65
  // ],
69
66
  // },
70
67
  // });
71
- // missionAll.permanentFilters.push({
72
- // prefix: {
73
- // 'id.keyword': 'https://climate-adapt.eea.europa.eu/en/mission',
74
- // },
75
- // });
76
68
 
77
69
  missionAll.permanentFilters.push({
78
70
  bool: {
79
71
  should: [
80
- // {
81
- // terms: {
82
- // objectProvides: [
83
- // 'Funding oportunity',
84
- // 'Mission tool',
85
- // 'Mission story',
86
- // 'News',
87
- // 'Events',
88
- // 'Webpage',
89
- // // '',
90
- // // 'Adaptation option',
91
- // // 'Case study',
92
- // // 'Guidance',
93
- // // 'Video',
94
- // // 'Indicator',
95
- // // 'Information portal',
96
- // // 'Organisation',
97
- // // 'Publication reference',
98
- // // 'Research and knowledge project',
99
- // // 'Tool',
100
- // ],
101
- // },
102
- // },
103
72
  {
104
73
  term: {
105
74
  cca_include_in_mission: 'true',
@@ -115,30 +84,6 @@ export default function installMainSearch(config) {
115
84
  },
116
85
  });
117
86
 
118
- // missionAll.permanentFilters.push({
119
- // terms: {
120
- // objectProvides: [
121
- // 'Funding oportunity',
122
- // 'Mission tool',
123
- // 'Mission story',
124
- // 'News',
125
- // 'Events',
126
- // 'Webpage',
127
- // // '',
128
- // 'Adaptation option',
129
- // 'Case study',
130
- // 'Guidance',
131
- // 'Video',
132
- // 'Indicator',
133
- // 'Information portal',
134
- // 'Organisation',
135
- // 'Publication reference',
136
- // 'Research and knowledge project',
137
- // 'Tool',
138
- // ],
139
- // },
140
- // });
141
-
142
87
  missionAll.facets = facets;
143
88
 
144
89
  if (typeof window !== 'undefined') {
@@ -8,8 +8,18 @@ import {
8
8
  cca_adaptation_sectors,
9
9
  } from '../common';
10
10
 
11
+ let globalFacets = globalSearchBaseConfig.facets;
12
+ for (let i = 0; i < globalFacets.length; i++) {
13
+ if (globalFacets[i]['field'] === 'IncludeArchived') {
14
+ globalFacets[i]['showInSecondaryFacetsList'] = false;
15
+ }
16
+ if (globalFacets[i]['field'] === 'issued.date') {
17
+ globalFacets[i]['showInSecondaryFacetsList'] = false;
18
+ }
19
+ }
20
+
11
21
  const facets = [
12
- ...globalSearchBaseConfig.facets,
22
+ ...globalFacets,
13
23
  cca_climate_impacts,
14
24
  cca_adaptation_sectors,
15
25
  multiTermFacet({