@eeacms/volto-cca-policy 1.0.4 → 1.0.6

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 (60) hide show
  1. package/CHANGELOG.md +95 -1
  2. package/locales/bg/LC_MESSAGES/volto.po +42 -27
  3. package/locales/cs/LC_MESSAGES/volto.po +42 -27
  4. package/locales/da/LC_MESSAGES/volto.po +42 -27
  5. package/locales/de/LC_MESSAGES/volto.po +42 -27
  6. package/locales/el/LC_MESSAGES/volto.po +42 -27
  7. package/locales/en/LC_MESSAGES/volto.po +42 -27
  8. package/locales/es/LC_MESSAGES/volto.po +42 -27
  9. package/locales/et/LC_MESSAGES/volto.po +42 -27
  10. package/locales/fi/LC_MESSAGES/volto.po +42 -27
  11. package/locales/fr/LC_MESSAGES/volto.po +42 -27
  12. package/locales/ga/LC_MESSAGES/volto.po +42 -27
  13. package/locales/hr/LC_MESSAGES/volto.po +42 -27
  14. package/locales/hu/LC_MESSAGES/volto.po +42 -27
  15. package/locales/is/LC_MESSAGES/volto.po +42 -27
  16. package/locales/it/LC_MESSAGES/volto.po +42 -27
  17. package/locales/lt/LC_MESSAGES/volto.po +42 -27
  18. package/locales/lv/LC_MESSAGES/volto.po +42 -27
  19. package/locales/mt/LC_MESSAGES/volto.po +42 -27
  20. package/locales/nl/LC_MESSAGES/volto.po +42 -27
  21. package/locales/nn/LC_MESSAGES/volto.po +42 -27
  22. package/locales/pl/LC_MESSAGES/volto.po +42 -27
  23. package/locales/pt/LC_MESSAGES/volto.po +42 -27
  24. package/locales/ro/LC_MESSAGES/volto.po +42 -27
  25. package/locales/sk/LC_MESSAGES/volto.po +42 -27
  26. package/locales/sl/LC_MESSAGES/volto.po +42 -27
  27. package/locales/sv/LC_MESSAGES/volto.po +42 -27
  28. package/locales/tr/LC_MESSAGES/volto.po +42 -27
  29. package/locales/volto.pot +43 -28
  30. package/package.json +2 -2
  31. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.jsx +7 -13
  32. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.jsx +12 -8
  33. package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.test.jsx +25 -25
  34. package/src/components/Search/NavigatorCatalogue/utils.js +25 -23
  35. package/src/components/Search/NavigatorCatalogue/utils.test.js +5 -0
  36. package/src/components/manage/Blocks/CountryMapHeatIndex/Interactions.jsx +1 -1
  37. package/src/components/manage/Blocks/CountryMapHeatIndex/View.jsx +5 -6
  38. package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +6 -7
  39. package/src/components/manage/Blocks/CountryMapObservatory/Interactions.jsx +1 -1
  40. package/src/components/manage/Blocks/CountryMapProfile/Interactions.jsx +1 -1
  41. package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +3 -3
  42. package/src/components/manage/Blocks/FlourishEmbedBlock/FlourishEmbedBlockView.jsx +2 -1
  43. package/src/components/manage/Blocks/FlourishEmbedBlock/schema.js +7 -1
  44. package/src/components/theme/Views/ExtendedToolView.jsx +16 -15
  45. package/src/components/theme/Views/ExtendedToolView.test.jsx +20 -14
  46. package/src/helpers/Utils.jsx +20 -11
  47. package/src/helpers/index.js +2 -0
  48. package/src/hocs/index.js +1 -0
  49. package/src/index.js +2 -2
  50. package/theme/globals/navigator.less +13 -22
  51. package/src/components/manage/Blocks/CountryMapHeatIndex/euro-countries-simplified.js +0 -46197
  52. package/src/components/manage/Blocks/CountryMapHeatIndex/flags.js +0 -57
  53. package/src/components/manage/Blocks/CountryMapProfile/euro-countries-simplified.js +0 -46197
  54. package/src/components/manage/Blocks/CountryMapProfile/flags.js +0 -57
  55. package/src/helpers/country_map/flags.js +0 -57
  56. /package/src/components/{Result → Search/Result}/ClusterHorizontalCardItem.jsx +0 -0
  57. /package/src/components/{Result → Search/Result}/HealthHorizontalCardItem.jsx +0 -0
  58. /package/src/{helpers/country_map → data}/euro-countries-simplified.js +0 -0
  59. /package/src/helpers/{country_map/countryMap.js → countryMap.js} +0 -0
  60. /package/src/{helpers/country_map/hocs.jsx → hocs/withGeoJsonData.jsx} +0 -0
@@ -24,11 +24,11 @@ const ExtendedToolView = (props) => {
24
24
  acronym = '',
25
25
  long_description,
26
26
  tool_provider,
27
- public_private_mode,
27
+ // public_private_mode,
28
28
  hyperlink,
29
29
  description,
30
- coder_1,
31
- coder_2,
30
+ // coder_1,
31
+ // coder_2,
32
32
  only_interactive_support_tool,
33
33
  adaptation_cycle_step,
34
34
  updating_cycle_of_the_tool,
@@ -78,8 +78,8 @@ const ExtendedToolView = (props) => {
78
78
  const { isSelected, isLimitReached, toggle } = useCompareTools(compareTool);
79
79
 
80
80
  const messages = defineMessages({
81
- yes: { id: 'YES', defaultMessage: 'YES' },
82
- no: { id: 'NO', defaultMessage: 'NO' },
81
+ yes: { id: 'Yes', defaultMessage: 'Yes' },
82
+ no: { id: 'No', defaultMessage: 'No' },
83
83
  intended_user_groups: {
84
84
  id: 'Intended User Groups',
85
85
  defaultMessage: 'Intended User Groups',
@@ -125,8 +125,8 @@ const ExtendedToolView = (props) => {
125
125
  defaultMessage: 'Number of users / uptake',
126
126
  },
127
127
  tool_provider_mode: {
128
- id: 'Tool provider',
129
- defaultMessage: 'Tool provider',
128
+ id: 'Tool provider mode',
129
+ defaultMessage: 'Tool provider mode',
130
130
  },
131
131
  adaptation_support_cycle_step: {
132
132
  id: 'Adaptation Support Cycle Step',
@@ -165,10 +165,10 @@ const ExtendedToolView = (props) => {
165
165
  id: 'Strengths and possible limitations of the tool',
166
166
  defaultMessage: 'Strengths and possible limitations of the tool',
167
167
  },
168
- public_private_mode: {
169
- id: 'Public/private',
170
- defaultMessage: 'Public/private',
171
- },
168
+ // public_private_mode: {
169
+ // id: 'Public/private',
170
+ // defaultMessage: 'Public/private',
171
+ // },
172
172
  spatial_resolution: {
173
173
  id: 'Spatial resolution',
174
174
  defaultMessage: 'Spatial resolution',
@@ -266,13 +266,13 @@ const ExtendedToolView = (props) => {
266
266
  label={intl.formatMessage(messages.tool_provider)}
267
267
  value={tool_provider}
268
268
  />
269
- <TextField
269
+ {/* <TextField
270
270
  label={intl.formatMessage(messages.public_private_mode)}
271
271
  value={public_private_mode}
272
- />
272
+ /> */}
273
273
  <HTMLField value={description} />
274
- <TextField label="Coder1" value={coder_1} />
275
- <TextField label="Coder2" value={coder_2} />
274
+ {/* <TextField label="Coder1" value={coder_1} />
275
+ <TextField label="Coder2" value={coder_2} /> */}
276
276
  <BooleanField
277
277
  label={intl.formatMessage(
278
278
  messages.only_interactive_support_tool,
@@ -342,6 +342,7 @@ const ExtendedToolView = (props) => {
342
342
  values={tool_provider_mode}
343
343
  />
344
344
  <VocabularyField
345
+ asList
345
346
  label={intl.formatMessage(
346
347
  messages.adaptation_support_cycle_step,
347
348
  )}
@@ -35,11 +35,19 @@ jest.mock('@eeacms/volto-cca-policy/helpers', () => ({
35
35
  </div>
36
36
  ),
37
37
 
38
- VocabularyField: ({ label, values = [] }) =>
38
+ VocabularyField: ({ label, values = [], asList }) =>
39
39
  values.length > 0 ? (
40
40
  <div>
41
41
  <span>{label}</span>
42
- <span>{values.join(', ')}</span>
42
+ {asList ? (
43
+ <ul>
44
+ {values.map((value, index) => (
45
+ <li key={`${value}-${index}`}>{value}</li>
46
+ ))}
47
+ </ul>
48
+ ) : (
49
+ <span>{values.join(', ')}</span>
50
+ )}
43
51
  </div>
44
52
  ) : null,
45
53
 
@@ -315,34 +323,32 @@ describe('ExtendedToolView', () => {
315
323
  expect(formatFunctionalityScore).not.toHaveBeenCalled();
316
324
  });
317
325
 
318
- it('renders text fields', () => {
326
+ it('renders the supported text fields', () => {
319
327
  renderComponent({
320
328
  title: 'Climate Tool',
321
329
  tool_provider: 'Example Provider',
322
- public_private_mode: 'Public',
323
330
  spatial_resolution: 'Regional',
324
331
  underlying_data_maintenance: 'Updated yearly',
325
332
  strengths_and_possible_limitations: 'Easy to use',
326
333
  });
327
334
 
328
335
  expect(screen.getByText('Example Provider')).toBeInTheDocument();
329
- expect(screen.getByText('Public')).toBeInTheDocument();
330
336
  expect(screen.getByText('Regional')).toBeInTheDocument();
331
337
  expect(screen.getByText('Updated yearly')).toBeInTheDocument();
332
338
  expect(screen.getByText('Easy to use')).toBeInTheDocument();
333
339
  });
334
340
 
335
- it('renders coder fields', () => {
341
+ it('does not render removed coder fields', () => {
336
342
  renderComponent({
337
343
  title: 'Climate Tool',
338
344
  coder_1: 'Coder One',
339
345
  coder_2: 'Coder Two',
340
346
  });
341
347
 
342
- expect(screen.getByText('Coder1')).toBeInTheDocument();
343
- expect(screen.getByText('Coder One')).toBeInTheDocument();
344
- expect(screen.getByText('Coder2')).toBeInTheDocument();
345
- expect(screen.getByText('Coder Two')).toBeInTheDocument();
348
+ expect(screen.queryByText('Coder1')).not.toBeInTheDocument();
349
+ expect(screen.queryByText('Coder One')).not.toBeInTheDocument();
350
+ expect(screen.queryByText('Coder2')).not.toBeInTheDocument();
351
+ expect(screen.queryByText('Coder Two')).not.toBeInTheDocument();
346
352
  });
347
353
 
348
354
  it('renders HTML descriptions', () => {
@@ -356,7 +362,7 @@ describe('ExtendedToolView', () => {
356
362
  expect(screen.getByText('Short tool description')).toBeInTheDocument();
357
363
  });
358
364
 
359
- it('renders boolean fields with YES values', () => {
365
+ it('renders boolean fields with Yes values', () => {
360
366
  renderComponent({
361
367
  title: 'Climate Tool',
362
368
  only_interactive_support_tool: true,
@@ -366,10 +372,10 @@ describe('ExtendedToolView', () => {
366
372
  free_access: true,
367
373
  });
368
374
 
369
- expect(screen.getAllByText('YES')).toHaveLength(5);
375
+ expect(screen.getAllByText('Yes')).toHaveLength(5);
370
376
  });
371
377
 
372
- it('renders boolean fields with NO values', () => {
378
+ it('renders boolean fields with No values', () => {
373
379
  renderComponent({
374
380
  title: 'Climate Tool',
375
381
  only_interactive_support_tool: false,
@@ -379,7 +385,7 @@ describe('ExtendedToolView', () => {
379
385
  free_access: false,
380
386
  });
381
387
 
382
- expect(screen.getAllByText('NO')).toHaveLength(5);
388
+ expect(screen.getAllByText('No')).toHaveLength(5);
383
389
  });
384
390
 
385
391
  it('renders vocabulary fields', () => {
@@ -77,18 +77,27 @@ export const BooleanField = ({ label, value, yesLabel, noLabel }) => (
77
77
  <TextField label={label} value={value ? yesLabel : noLabel} />
78
78
  );
79
79
 
80
- export const VocabularyField = ({ label, values }) => {
81
- if (!values?.length) return null;
80
+ export const VocabularyField = ({ label, values, asList }) => {
81
+ const items = values
82
+ ?.map((value) => value?.title || value?.token || value)
83
+ .filter(Boolean);
82
84
 
83
- return (
84
- <TextField
85
- label={label}
86
- value={values
87
- .map((value) => value?.title || value?.token || value)
88
- .filter(Boolean)
89
- .join(', ')}
90
- />
91
- );
85
+ if (!items?.length) return null;
86
+
87
+ if (asList) {
88
+ return (
89
+ <>
90
+ <h5>{label}</h5>
91
+ <ul>
92
+ {items.map((item, index) => (
93
+ <li key={`${item}-${index}`}>{item}</li>
94
+ ))}
95
+ </ul>
96
+ </>
97
+ );
98
+ }
99
+
100
+ return <TextField label={label} value={items.join(', ')} />;
92
101
  };
93
102
 
94
103
  export const ExternalLink = (props) => {
@@ -98,3 +98,5 @@ export const fixEmbedURL = (url, is_cmshare_video) => {
98
98
 
99
99
  return base + suffix;
100
100
  };
101
+
102
+ export * from './countryMap';
package/src/hocs/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as withResponsiveContainer } from './withResponsiveContainer';
2
2
  export { default as withVisibilitySensor } from './withVisibilitySensor';
3
+ export { withGeoJsonData } from './withGeoJsonData';
package/src/index.js CHANGED
@@ -48,8 +48,8 @@ import {
48
48
 
49
49
  import GeocharsWidget from './components/theme/Widgets/GeocharsWidget';
50
50
  import PromotionalImageWidget from './components/theme/Widgets/PromotionalImageWidget';
51
- import HealthHorizontalCardItem from './components/Result/HealthHorizontalCardItem';
52
- import ClusterHorizontalCardItem from './components/Result/ClusterHorizontalCardItem';
51
+ import HealthHorizontalCardItem from './components/Search/Result/HealthHorizontalCardItem';
52
+ import ClusterHorizontalCardItem from './components/Search/Result/ClusterHorizontalCardItem';
53
53
  import NavigatorCatalogueCardItem from './components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem';
54
54
  import NavigatorCatalogueMapView from './components/Search/NavigatorCatalogue/NavigatorCatalogueMapView';
55
55
  import NavigatorCatalogueContentView from './components/Search/NavigatorCatalogue/NavigatorCatalogueContentView';
@@ -49,7 +49,7 @@
49
49
  box-sizing: border-box;
50
50
  border: 1px solid @navigatorIconBorderColor;
51
51
  border-radius: 4px;
52
- background-color: #fff;
52
+ background-color: #f7f8fa;
53
53
  color: @navigatorIconColor;
54
54
 
55
55
  i.icon {
@@ -110,6 +110,10 @@
110
110
  margin: 0 !important;
111
111
  }
112
112
 
113
+ .navigator-tool-icon {
114
+ background-color: #fff;
115
+ }
116
+
113
117
  .compare-panel-content {
114
118
  padding: 1rem;
115
119
  }
@@ -210,15 +214,12 @@
210
214
  }
211
215
  }
212
216
 
213
- .ui.button.compare-panel-submit {
214
- margin: 0;
215
- }
216
-
217
- .compare-panel-clear-all {
217
+ .ui.button.compare-panel-clear-all {
218
218
  padding: 0;
219
219
  margin: 0;
220
- background: transparent;
221
- color: @linkColor;
220
+ border: none;
221
+ background: none !important;
222
+ color: @primaryColor;
222
223
 
223
224
  &:hover,
224
225
  &:focus {
@@ -469,19 +470,11 @@
469
470
  }
470
471
 
471
472
  .navigator-catalogue-map-loading {
473
+ text-align: center;
472
474
  display: flex;
473
- min-height: 400px;
474
- align-items: center;
475
- justify-content: center;
476
- color: #7c8a96;
477
- font-size: 1rem;
478
- gap: 1rem;
479
-
480
- i.icon.loading {
481
- font-size: 1.5rem;
482
- }
475
+ flex-direction: column;
476
+ gap: 1em;
483
477
  }
484
-
485
478
  .navigator-catalogue-map-tooltip {
486
479
  position: absolute;
487
480
  z-index: 1000;
@@ -700,7 +693,7 @@ body.searchlib-page .searchapp-navigatorCatalogueSearch {
700
693
  }
701
694
 
702
695
  .license-type {
703
- gap: 0.5em;
696
+ gap: 0.7em;
704
697
  }
705
698
 
706
699
  .navigator-catalogue-cycle-elements {
@@ -775,7 +768,6 @@ body.searchlib-page .searchapp-navigatorCatalogueSearch {
775
768
  min-height: 24px;
776
769
  align-items: center;
777
770
  padding: 0 0.45rem;
778
- border-radius: 2px;
779
771
  font-weight: 500;
780
772
  font-size: 12px;
781
773
 
@@ -1025,7 +1017,6 @@ body.searchlib-page .searchapp-navigatorCatalogueSearch {
1025
1017
  &.selected {
1026
1018
  border-color: @primaryColor;
1027
1019
  background: fade(@primaryColor, 5%);
1028
- font-weight: 500;
1029
1020
  }
1030
1021
 
1031
1022
  > span {