@eeacms/volto-cca-policy 0.2.22 → 0.2.24

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/locales/bg/LC_MESSAGES/volto.po +3461 -0
  3. package/locales/cs/LC_MESSAGES/volto.po +3428 -0
  4. package/locales/de/LC_MESSAGES/volto.po +251 -846
  5. package/locales/eea.climateadapt.frontpage.pot +0 -505
  6. package/locales/eea.climateadapt.observatory.frontpage.pot +0 -136
  7. package/locales/eea.climateadapt.pot +0 -112
  8. package/locales/en/LC_MESSAGES/volto.po +253 -848
  9. package/locales/es/LC_MESSAGES/volto.po +251 -846
  10. package/locales/et/LC_MESSAGES/volto.po +3421 -0
  11. package/locales/fi/LC_MESSAGES/volto.po +3445 -0
  12. package/locales/fr/LC_MESSAGES/volto.po +251 -846
  13. package/locales/ga/LC_MESSAGES/volto.po +3467 -0
  14. package/locales/hr/LC_MESSAGES/volto.po +3425 -0
  15. package/locales/hu/LC_MESSAGES/volto.po +3472 -0
  16. package/locales/it/LC_MESSAGES/volto.po +251 -846
  17. package/locales/lt/LC_MESSAGES/volto.po +3433 -0
  18. package/locales/nl/LC_MESSAGES/volto.po +3460 -0
  19. package/locales/pl/LC_MESSAGES/volto.po +251 -846
  20. package/locales/pt/LC_MESSAGES/volto.po +3447 -0
  21. package/locales/ro/LC_MESSAGES/volto.po +1119 -1545
  22. package/locales/sl/LC_MESSAGES/volto.po +3438 -0
  23. package/locales/tmx/Readme.md +24 -0
  24. package/locales/tmx/data/volto_BG.tmx +7091 -0
  25. package/locales/tmx/data/volto_CS.tmx +7091 -0
  26. package/locales/tmx/data/volto_ET.tmx +7091 -0
  27. package/locales/tmx/data/volto_FI.tmx +7091 -0
  28. package/locales/tmx/data/volto_GA.tmx +7091 -0
  29. package/locales/tmx/data/volto_HR.tmx +7091 -0
  30. package/locales/tmx/data/volto_HU.tmx +7091 -0
  31. package/locales/tmx/data/volto_LT.tmx +7091 -0
  32. package/locales/tmx/data/volto_NL.tmx +7091 -0
  33. package/locales/tmx/data/volto_PT.tmx +7091 -0
  34. package/locales/tmx/data/volto_RO.tmx +7091 -0
  35. package/locales/tmx/data/volto_SL.tmx +7091 -0
  36. package/locales/tmx/run.py +61 -0
  37. package/locales/volto.pot +75 -1
  38. package/package.json +9 -16
  39. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.jsx +25 -8
  40. package/src/components/manage/Blocks/ContentLinks/ContentLinksView.test.jsx +20 -1
  41. package/src/components/manage/Blocks/ContentLinks/DropdownListView.jsx +48 -0
  42. package/src/components/manage/Blocks/ContentLinks/index.js +14 -0
  43. package/src/components/manage/Blocks/ContentLinks/style.less +18 -0
  44. package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +3 -3
  45. package/src/components/manage/Blocks/CountryMapProfile/styles.less +15 -1
  46. package/src/components/manage/Blocks/Listing/DropdownListingView.jsx +49 -0
  47. package/src/components/manage/Blocks/Listing/index.js +15 -0
  48. package/src/components/manage/Blocks/Listing/styles.less +18 -0
  49. package/src/components/manage/Blocks/RelevantAceContent/RelevantAceContentView.jsx +21 -41
  50. package/src/search/index.js +12 -16
  51. package/src/search/mission_funding/config-funding.js +44 -0
  52. package/src/search/mission_funding/facets-funding.js +28 -0
@@ -21,57 +21,37 @@ const RelevantAceContentView = (props) => {
21
21
  const hasAnyFilter = [element_type, sector, search_type, special_tags].some(
22
22
  (list) => list?.length > 0,
23
23
  );
24
+ const showBlock = (items && items.length > 0) || results.length > 0;
24
25
 
25
- return (
26
+ const itemList = (items || []).map((item, index) => (
27
+ <List.Item key={index}>
28
+ <Link to={flattenToAppURL(item.link)}>{item.item_title}</Link>
29
+ </List.Item>
30
+ ));
31
+ const resultsList = results.map((result, index) => (
32
+ <List.Item key={index} title={result[1]}>
33
+ <Link to={flattenToAppURL(result[4])}>{result[0]}</Link>
34
+ </List.Item>
35
+ ));
36
+ const showResults = hasAnyFilter || search_text != null;
37
+
38
+ return showBlock ? (
26
39
  <div className="block relevant-acecontent-block">
27
40
  {title && <h4>{title}</h4>}
28
41
 
29
42
  {combine_results ? (
30
43
  <>
31
- {(items || []).map((item, index) => (
32
- <List.Item key={index}>
33
- <Link to={flattenToAppURL(item.link)}>{item.item_title}</Link>
34
- </List.Item>
35
- ))}
36
-
37
- {!isEdit && (hasAnyFilter || search_text != null) && (
38
- <>
39
- {results.map((result, index) => (
40
- <List.Item key={index} title={result[1]}>
41
- <Link to={flattenToAppURL(result[4])}>{result[0]}</Link>
42
- </List.Item>
43
- ))}
44
- </>
45
- )}
44
+ {itemList}
45
+ {!isEdit && showResults && resultsList}
46
46
  </>
47
+ ) : items && items.length > 0 ? (
48
+ itemList
47
49
  ) : (
48
- <>
49
- {items && items.length > 0 ? (
50
- <>
51
- {items.map((item, index) => (
52
- <List.Item key={index}>
53
- <Link to={flattenToAppURL(item.link)}>{item.item_title}</Link>
54
- </List.Item>
55
- ))}
56
- </>
57
- ) : (
58
- <>
59
- {!isEdit && (hasAnyFilter || search_text != null) && (
60
- <>
61
- {results.map((result, index) => (
62
- <List.Item key={index} title={result[1]}>
63
- <Link to={flattenToAppURL(result[4])}>{result[0]}</Link>
64
- </List.Item>
65
- ))}
66
- </>
67
- )}
68
- </>
69
- )}
70
- </>
50
+ !isEdit && showResults && resultsList
71
51
  )}
72
-
73
- {isEdit && <div>Relevant AceContent Block</div>}
74
52
  </div>
53
+ ) : (
54
+ <>{isEdit && <div>No items</div>}</>
75
55
  );
76
56
  };
77
57
 
@@ -1,8 +1,9 @@
1
1
  import installMainSearch from './config';
2
2
  import installHealthSearch from './health_observatory/config-health';
3
3
  import installMissionStoriesSearch from './mission_stories/config-stories';
4
- import installMissionProjectsSearch from './mission_projects/config-projects';
5
4
  import installMissionToolsSearch from './mission_tools/config-tools';
5
+ import installMissionProjectsSearch from './mission_projects/config-projects';
6
+ import installMissionFundingSearch from './mission_funding/config-funding';
6
7
 
7
8
  const extraQueryParams = {
8
9
  text_fields: [
@@ -25,21 +26,14 @@ const extraQueryParams = {
25
26
  };
26
27
 
27
28
  const applyConfig = (config) => {
28
- config.settings.searchlib = installHealthSearch(
29
- installMainSearch(config.settings.searchlib),
30
- );
31
-
32
- config.settings.searchlib = installMissionStoriesSearch(
33
- config.settings.searchlib,
34
- );
35
-
36
- config.settings.searchlib = installMissionProjectsSearch(
37
- installMainSearch(config.settings.searchlib),
38
- );
39
-
40
- config.settings.searchlib = installMissionToolsSearch(
41
- installMainSearch(config.settings.searchlib),
42
- );
29
+ config.settings.searchlib = [
30
+ installMainSearch,
31
+ installHealthSearch,
32
+ installMissionStoriesSearch,
33
+ installMissionProjectsSearch,
34
+ installMissionToolsSearch,
35
+ installMissionFundingSearch,
36
+ ].reduce((acc, cur) => cur(acc), config.settings.searchlib);
43
37
 
44
38
  config.settings.searchlib.searchui.ccaSearch.extraQueryParams = extraQueryParams;
45
39
  config.settings.searchlib.searchui.ccaHealthSearch.extraQueryParams = extraQueryParams;
@@ -47,6 +41,8 @@ const applyConfig = (config) => {
47
41
  config.settings.searchlib.searchui.missionStoriesSearch.extraQueryParams = extraQueryParams;
48
42
  config.settings.searchlib.searchui.missionToolsSearch.extraQueryParams = extraQueryParams;
49
43
 
44
+ // console.log(config.settings.searchlib);
45
+
50
46
  return config;
51
47
  };
52
48
  export default applyConfig;
@@ -0,0 +1,44 @@
1
+ import { mergeConfig } from '@eeacms/search';
2
+ import { getClientProxyAddress } from '../utils';
3
+
4
+ import facets from './facets-funding';
5
+
6
+ const missionFundingSearchConfig = {
7
+ title: 'Mission Funding Search',
8
+ ...facets,
9
+ };
10
+
11
+ export default function installMissionFundingSearch(config) {
12
+ const envConfig = process.env.RAZZLE_ENV_CONFIG
13
+ ? JSON.parse(process.env.RAZZLE_ENV_CONFIG)
14
+ : missionFundingSearchConfig;
15
+
16
+ const pjson = require('@eeacms/volto-cca-policy/../package.json');
17
+ envConfig.app_name = pjson.name;
18
+ envConfig.app_version = pjson.version;
19
+
20
+ config.searchui.missionFundingSearch = {
21
+ ...mergeConfig(envConfig, config.searchui.globalsearchbase),
22
+ elastic_index: '_es/globalsearch',
23
+ index_name: 'data_searchui',
24
+ host: process.env.RAZZLE_ES_PROXY_ADDR || 'http://localhost:3000',
25
+ vocab: {
26
+ cluster_name: {
27
+ cca: 'Mission Portal',
28
+ },
29
+ },
30
+ };
31
+
32
+ const { missionFundingSearch } = config.searchui;
33
+
34
+ missionFundingSearch.facets = facets;
35
+
36
+ if (typeof window !== 'undefined') {
37
+ config.searchui.missionFundingSearch.host =
38
+ process.env.RAZZLE_ES_PROXY_ADDR || getClientProxyAddress();
39
+ }
40
+
41
+ // console.log(config.searchui);
42
+
43
+ return config;
44
+ }
@@ -0,0 +1,28 @@
1
+ import { multiTermFacet } from '@eeacms/search';
2
+
3
+ import globalSearchBaseConfig from '@eeacms/volto-globalsearch/config/global-search-base-config.js';
4
+ import { cca_adaptation_sectors } from './../common';
5
+
6
+ const blacklist = ['IncludeArchived', 'issued.date'];
7
+
8
+ const facets = [
9
+ multiTermFacet({
10
+ field: 'cca_rast_steps.keyword',
11
+ isFilterable: false,
12
+ isMulti: true,
13
+ label: 'RAST step(s) of relevance',
14
+ alwaysVisible: false,
15
+ }),
16
+ multiTermFacet({
17
+ field: 'cca_eligible_entities.keyword',
18
+ isFilterable: false,
19
+ isMulti: true,
20
+ label: 'Eligible to receive funding',
21
+ alwaysVisible: false,
22
+ }),
23
+ cca_adaptation_sectors,
24
+
25
+ ...globalSearchBaseConfig.facets.filter((f) => !blacklist.includes(f.field)),
26
+ ];
27
+
28
+ export default facets;