@eeacms/volto-cca-policy 0.3.0 → 0.3.2

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 (31) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/locales/bg/LC_MESSAGES/volto.po +150 -22
  3. package/locales/cs/LC_MESSAGES/volto.po +150 -22
  4. package/locales/de/LC_MESSAGES/volto.po +150 -22
  5. package/locales/en/LC_MESSAGES/volto.po +150 -22
  6. package/locales/es/LC_MESSAGES/volto.po +150 -22
  7. package/locales/et/LC_MESSAGES/volto.po +150 -22
  8. package/locales/fi/LC_MESSAGES/volto.po +150 -22
  9. package/locales/fr/LC_MESSAGES/volto.po +150 -22
  10. package/locales/ga/LC_MESSAGES/volto.po +150 -22
  11. package/locales/hr/LC_MESSAGES/volto.po +150 -22
  12. package/locales/hu/LC_MESSAGES/volto.po +150 -22
  13. package/locales/it/LC_MESSAGES/volto.po +150 -22
  14. package/locales/lt/LC_MESSAGES/volto.po +150 -22
  15. package/locales/nl/LC_MESSAGES/volto.po +150 -22
  16. package/locales/pl/LC_MESSAGES/volto.po +150 -22
  17. package/locales/pt/LC_MESSAGES/volto.po +150 -22
  18. package/locales/ro/LC_MESSAGES/volto.po +150 -22
  19. package/locales/sl/LC_MESSAGES/volto.po +150 -22
  20. package/locales/volto.pot +151 -1
  21. package/package.json +3 -3
  22. package/src/components/Result/ClusterHorizontalCardItem.jsx +13 -3
  23. package/src/components/Result/HealthHorizontalCardItem.jsx +7 -2
  24. package/src/search/cca/facets.js +45 -8
  25. package/src/search/common.js +38 -13
  26. package/src/search/health_observatory/config-health.js +17 -0
  27. package/src/search/health_observatory/facets-health.js +28 -4
  28. package/src/search/mission_all/facets-all.js +17 -2
  29. package/src/search/mission_funding/facets-funding.js +14 -2
  30. package/src/search/mission_projects/facets-projects.js +15 -2
  31. package/src/search/mission_tools/facets-tools.js +27 -5
@@ -13,6 +13,7 @@ import { firstWords, getTermDisplayValue } from '@eeacms/search/lib/utils';
13
13
  import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
14
14
  import ResultContext from '@eeacms/search/components/Result/ResultContext';
15
15
  import ContentClusters from '@eeacms/search/components/Result/ContentClusters';
16
+ import { FormattedMessage } from 'react-intl';
16
17
 
17
18
  const healthBreadcrumb = (href) => {
18
19
  // It's only cosmetic. We don't want to show ++aq...
@@ -29,13 +30,17 @@ const ExtraContent = (props) => {
29
30
  <DateTime format="DATE_MED" value={result.issued} />
30
31
  </div>
31
32
  <div className="result-info">
32
- <span className="result-info-title">Topics: </span>
33
+ <span className="result-info-title">
34
+ <FormattedMessage id="Topics:" defaultMessage="Topics:" />{' '}
35
+ </span>
33
36
  <StringList value={result.tags} />
34
37
  </div>
35
38
  </div>
36
39
  <div>
37
40
  <div className="result-info result-source">
38
- <span className="result-info-title">Source: </span>
41
+ <span className="result-info-title">
42
+ <FormattedMessage id="Source:" defaultMessage="Source:" />{' '}
43
+ </span>
39
44
  <ExternalLink href={result.href}>
40
45
  <strong title={result.source} className="source">
41
46
  {firstWords(
@@ -5,10 +5,47 @@ import {
5
5
  geographic_countries,
6
6
  } from '../common';
7
7
 
8
+ import { defineMessages } from 'react-intl';
9
+
10
+ const messages = defineMessages({
11
+ adaptationApproaches: {
12
+ id: 'Adaptation Approaches',
13
+ defaultMessage: 'Adaptation Approaches',
14
+ },
15
+ adaptationSectors: {
16
+ id: 'Adaptation Sectors',
17
+ defaultMessage: 'Adaptation Sectors',
18
+ },
19
+ climateImpacts: {
20
+ id: 'Climate Impacts',
21
+ defaultMessage: 'Climate Impacts',
22
+ },
23
+ fundingProgramme: {
24
+ id: 'Funding Programme',
25
+ defaultMessage: 'Funding Programme',
26
+ },
27
+ itemFromThirdParties: {
28
+ id: 'Item from third parties',
29
+ defaultMessage: 'Item from third parties',
30
+ },
31
+ keyTypeMeasure: {
32
+ id: 'Key Type Measure',
33
+ defaultMessage: 'Key Type Measure',
34
+ },
35
+ section: {
36
+ id: 'Section',
37
+ defaultMessage: 'Section',
38
+ },
39
+ transnationalRegions: {
40
+ id: 'Transnational regions',
41
+ defaultMessage: 'Transnational regions',
42
+ },
43
+ });
44
+
8
45
  const adaptation_sectors = {
9
46
  field: 'cca_adaptation_sectors.keyword',
10
47
  factory: 'MultiTermFacet',
11
- label: 'Adaptation Sectors',
48
+ label: messages.adaptationSectors,
12
49
  showInFacetsList: true,
13
50
  filterType: 'any',
14
51
  isFilterable: true,
@@ -23,7 +60,7 @@ const op_cluster = {
23
60
  factory: 'MultiTermFacet',
24
61
  isFilterable: true,
25
62
  isMulti: true,
26
- label: 'Section',
63
+ label: messages.section,
27
64
  show: 10000,
28
65
  showInFacetsList: false,
29
66
  ignoreNLPWhenActive: true,
@@ -44,7 +81,7 @@ const op_cluster = {
44
81
  const climate_impacts = {
45
82
  field: 'cca_climate_impacts.keyword',
46
83
  factory: 'MultiTermFacet',
47
- label: 'Climate impacts',
84
+ label: messages.climateImpacts,
48
85
  showInFacetsList: true,
49
86
  filterType: 'any',
50
87
  isFilterable: false,
@@ -58,7 +95,7 @@ const climate_impacts = {
58
95
  const transnational_regions = {
59
96
  field: 'cca_geographic_transnational_region.keyword',
60
97
  factory: 'MultiTermFacet',
61
- label: 'Transnational regions',
98
+ label: messages.transnationalRegions,
62
99
  showInFacetsList: true,
63
100
  filterType: 'any',
64
101
  isFilterable: false,
@@ -71,7 +108,7 @@ const transnational_regions = {
71
108
  const adaptation_elements = {
72
109
  field: 'cca_adaptation_elements.keyword',
73
110
  factory: 'MultiTermFacet',
74
- label: 'Adaptation Approaches',
111
+ label: messages.adaptationApproaches,
75
112
  showInFacetsList: true,
76
113
  filterType: 'any',
77
114
  isFilterable: false,
@@ -84,7 +121,7 @@ const adaptation_elements = {
84
121
  const key_type_measure = {
85
122
  field: 'cca_key_type_measure.keyword',
86
123
  factory: 'MultiTermFacet',
87
- label: 'Key Type Measure',
124
+ label: messages.keyTypeMeasure,
88
125
  showInFacetsList: true,
89
126
  filterType: 'any',
90
127
  isFilterable: false,
@@ -97,7 +134,7 @@ const key_type_measure = {
97
134
  const funding_programme = {
98
135
  field: 'cca_funding_programme.keyword',
99
136
  factory: 'MultiTermFacet',
100
- label: 'Funding Programme',
137
+ label: messages.fundingProgramme,
101
138
  showInFacetsList: true,
102
139
  filterType: 'any',
103
140
  isFilterable: false,
@@ -110,7 +147,7 @@ const funding_programme = {
110
147
  const origin_websites = {
111
148
  field: 'cca_origin_websites.keyword',
112
149
  factory: 'MultiTermFacet',
113
- label: 'Item from third parties',
150
+ label: messages.itemFromThirdParties,
114
151
  showInFacetsList: true,
115
152
  filterType: 'any',
116
153
  isFilterable: false,
@@ -1,10 +1,39 @@
1
1
  import { booleanFacet } from '@eeacms/search';
2
2
  import { getTodayWithTime } from './utils';
3
3
 
4
+ import { defineMessages } from 'react-intl';
5
+
6
+ const messages = defineMessages({
7
+ countries: {
8
+ id: 'Countries',
9
+ defaultMessage: 'Countries',
10
+ },
11
+ climateImpacts: {
12
+ id: 'Climate Impacts',
13
+ defaultMessage: 'Climate Impacts',
14
+ },
15
+ adaptationSectors: {
16
+ id: 'Adaptation Sectors',
17
+ defaultMessage: 'Adaptation Sectors',
18
+ },
19
+ includeArchivedContent: {
20
+ id: 'Include archived content',
21
+ defaultMessage: 'Include archived content',
22
+ },
23
+ typeOfItem: {
24
+ id: 'Type of item',
25
+ defaultMessage: 'Type of item',
26
+ },
27
+ language: {
28
+ id: 'Language',
29
+ defaultMessage: 'Language',
30
+ },
31
+ });
32
+
4
33
  export const geographic_countries = {
5
34
  field: 'cca_geographic_countries.keyword',
6
35
  factory: 'MultiTermFacet',
7
- label: 'Countries',
36
+ label: messages.countries,
8
37
  showInFacetsList: true,
9
38
  filterType: 'any',
10
39
  isFilterable: false,
@@ -15,7 +44,7 @@ export const geographic_countries = {
15
44
  export const cca_climate_impacts = {
16
45
  field: 'cca_climate_impacts.keyword',
17
46
  factory: 'MultiTermFacet',
18
- label: 'Climate Impacts',
47
+ label: messages.climateImpacts,
19
48
  showInFacetsList: true,
20
49
  filterType: 'any',
21
50
  isFilterable: false,
@@ -26,7 +55,7 @@ export const cca_climate_impacts = {
26
55
  export const cca_adaptation_sectors = {
27
56
  field: 'cca_adaptation_sectors.keyword',
28
57
  factory: 'MultiTermFacet',
29
- label: 'Adaptation Sectors',
58
+ label: messages.adaptationSectors,
30
59
  showInFacetsList: true,
31
60
  filterType: 'any',
32
61
  isFilterable: false,
@@ -36,7 +65,7 @@ export const cca_adaptation_sectors = {
36
65
 
37
66
  export const include_archived = booleanFacet(() => ({
38
67
  field: 'IncludeArchived',
39
- label: 'Include archived content',
68
+ label: messages.includeArchivedContent,
40
69
  id: 'IncludeArchived',
41
70
  showInFacetsList: false,
42
71
  showInSecondaryFacetsList: true,
@@ -63,7 +92,7 @@ export const include_archived = booleanFacet(() => ({
63
92
  export const objectProvides = {
64
93
  field: 'objectProvides',
65
94
  factory: 'MultiTermFacet',
66
- label: 'Type of item',
95
+ label: messages.typeOfItem,
67
96
  showInFacetsList: true,
68
97
  filterType: 'any',
69
98
  isFilterable: false,
@@ -130,19 +159,15 @@ export const issued_date = {
130
159
  export const language = {
131
160
  field: 'language',
132
161
  factory: 'MultiTermFacet',
133
- label: 'Language',
162
+ label: messages.language,
134
163
  showInFacetsList: false,
135
164
  filterType: 'any',
136
165
  isFilterable: false,
137
166
  show: 10000,
138
167
  isMulti: true,
139
- default: (options) => {
140
- const { language } = options || {};
141
- // console.log('options', options);
142
- return {
143
- values: [language || 'en'],
144
- type: 'any',
145
- };
168
+ default: {
169
+ values: ['en'],
170
+ type: 'any',
146
171
  },
147
172
  facetValues: [
148
173
  'de',
@@ -6,6 +6,20 @@ import vocabs from './../vocabulary';
6
6
  import facets from './facets-health';
7
7
  import views from './views-health';
8
8
 
9
+ // import { defineMessages } from 'react-intl';
10
+
11
+ // const messages = defineMessages({
12
+ // types: {
13
+ // id: 'Types',
14
+ // defaultMessage: 'Types',
15
+ // },
16
+ // healthImpacts: { id: 'Health Impacts', defaultMessage: 'Health Impacts' },
17
+ // observatoryPartner: {
18
+ // id: 'Observatory partner',
19
+ // defaultMessage: 'Observatory partner',
20
+ // },
21
+ // });
22
+
9
23
  const ccaConfig = {
10
24
  title: 'ClimateAdapt Health',
11
25
  ...views,
@@ -133,6 +147,7 @@ export default function installMainSearch(config) {
133
147
  {
134
148
  id: 'types',
135
149
  title: 'Types',
150
+ // title: messages.types,
136
151
  facetField: 'objectProvides',
137
152
  sortOn: 'alpha',
138
153
  icon: {
@@ -142,6 +157,7 @@ export default function installMainSearch(config) {
142
157
  {
143
158
  id: 'healthImpacts',
144
159
  title: 'Health Impacts',
160
+ // title: messages.healthImpacts,
145
161
  facetField: 'cca_health_impacts.keyword',
146
162
  sortOn: 'alpha',
147
163
  whitelist: [
@@ -155,6 +171,7 @@ export default function installMainSearch(config) {
155
171
  {
156
172
  id: 'observatoryPartner',
157
173
  title: 'Observatory partner',
174
+ // title: messages.observatoryPartner,
158
175
  facetField: 'cca_partner_contributors.keyword',
159
176
  sortOn: 'alpha',
160
177
  },
@@ -5,13 +5,37 @@ import {
5
5
  issued_date,
6
6
  geographic_countries,
7
7
  } from './../common';
8
+ import { defineMessages } from 'react-intl';
9
+
10
+ const messages = defineMessages({
11
+ adaptationApproaches: {
12
+ id: 'Adaptation Approaches',
13
+ defaultMessage: 'Adaptation Approaches',
14
+ },
15
+ healthImpacts: {
16
+ id: 'Health impacts',
17
+ defaultMessage: 'Health impacts',
18
+ },
19
+ observatoryPartner: {
20
+ id: 'Observatory partner',
21
+ defaultMessage: 'Observatory partner',
22
+ },
23
+ publishingYear: {
24
+ id: 'Publishing year',
25
+ defaultMessage: 'Publishing year',
26
+ },
27
+ sections: {
28
+ id: 'Sections',
29
+ defaultMessage: 'Sections',
30
+ },
31
+ });
8
32
 
9
33
  const op_cluster = {
10
34
  field: 'op_cluster',
11
35
  factory: 'MultiTermFacet',
12
36
  isFilterable: true,
13
37
  isMulti: true,
14
- label: 'Section',
38
+ label: messages.sections,
15
39
  show: 10000,
16
40
  showInFacetsList: false,
17
41
  ignoreNLPWhenActive: true,
@@ -21,7 +45,7 @@ const op_cluster = {
21
45
  const healthImpacts = {
22
46
  field: 'cca_health_impacts.keyword',
23
47
  factory: 'MultiTermFacet',
24
- label: 'Health impacts',
48
+ label: messages.healthImpacts,
25
49
  showInFacetsList: true,
26
50
  filterType: 'any',
27
51
  isFilterable: false,
@@ -46,7 +70,7 @@ const healthImpacts = {
46
70
  const partnerContributions = {
47
71
  field: 'cca_partner_contributors.keyword',
48
72
  factory: 'MultiTermFacet',
49
- label: 'Observatory partner',
73
+ label: messages.observatoryPartner,
50
74
  showInFacetsList: true,
51
75
  filterType: 'any',
52
76
  isFilterable: false,
@@ -60,7 +84,7 @@ const partnerContributions = {
60
84
  const year = {
61
85
  field: 'year',
62
86
  factory: 'HistogramFacet',
63
- label: 'Publishing year',
87
+ label: messages.publishingYear,
64
88
  height: 100,
65
89
  showInFacetsList: true,
66
90
  isFilterable: false,
@@ -8,6 +8,19 @@ import {
8
8
  cca_adaptation_sectors,
9
9
  } from '../common';
10
10
 
11
+ import { defineMessages } from 'react-intl';
12
+
13
+ const messages = defineMessages({
14
+ typeOfItem: {
15
+ id: 'Type of item',
16
+ defaultMessage: 'Type of item',
17
+ },
18
+ adaptationApproaches: {
19
+ id: 'Adaptation Approaches',
20
+ defaultMessage: 'Adaptation Approaches',
21
+ },
22
+ });
23
+
11
24
  const blacklist = ['IncludeArchived', 'issued.date', 'language'];
12
25
  let globalFacets = globalSearchBaseConfig.facets.filter(
13
26
  (f) => !blacklist.includes(f.field),
@@ -15,7 +28,8 @@ let globalFacets = globalSearchBaseConfig.facets.filter(
15
28
 
16
29
  for (let i = 0; i < globalFacets.length; i++) {
17
30
  if (globalFacets[i]['field'] === 'objectProvides') {
18
- globalFacets[i]['label'] = 'Type of item';
31
+ // globalFacets[i]['label'] = 'Type of item';
32
+ globalFacets[i]['label'] = messages.typeOfItem;
19
33
  }
20
34
  }
21
35
 
@@ -28,7 +42,8 @@ globalFacets = globalFacets.concat(
28
42
  field: 'cca_adaptation_elements.keyword',
29
43
  isFilterable: false,
30
44
  isMulti: true,
31
- label: 'Adaptation Approaches',
45
+ // label: 'Adaptation Approaches',
46
+ label: messages.adaptationApproaches,
32
47
  alwaysVisible: false,
33
48
  }),
34
49
  );
@@ -2,6 +2,18 @@ import { multiTermFacet } from '@eeacms/search';
2
2
  import globalSearchBaseConfig from '@eeacms/volto-globalsearch/config/global-search-base-config.js';
3
3
  // import spatialWhitelist from '@eeacms/volto-globalsearch/config/json/spatialWhitelist';
4
4
  import { cca_adaptation_sectors, language } from './../common';
5
+ import { defineMessages } from 'react-intl';
6
+
7
+ const messages = defineMessages({
8
+ rastStepssOfRelevance: {
9
+ id: 'RAST step(s) of relevance',
10
+ defaultMessage: 'RAST step(s) of relevance',
11
+ },
12
+ eligibleToReceiveFunding: {
13
+ id: 'Eligible to receive funding',
14
+ defaultMessage: 'Eligible to receive funding',
15
+ },
16
+ });
5
17
 
6
18
  const blacklist = ['IncludeArchived', 'issued.date', 'spatial', 'language'];
7
19
 
@@ -10,14 +22,14 @@ const facets = [
10
22
  field: 'cca_rast_steps.keyword',
11
23
  isFilterable: false,
12
24
  isMulti: true,
13
- label: 'RAST step(s) of relevance',
25
+ label: messages.rastStepssOfRelevance,
14
26
  alwaysVisible: false,
15
27
  }),
16
28
  multiTermFacet({
17
29
  field: 'cca_eligible_entities.keyword',
18
30
  isFilterable: false,
19
31
  isMulti: true,
20
- label: 'Eligible to receive funding',
32
+ label: messages.eligibleToReceiveFunding,
21
33
  alwaysVisible: false,
22
34
  }),
23
35
  cca_adaptation_sectors,
@@ -9,12 +9,25 @@ import {
9
9
  cca_adaptation_sectors,
10
10
  } from './../common';
11
11
 
12
+ import { defineMessages } from 'react-intl';
13
+
14
+ const messages = defineMessages({
15
+ fundingProgramme: {
16
+ id: 'Funding Programme',
17
+ defaultMessage: 'Funding Programme',
18
+ },
19
+ adaptationApproaches: {
20
+ id: 'Adaptation Approaches',
21
+ defaultMessage: 'Adaptation Approaches',
22
+ },
23
+ });
24
+
12
25
  const facets = [
13
26
  multiTermFacet({
14
27
  field: 'cca_funding_programme.keyword',
15
28
  isFilterable: false,
16
29
  isMulti: true,
17
- label: 'Funding Programme',
30
+ label: messages.fundingProgramme,
18
31
  iconsFamily: 'Funding Programme',
19
32
  alwaysVisible: false,
20
33
  }),
@@ -24,7 +37,7 @@ const facets = [
24
37
  field: 'cca_adaptation_elements.keyword',
25
38
  isFilterable: false,
26
39
  isMulti: true,
27
- label: 'Adaptation Approaches',
40
+ label: messages.adaptationApproaches,
28
41
  alwaysVisible: false,
29
42
  }),
30
43
  geographic_countries,
@@ -9,19 +9,41 @@ import {
9
9
  language,
10
10
  } from './../common';
11
11
 
12
+ import { defineMessages } from 'react-intl';
13
+
14
+ const messages = defineMessages({
15
+ rastStepsOfRelevance: {
16
+ id: 'RAST step(s) of relevance',
17
+ defaultMessage: 'RAST step(s) of relevance',
18
+ },
19
+ geographicalScale: {
20
+ id: 'Geographical scale',
21
+ defaultMessage: 'Geographical scale',
22
+ },
23
+ languagesOfTheTool: {
24
+ id: 'Language(s) of the tool',
25
+ defaultMessage: 'Language(s) of the tool',
26
+ },
27
+ mostUsefulFor: { id: 'Most useful for', defaultMessage: 'Most useful for' },
28
+ userRequirements: {
29
+ id: 'User requirements',
30
+ defaultMessage: 'User requirements',
31
+ },
32
+ });
33
+
12
34
  const facets = [
13
35
  multiTermFacet({
14
36
  field: 'cca_rast_steps.keyword',
15
37
  isFilterable: false,
16
38
  isMulti: true,
17
- label: 'RAST step(s) of relevance',
39
+ label: messages.rastStepsOfRelevance,
18
40
  alwaysVisible: false,
19
41
  }),
20
42
  multiTermFacet({
21
43
  field: 'cca_geographical_scale.keyword',
22
44
  isFilterable: false,
23
45
  isMulti: true,
24
- label: 'Geographical scale',
46
+ label: messages.geographicalScale,
25
47
  alwaysVisible: false,
26
48
  }),
27
49
  cca_climate_impacts,
@@ -29,7 +51,7 @@ const facets = [
29
51
  field: 'cca_tool_language.keyword',
30
52
  isFilterable: false,
31
53
  isMulti: true,
32
- label: 'Language(s) of the tool',
54
+ label: messages.languagesOfTheTool,
33
55
  alwaysVisible: false,
34
56
  }),
35
57
  cca_adaptation_sectors,
@@ -37,14 +59,14 @@ const facets = [
37
59
  field: 'cca_most_useful_for.keyword',
38
60
  isFilterable: false,
39
61
  isMulti: true,
40
- label: 'Most useful for',
62
+ label: messages.mostUsefulFor,
41
63
  alwaysVisible: false,
42
64
  }),
43
65
  multiTermFacet({
44
66
  field: 'cca_user_requirements.keyword',
45
67
  isFilterable: false,
46
68
  isMulti: true,
47
- label: 'User requirements',
69
+ label: messages.userRequirements,
48
70
  alwaysVisible: false,
49
71
  }),
50
72
  language,