@eeacms/volto-cca-policy 0.1.51 → 0.1.52

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,12 @@ 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.52](https://github.com/eea/volto-cca-policy/compare/0.1.51...0.1.52) - 15 December 2023
8
+
9
+ #### :rocket: New Features
10
+
11
+ - feat: add config for mission stories [kreafox - [`781f3a7`](https://github.com/eea/volto-cca-policy/commit/781f3a7692b7609b917b458dce6ef2c7effb35a4)]
12
+
7
13
  ### [0.1.51](https://github.com/eea/volto-cca-policy/compare/0.1.50...0.1.51) - 12 December 2023
8
14
 
9
15
  #### :hammer_and_wrench: Others
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
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",
@@ -0,0 +1,50 @@
1
+ import { mergeConfig } from '@eeacms/search';
2
+
3
+ import facets from './facets-mission-stories';
4
+
5
+ const getClientProxyAddress = () => {
6
+ const url = new URL(window.location);
7
+ url.pathname = '';
8
+ url.search = '';
9
+ return url.toString();
10
+ };
11
+
12
+ const missionStoriesConfig = {
13
+ title: 'Mission stories',
14
+ ...facets,
15
+ // ...views,
16
+ };
17
+
18
+ export default function installMissionStoriesSearch(config) {
19
+ const envConfig = process.env.RAZZLE_ENV_CONFIG
20
+ ? JSON.parse(process.env.RAZZLE_ENV_CONFIG)
21
+ : missionStoriesConfig;
22
+
23
+ const pjson = require('@eeacms/volto-cca-policy/../package.json');
24
+ envConfig.app_name = pjson.name;
25
+ envConfig.app_version = pjson.version;
26
+
27
+ config.searchui.missionStoriesSearch = {
28
+ ...mergeConfig(envConfig, config.searchui.globalsearchbase),
29
+ elastic_index: '_es/missionStoriesSearch',
30
+ index_name: 'ccatest_searchui',
31
+ host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
32
+ };
33
+
34
+ const { missionStoriesSearch } = config.searchui;
35
+
36
+ missionStoriesSearch.permanentFilters.push({
37
+ terms: {
38
+ objectProvides: ['mission_storyy'],
39
+ },
40
+ });
41
+
42
+ missionStoriesSearch.facets = facets;
43
+
44
+ if (typeof window !== 'undefined') {
45
+ config.searchui.missionStoriesSearch.host =
46
+ process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
47
+ }
48
+
49
+ return config;
50
+ }
@@ -0,0 +1,41 @@
1
+ import { multiTermFacet } from '@eeacms/search';
2
+
3
+ import globalSearchBaseConfig from '@eeacms/volto-globalsearch/config/global-search-base-config.js';
4
+
5
+ const facets = [
6
+ ...globalSearchBaseConfig.facets,
7
+ // multiTermFacet({
8
+ // field: 'spatial',
9
+ // isFilterable: false,
10
+ // isMulti: true,
11
+ // label: 'Country',
12
+ // iconsFamily: 'Country',
13
+ // alwaysVisible: false,
14
+ // }),
15
+ multiTermFacet({
16
+ field: 'cca_adaptation_sectors.keyword',
17
+ isFilterable: false,
18
+ isMulti: true,
19
+ label: 'Sectors',
20
+ iconsFamily: 'Sectors',
21
+ alwaysVisible: false,
22
+ }),
23
+ multiTermFacet({
24
+ field: 'key_system.keyword',
25
+ isFilterable: false,
26
+ isMulti: true,
27
+ label: 'Key System',
28
+ iconsFamily: 'Key System',
29
+ alwaysVisible: false,
30
+ }),
31
+ multiTermFacet({
32
+ field: 'climate_threats.keyword',
33
+ isFilterable: false,
34
+ isMulti: true,
35
+ label: 'Hazard Type',
36
+ iconsFamily: 'Hazard Type',
37
+ alwaysVisible: false,
38
+ }),
39
+ ];
40
+
41
+ export default facets;
@@ -1,5 +1,6 @@
1
1
  import installMainSearch from './config';
2
2
  import installHealthSearch from './config-health';
3
+ import installMissionStoriesSearch from './config-mission-stories';
3
4
 
4
5
  // import DatahubCardItem from './components/Result/DatahubCardItem';
5
6
  // import DatahubItemView from './components/ItemView/ItemView';
@@ -21,7 +22,9 @@ const applyConfig = (config) => {
21
22
  config.settings.searchlib = installHealthSearch(
22
23
  installMainSearch(config.settings.searchlib),
23
24
  );
24
-
25
+ config.settings.searchlib = installMissionStoriesSearch(
26
+ config.settings.searchlib,
27
+ );
25
28
  return config;
26
29
  };
27
30