@eeacms/volto-cca-policy 1.0.24 → 1.0.26

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 +33 -13
  2. package/locales/bg/LC_MESSAGES/volto.po +0 -10
  3. package/locales/cs/LC_MESSAGES/volto.po +0 -10
  4. package/locales/da/LC_MESSAGES/volto.po +0 -10
  5. package/locales/de/LC_MESSAGES/volto.po +0 -10
  6. package/locales/el/LC_MESSAGES/volto.po +0 -10
  7. package/locales/en/LC_MESSAGES/volto.po +0 -10
  8. package/locales/es/LC_MESSAGES/volto.po +0 -10
  9. package/locales/et/LC_MESSAGES/volto.po +0 -10
  10. package/locales/fi/LC_MESSAGES/volto.po +0 -10
  11. package/locales/fr/LC_MESSAGES/volto.po +0 -10
  12. package/locales/ga/LC_MESSAGES/volto.po +0 -10
  13. package/locales/hr/LC_MESSAGES/volto.po +0 -10
  14. package/locales/hu/LC_MESSAGES/volto.po +0 -10
  15. package/locales/is/LC_MESSAGES/volto.po +0 -10
  16. package/locales/it/LC_MESSAGES/volto.po +0 -10
  17. package/locales/lt/LC_MESSAGES/volto.po +0 -10
  18. package/locales/lv/LC_MESSAGES/volto.po +0 -10
  19. package/locales/mt/LC_MESSAGES/volto.po +0 -10
  20. package/locales/nl/LC_MESSAGES/volto.po +0 -10
  21. package/locales/nn/LC_MESSAGES/volto.po +0 -10
  22. package/locales/pl/LC_MESSAGES/volto.po +0 -10
  23. package/locales/pt/LC_MESSAGES/volto.po +0 -10
  24. package/locales/ro/LC_MESSAGES/volto.po +0 -10
  25. package/locales/sk/LC_MESSAGES/volto.po +0 -10
  26. package/locales/sl/LC_MESSAGES/volto.po +0 -10
  27. package/locales/sv/LC_MESSAGES/volto.po +0 -10
  28. package/locales/tr/LC_MESSAGES/volto.po +0 -10
  29. package/locales/volto.pot +1 -11
  30. package/package.json +1 -1
  31. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.jsx +38 -39
  32. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.test.jsx +28 -2
  33. package/src/components/Search/NavigatorCatalogue/utils.js +1 -1
  34. package/src/components/Search/NavigatorGuide/NavigatorGuideContentView.jsx +153 -135
  35. package/src/components/Search/NavigatorGuide/NavigatorGuideContentView.test.jsx +108 -2
  36. package/src/components/Search/NavigatorGuide/utils.js +15 -0
  37. package/src/components/Search/NavigatorGuide/utils.test.js +18 -1
  38. package/src/components/index.js +2 -0
  39. package/src/components/manage/Blocks/ChatbotCatalogue/astUtils.js +129 -3
  40. package/src/components/manage/Blocks/ChatbotCatalogue/astUtils.test.js +207 -0
  41. package/src/components/manage/Blocks/ChatbotCatalogue/docCards.js +8 -0
  42. package/src/components/manage/Blocks/ChatbotCatalogue/docCards.test.js +72 -0
  43. package/src/components/manage/Blocks/ChatbotCatalogue/nextSteps.js +4 -0
  44. package/src/components/manage/Blocks/ChatbotCatalogue/nextSteps.test.js +48 -0
  45. package/src/components/theme/CompareTools/CompareToolsPanel.jsx +1 -1
  46. package/src/components/theme/CompareTools/CompareToolsView.jsx +1 -1
  47. package/src/components/theme/Content/Sections/MetadataItemList.jsx +7 -24
  48. package/src/components/theme/TagOverflowPopup.jsx +28 -0
  49. package/src/components/theme/Views/RelatedTools.jsx +7 -25
  50. package/src/search/navigator_guide/facets.js +1 -0
  51. package/src/search/navigator_guide/guideSteps.js +1 -1
  52. package/theme/globals/navigator.less +19 -1
@@ -845,11 +845,6 @@ msgstr "Află mai multe"
845
845
  msgid "Legal aspects"
846
846
  msgstr "Aspecte juridice"
847
847
 
848
- #. Default: "License"
849
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
850
- msgid "License"
851
- msgstr ""
852
-
853
848
  #. Default: "Lifetime"
854
849
  #: components/theme/Views/AdaptationOptionView
855
850
  #: components/theme/Views/CaseStudyView
@@ -1493,11 +1488,6 @@ msgstr "Subiecte:"
1493
1488
  msgid "Transnational regions"
1494
1489
  msgstr "Regiunile transnaționale"
1495
1490
 
1496
- #. Default: "Type"
1497
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1498
- msgid "Type"
1499
- msgstr ""
1500
-
1501
1491
  #. Default: "Type of item"
1502
1492
  #: search/common
1503
1493
  #: search/mission_all/facets-all
@@ -845,11 +845,6 @@ msgstr "Zistite viac"
845
845
  msgid "Legal aspects"
846
846
  msgstr "Právne aspekty"
847
847
 
848
- #. Default: "License"
849
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
850
- msgid "License"
851
- msgstr ""
852
-
853
848
  #. Default: "Lifetime"
854
849
  #: components/theme/Views/AdaptationOptionView
855
850
  #: components/theme/Views/CaseStudyView
@@ -1493,11 +1488,6 @@ msgstr "témy:"
1493
1488
  msgid "Transnational regions"
1494
1489
  msgstr "Nadnárodné regióny"
1495
1490
 
1496
- #. Default: "Type"
1497
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1498
- msgid "Type"
1499
- msgstr ""
1500
-
1501
1491
  #. Default: "Type of item"
1502
1492
  #: search/common
1503
1493
  #: search/mission_all/facets-all
@@ -845,11 +845,6 @@ msgstr "Več o tem"
845
845
  msgid "Legal aspects"
846
846
  msgstr "Pravni vidiki"
847
847
 
848
- #. Default: "License"
849
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
850
- msgid "License"
851
- msgstr ""
852
-
853
848
  #. Default: "Lifetime"
854
849
  #: components/theme/Views/AdaptationOptionView
855
850
  #: components/theme/Views/CaseStudyView
@@ -1493,11 +1488,6 @@ msgstr "Teme:"
1493
1488
  msgid "Transnational regions"
1494
1489
  msgstr "Transnacionalne regije"
1495
1490
 
1496
- #. Default: "Type"
1497
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1498
- msgid "Type"
1499
- msgstr ""
1500
-
1501
1491
  #. Default: "Type of item"
1502
1492
  #: search/common
1503
1493
  #: search/mission_all/facets-all
@@ -845,11 +845,6 @@ msgstr "Läs mer"
845
845
  msgid "Legal aspects"
846
846
  msgstr "Juridiska aspekter"
847
847
 
848
- #. Default: "License"
849
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
850
- msgid "License"
851
- msgstr ""
852
-
853
848
  #. Default: "Lifetime"
854
849
  #: components/theme/Views/AdaptationOptionView
855
850
  #: components/theme/Views/CaseStudyView
@@ -1493,11 +1488,6 @@ msgstr "Ämnen:"
1493
1488
  msgid "Transnational regions"
1494
1489
  msgstr "Transnationella regioner"
1495
1490
 
1496
- #. Default: "Type"
1497
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1498
- msgid "Type"
1499
- msgstr ""
1500
-
1501
1491
  #. Default: "Type of item"
1502
1492
  #: search/common
1503
1493
  #: search/mission_all/facets-all
@@ -845,11 +845,6 @@ msgstr "Daha fazla bilgi edin"
845
845
  msgid "Legal aspects"
846
846
  msgstr "Yasal yönler"
847
847
 
848
- #. Default: "License"
849
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
850
- msgid "License"
851
- msgstr ""
852
-
853
848
  #. Default: "Lifetime"
854
849
  #: components/theme/Views/AdaptationOptionView
855
850
  #: components/theme/Views/CaseStudyView
@@ -1493,11 +1488,6 @@ msgstr "Konular:"
1493
1488
  msgid "Transnational regions"
1494
1489
  msgstr "Ulusötesi bölgeler"
1495
1490
 
1496
- #. Default: "Type"
1497
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1498
- msgid "Type"
1499
- msgstr ""
1500
-
1501
1491
  #. Default: "Type of item"
1502
1492
  #: search/common
1503
1493
  #: search/mission_all/facets-all
package/locales/volto.pot CHANGED
@@ -1,7 +1,7 @@
1
1
  msgid ""
2
2
  msgstr ""
3
3
  "Project-Id-Version: Plone\n"
4
- "POT-Creation-Date: 2026-09-16T07:51:35.558Z\n"
4
+ "POT-Creation-Date: 2026-09-17T11:25:27.854Z\n"
5
5
  "Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
6
6
  "Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
7
7
  "Content-Type: text/plain; charset=utf-8\n"
@@ -847,11 +847,6 @@ msgstr ""
847
847
  msgid "Legal aspects"
848
848
  msgstr ""
849
849
 
850
- #. Default: "License"
851
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
852
- msgid "License"
853
- msgstr ""
854
-
855
850
  #. Default: "Lifetime"
856
851
  #: components/theme/Views/AdaptationOptionView
857
852
  #: components/theme/Views/CaseStudyView
@@ -1495,11 +1490,6 @@ msgstr ""
1495
1490
  msgid "Transnational regions"
1496
1491
  msgstr ""
1497
1492
 
1498
- #. Default: "Type"
1499
- #: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
1500
- msgid "Type"
1501
- msgstr ""
1502
-
1503
1493
  #. Default: "Type of item"
1504
1494
  #: search/common
1505
1495
  #: search/mission_all/facets-all
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-cca-policy",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
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",
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { Checkbox, Icon, Popup } from 'semantic-ui-react';
2
+ import { Checkbox, Icon } from 'semantic-ui-react';
3
3
  import { defineMessages, useIntl } from 'react-intl';
4
4
  import ExternalLink from '@eeacms/search/components/Result/ExternalLink';
5
5
  import ResultContext from '@eeacms/search/components/Result/ResultContext';
6
- import ToolThumbnail from '../../theme/ToolThumbnail/ToolThumbnail';
6
+ import TagOverflowPopup from '@eeacms/volto-cca-policy/components/theme/TagOverflowPopup';
7
+ import ToolThumbnail from '@eeacms/volto-cca-policy/components/theme/ToolThumbnail/ToolThumbnail';
7
8
  import { getToolThumbnailUrl } from '../../theme/ToolThumbnail/utils';
8
9
  import {
9
10
  getCompareToolTitle,
@@ -25,14 +26,6 @@ const messages = defineMessages({
25
26
  id: 'Cycle',
26
27
  defaultMessage: 'Cycle',
27
28
  },
28
- license: {
29
- id: 'License',
30
- defaultMessage: 'License',
31
- },
32
- type: {
33
- id: 'Type',
34
- defaultMessage: 'Type',
35
- },
36
29
  typeOfOutput: {
37
30
  id: 'Type of outputs',
38
31
  defaultMessage: 'Type of outputs',
@@ -71,9 +64,11 @@ const formatPublicationDate = (value) => {
71
64
  }
72
65
  };
73
66
 
74
- const TagGroup = ({ typeLabel, values, type }) => {
75
- const visible = values.slice(0, 3);
76
- const hidden = values.slice(3);
67
+ const TagGroup = ({ typeLabel, values, type, maxItems }) => {
68
+ const visible = Number.isFinite(maxItems)
69
+ ? values.slice(0, maxItems)
70
+ : values;
71
+ const hidden = Number.isFinite(maxItems) ? values.slice(maxItems) : [];
77
72
  const remaining = values.length - visible.length;
78
73
 
79
74
  return (
@@ -84,27 +79,10 @@ const TagGroup = ({ typeLabel, values, type }) => {
84
79
  </span>
85
80
  ))}
86
81
  {remaining > 0 && (
87
- <Popup
88
- className="catalogue-tag-popup"
89
- content={
90
- <div className="catalogue-tag-tooltip">
91
- <ul>
92
- {hidden.map((value) => (
93
- <li key={`${type}-hidden-${value}`}>{value}</li>
94
- ))}
95
- </ul>
96
- </div>
97
- }
98
- position="bottom left"
99
- trigger={
100
- <button
101
- type="button"
102
- className={`navigator-tag ${type} more`}
103
- aria-label={`${typeLabel}: ${hidden.join(', ')}`}
104
- >
105
- + {remaining}
106
- </button>
107
- }
82
+ <TagOverflowPopup
83
+ items={hidden}
84
+ className={`navigator-tag ${type} more`}
85
+ ariaLabel={`${typeLabel}: ${hidden.join(', ')}`}
108
86
  />
109
87
  )}
110
88
  </div>
@@ -113,6 +91,7 @@ const TagGroup = ({ typeLabel, values, type }) => {
113
91
 
114
92
  const CycleElements = ({ intl, values }) => {
115
93
  const visible = values.slice(0, 3);
94
+ const hidden = values.slice(3);
116
95
 
117
96
  if (!visible.length) return null;
118
97
 
@@ -129,6 +108,13 @@ const CycleElements = ({ intl, values }) => {
129
108
  {value}
130
109
  </span>
131
110
  ))}
111
+ {hidden.length > 0 && (
112
+ <TagOverflowPopup
113
+ items={hidden}
114
+ className="navigator-tag cycle-element more"
115
+ ariaLabel={`${intl.formatMessage(messages.cycle)}: ${hidden.join(', ')}`}
116
+ />
117
+ )}
132
118
  </div>
133
119
  );
134
120
  };
@@ -138,6 +124,7 @@ const NavigatorCatalogueCardItem = (props) => {
138
124
  const intl = useIntl();
139
125
  const sectors = rawValueAsArray(result.cca_adaptation_sectors);
140
126
  const hazards = rawValueAsArray(result.cca_climate_impacts);
127
+ const keywords = rawValueAsArray(result.cca_keywords);
141
128
  const outputs = rawValueAsArray(result.cca_type_of_outputs);
142
129
 
143
130
  const outputType = outputs
@@ -146,7 +133,7 @@ const NavigatorCatalogueCardItem = (props) => {
146
133
  .join(', ');
147
134
  const toolProvider = result?._result?.tool_provider?.raw;
148
135
  const adaptationSupportCycleSteps = rawValueAsArray(
149
- result.adaptation_support_cycle_step,
136
+ result.cca_adaptation_support_cycle_step,
150
137
  )
151
138
  .map((value) => {
152
139
  const title = value?.title || value;
@@ -156,8 +143,6 @@ const NavigatorCatalogueCardItem = (props) => {
156
143
  const publicationDate =
157
144
  result.publication_date?.raw || result.publication_date;
158
145
  const formattedPublicationDate = formatPublicationDate(publicationDate);
159
- const sectorLabel = intl.formatMessage(messages.sector);
160
- const hazardLabel = intl.formatMessage(messages.hazard);
161
146
  const compareTool = {
162
147
  uid: getCompareToolUid(result),
163
148
  title: getCompareToolTitle(result),
@@ -197,8 +182,22 @@ const NavigatorCatalogueCardItem = (props) => {
197
182
  </p>
198
183
 
199
184
  <div className="catalogue-taxonomy">
200
- <TagGroup typeLabel={sectorLabel} values={sectors} type="sector" />
201
- <TagGroup typeLabel={hazardLabel} values={hazards} type="hazard" />
185
+ <TagGroup
186
+ typeLabel={intl.formatMessage(messages.sector)}
187
+ values={sectors}
188
+ type="sector"
189
+ maxItems={3}
190
+ />
191
+ <TagGroup
192
+ typeLabel={intl.formatMessage(messages.hazard)}
193
+ values={hazards}
194
+ type="hazard"
195
+ maxItems={3}
196
+ />
197
+ </div>
198
+
199
+ <div className="catalogue-keywords">
200
+ <TagGroup values={keywords} type="keyword" />
202
201
  </div>
203
202
 
204
203
  <div className="catalogue-item-footer">
@@ -84,6 +84,9 @@ describe('NavigatorCatalogueCardItem', () => {
84
84
  cca_climate_impacts: {
85
85
  raw: ['Drought', 'Flooding', 'Heat', 'Wildfires'],
86
86
  },
87
+ cca_keywords: {
88
+ raw: ['Planning', 'Risk assessment', 'Resilience', 'Adaptation'],
89
+ },
87
90
  cca_type_of_outputs: {
88
91
  raw: [
89
92
  'Maps and graphs',
@@ -91,7 +94,7 @@ describe('NavigatorCatalogueCardItem', () => {
91
94
  'Datasets and indicators',
92
95
  ],
93
96
  },
94
- adaptation_support_cycle_step: {
97
+ cca_adaptation_support_cycle_step: {
95
98
  raw: [
96
99
  { title: 'Step 1: Preparing the ground' },
97
100
  { title: 'Step 2: Assessing risks' },
@@ -123,8 +126,15 @@ describe('NavigatorCatalogueCardItem', () => {
123
126
  expect(
124
127
  screen.getByRole('button', { name: 'Hazard: Wildfires' }),
125
128
  ).toBeInTheDocument();
129
+ expect(screen.getByText('Planning')).toBeInTheDocument();
130
+ expect(screen.getByText('Risk assessment')).toBeInTheDocument();
131
+ expect(screen.getByText('Resilience')).toBeInTheDocument();
132
+ expect(screen.getByText('Adaptation')).toBeInTheDocument();
126
133
  expect(screen.getByText('Step 1')).toBeInTheDocument();
127
- expect(screen.queryByText('Step 4')).not.toBeInTheDocument();
134
+ expect(
135
+ screen.getByRole('button', { name: 'Cycle: Step 4' }),
136
+ ).toHaveTextContent('+ 1');
137
+ expect(screen.getByText('Step 4')).toBeInTheDocument();
128
138
  expect(
129
139
  screen.getByTitle(
130
140
  'Maps and graphs, Reports and decision support, Datasets and indicators',
@@ -145,6 +155,22 @@ describe('NavigatorCatalogueCardItem', () => {
145
155
  });
146
156
  });
147
157
 
158
+ it('shows the cycle steps from the field used by the catalogue filter', () => {
159
+ renderCard({
160
+ title: 'Climate planning tool',
161
+ href: 'https://example.com/tool',
162
+ cca_adaptation_support_cycle_step: {
163
+ raw: ['Step 2: Assessing risks'],
164
+ },
165
+ adaptation_support_cycle_step: {
166
+ raw: [{ title: 'Step 1: Preparing the ground' }],
167
+ },
168
+ });
169
+
170
+ expect(screen.getByText('Step 2')).toBeInTheDocument();
171
+ expect(screen.queryByText('Step 1')).not.toBeInTheDocument();
172
+ });
173
+
148
174
  it('renders sparse results and disables comparison without a UID', () => {
149
175
  useCompareTools.mockReturnValue({
150
176
  isSelected: true,
@@ -78,7 +78,7 @@ export const formatFunctionalityScore = (value) => {
78
78
 
79
79
  export const escapeCsvValue = (value) => {
80
80
  const stringValue = value === undefined || value === null ? '' : `${value}`;
81
- return `"${stringValue.replace(/"/g, '""')}"`;
81
+ return `"${stringValue.replaceAll('"', '""')}"`;
82
82
  };
83
83
 
84
84
  export const downloadCsv = (filename, rows) => {