@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.
- package/CHANGELOG.md +95 -1
- package/locales/bg/LC_MESSAGES/volto.po +42 -27
- package/locales/cs/LC_MESSAGES/volto.po +42 -27
- package/locales/da/LC_MESSAGES/volto.po +42 -27
- package/locales/de/LC_MESSAGES/volto.po +42 -27
- package/locales/el/LC_MESSAGES/volto.po +42 -27
- package/locales/en/LC_MESSAGES/volto.po +42 -27
- package/locales/es/LC_MESSAGES/volto.po +42 -27
- package/locales/et/LC_MESSAGES/volto.po +42 -27
- package/locales/fi/LC_MESSAGES/volto.po +42 -27
- package/locales/fr/LC_MESSAGES/volto.po +42 -27
- package/locales/ga/LC_MESSAGES/volto.po +42 -27
- package/locales/hr/LC_MESSAGES/volto.po +42 -27
- package/locales/hu/LC_MESSAGES/volto.po +42 -27
- package/locales/is/LC_MESSAGES/volto.po +42 -27
- package/locales/it/LC_MESSAGES/volto.po +42 -27
- package/locales/lt/LC_MESSAGES/volto.po +42 -27
- package/locales/lv/LC_MESSAGES/volto.po +42 -27
- package/locales/mt/LC_MESSAGES/volto.po +42 -27
- package/locales/nl/LC_MESSAGES/volto.po +42 -27
- package/locales/nn/LC_MESSAGES/volto.po +42 -27
- package/locales/pl/LC_MESSAGES/volto.po +42 -27
- package/locales/pt/LC_MESSAGES/volto.po +42 -27
- package/locales/ro/LC_MESSAGES/volto.po +42 -27
- package/locales/sk/LC_MESSAGES/volto.po +42 -27
- package/locales/sl/LC_MESSAGES/volto.po +42 -27
- package/locales/sv/LC_MESSAGES/volto.po +42 -27
- package/locales/tr/LC_MESSAGES/volto.po +42 -27
- package/locales/volto.pot +43 -28
- package/package.json +2 -2
- package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem.jsx +7 -13
- package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.jsx +12 -8
- package/src/components/Search/NavigatorCatalogue/NavigatorCatalogueMapView.test.jsx +25 -25
- package/src/components/Search/NavigatorCatalogue/utils.js +25 -23
- package/src/components/Search/NavigatorCatalogue/utils.test.js +5 -0
- package/src/components/manage/Blocks/CountryMapHeatIndex/Interactions.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapHeatIndex/View.jsx +5 -6
- package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +6 -7
- package/src/components/manage/Blocks/CountryMapObservatory/Interactions.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/Interactions.jsx +1 -1
- package/src/components/manage/Blocks/CountryMapProfile/OLView.jsx +3 -3
- package/src/components/manage/Blocks/FlourishEmbedBlock/FlourishEmbedBlockView.jsx +2 -1
- package/src/components/manage/Blocks/FlourishEmbedBlock/schema.js +7 -1
- package/src/components/theme/Views/ExtendedToolView.jsx +16 -15
- package/src/components/theme/Views/ExtendedToolView.test.jsx +20 -14
- package/src/helpers/Utils.jsx +20 -11
- package/src/helpers/index.js +2 -0
- package/src/hocs/index.js +1 -0
- package/src/index.js +2 -2
- package/theme/globals/navigator.less +13 -22
- package/src/components/manage/Blocks/CountryMapHeatIndex/euro-countries-simplified.js +0 -46197
- package/src/components/manage/Blocks/CountryMapHeatIndex/flags.js +0 -57
- package/src/components/manage/Blocks/CountryMapProfile/euro-countries-simplified.js +0 -46197
- package/src/components/manage/Blocks/CountryMapProfile/flags.js +0 -57
- package/src/helpers/country_map/flags.js +0 -57
- /package/src/components/{Result → Search/Result}/ClusterHorizontalCardItem.jsx +0 -0
- /package/src/components/{Result → Search/Result}/HealthHorizontalCardItem.jsx +0 -0
- /package/src/{helpers/country_map → data}/euro-countries-simplified.js +0 -0
- /package/src/helpers/{country_map/countryMap.js → countryMap.js} +0 -0
- /package/src/{helpers/country_map/hocs.jsx → hocs/withGeoJsonData.jsx} +0 -0
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-
|
|
4
|
+
"POT-Creation-Date: 2026-08-04T16:14:30.812Z\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"
|
|
@@ -290,6 +290,11 @@ msgstr ""
|
|
|
290
290
|
msgid "Climate-ADAPT page for this event"
|
|
291
291
|
msgstr ""
|
|
292
292
|
|
|
293
|
+
#. Default: "Close"
|
|
294
|
+
#: components/Search/NavigatorCatalogue/NavigatorCatalogueMapView
|
|
295
|
+
msgid "Close"
|
|
296
|
+
msgstr ""
|
|
297
|
+
|
|
293
298
|
#. Default: "Compare"
|
|
294
299
|
#: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
|
|
295
300
|
msgid "Compare"
|
|
@@ -894,11 +899,6 @@ msgstr ""
|
|
|
894
899
|
msgid "Most useful for"
|
|
895
900
|
msgstr ""
|
|
896
901
|
|
|
897
|
-
#. Default: "NO"
|
|
898
|
-
#: components/theme/Views/ExtendedToolView
|
|
899
|
-
msgid "NO"
|
|
900
|
-
msgstr ""
|
|
901
|
-
|
|
902
902
|
#. Default: "National HHAP"
|
|
903
903
|
#: components/manage/Blocks/CountryMapHeatIndex/Filter
|
|
904
904
|
msgid "National HHAP"
|
|
@@ -936,7 +936,7 @@ msgid "Navigator Guide preview empty state"
|
|
|
936
936
|
msgstr ""
|
|
937
937
|
|
|
938
938
|
#. Default: "New"
|
|
939
|
-
#: components/Result/ClusterHorizontalCardItem
|
|
939
|
+
#: components/Search/Result/ClusterHorizontalCardItem
|
|
940
940
|
msgid "New"
|
|
941
941
|
msgstr ""
|
|
942
942
|
|
|
@@ -955,6 +955,11 @@ msgstr ""
|
|
|
955
955
|
msgid "Next step"
|
|
956
956
|
msgstr ""
|
|
957
957
|
|
|
958
|
+
#. Default: "No"
|
|
959
|
+
#: components/theme/Views/ExtendedToolView
|
|
960
|
+
msgid "No"
|
|
961
|
+
msgstr ""
|
|
962
|
+
|
|
958
963
|
#. Default: "No HHAP"
|
|
959
964
|
#: components/manage/Blocks/CountryMapHeatIndex/Filter
|
|
960
965
|
msgid "No HHAP"
|
|
@@ -1101,11 +1106,6 @@ msgstr ""
|
|
|
1101
1106
|
msgid "Project information"
|
|
1102
1107
|
msgstr ""
|
|
1103
1108
|
|
|
1104
|
-
#. Default: "Public/private"
|
|
1105
|
-
#: components/theme/Views/ExtendedToolView
|
|
1106
|
-
msgid "Public/private"
|
|
1107
|
-
msgstr ""
|
|
1108
|
-
|
|
1109
1109
|
#. Default: "Publications and reports"
|
|
1110
1110
|
#: search/vocabulary
|
|
1111
1111
|
msgid "Publication reference"
|
|
@@ -1213,6 +1213,11 @@ msgstr ""
|
|
|
1213
1213
|
msgid "Remove {title}"
|
|
1214
1214
|
msgstr ""
|
|
1215
1215
|
|
|
1216
|
+
#. Default: "Remove {title} from comparison"
|
|
1217
|
+
#: components/theme/CompareTools/CompareToolsView
|
|
1218
|
+
msgid "Remove {title} from comparison"
|
|
1219
|
+
msgstr ""
|
|
1220
|
+
|
|
1216
1221
|
#. Default: "Replace existing file"
|
|
1217
1222
|
#: components/theme/Widgets/PromotionalImageWidget
|
|
1218
1223
|
msgid "Replace existing file"
|
|
@@ -1337,8 +1342,8 @@ msgid "Source of funding"
|
|
|
1337
1342
|
msgstr ""
|
|
1338
1343
|
|
|
1339
1344
|
#. Default: "Source:"
|
|
1340
|
-
#: components/Result/ClusterHorizontalCardItem
|
|
1341
|
-
#: components/Result/HealthHorizontalCardItem
|
|
1345
|
+
#: components/Search/Result/ClusterHorizontalCardItem
|
|
1346
|
+
#: components/Search/Result/HealthHorizontalCardItem
|
|
1342
1347
|
msgid "Source:"
|
|
1343
1348
|
msgstr ""
|
|
1344
1349
|
|
|
@@ -1464,14 +1469,24 @@ msgstr ""
|
|
|
1464
1469
|
msgid "Tool provider"
|
|
1465
1470
|
msgstr ""
|
|
1466
1471
|
|
|
1472
|
+
#. Default: "Tool provider mode"
|
|
1473
|
+
#: components/theme/Views/ExtendedToolView
|
|
1474
|
+
msgid "Tool provider mode"
|
|
1475
|
+
msgstr ""
|
|
1476
|
+
|
|
1467
1477
|
#. Default: "Tool validation use"
|
|
1468
1478
|
#: components/theme/Views/ExtendedToolView
|
|
1469
1479
|
msgid "Tool validation use"
|
|
1470
1480
|
msgstr ""
|
|
1471
1481
|
|
|
1482
|
+
#. Default: "Tools per country"
|
|
1483
|
+
#: components/Search/NavigatorCatalogue/NavigatorCatalogueMapView
|
|
1484
|
+
msgid "Tools per country"
|
|
1485
|
+
msgstr ""
|
|
1486
|
+
|
|
1472
1487
|
#. Default: "Topics:"
|
|
1473
|
-
#: components/Result/ClusterHorizontalCardItem
|
|
1474
|
-
#: components/Result/HealthHorizontalCardItem
|
|
1488
|
+
#: components/Search/Result/ClusterHorizontalCardItem
|
|
1489
|
+
#: components/Search/Result/HealthHorizontalCardItem
|
|
1475
1490
|
msgid "Topics:"
|
|
1476
1491
|
msgstr ""
|
|
1477
1492
|
|
|
@@ -1571,6 +1586,11 @@ msgstr ""
|
|
|
1571
1586
|
msgid "Videos and podcasts"
|
|
1572
1587
|
msgstr ""
|
|
1573
1588
|
|
|
1589
|
+
#. Default: "View"
|
|
1590
|
+
#: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
|
|
1591
|
+
msgid "View"
|
|
1592
|
+
msgstr ""
|
|
1593
|
+
|
|
1574
1594
|
#. Default: "View all contributions in the resource catalogue"
|
|
1575
1595
|
#: helpers/Utils
|
|
1576
1596
|
msgid "View all contributions in the resource catalogue"
|
|
@@ -1581,11 +1601,6 @@ msgstr ""
|
|
|
1581
1601
|
msgid "View latest version"
|
|
1582
1602
|
msgstr ""
|
|
1583
1603
|
|
|
1584
|
-
#. Default: "View tool"
|
|
1585
|
-
#: components/Search/NavigatorCatalogue/NavigatorCatalogueCardItem
|
|
1586
|
-
msgid "View tool"
|
|
1587
|
-
msgstr ""
|
|
1588
|
-
|
|
1589
1604
|
#. Default: "Visit external website"
|
|
1590
1605
|
#: helpers/Utils
|
|
1591
1606
|
msgid "Visit external website"
|
|
@@ -1647,9 +1662,9 @@ msgstr ""
|
|
|
1647
1662
|
msgid "Which spatial coverage do you need?"
|
|
1648
1663
|
msgstr ""
|
|
1649
1664
|
|
|
1650
|
-
#. Default: "
|
|
1665
|
+
#. Default: "Yes"
|
|
1651
1666
|
#: components/theme/Views/ExtendedToolView
|
|
1652
|
-
msgid "
|
|
1667
|
+
msgid "Yes"
|
|
1653
1668
|
msgstr ""
|
|
1654
1669
|
|
|
1655
1670
|
#. Default: "You are viewing an archived version."
|
|
@@ -1737,16 +1752,16 @@ msgstr ""
|
|
|
1737
1752
|
msgid "refers to"
|
|
1738
1753
|
msgstr ""
|
|
1739
1754
|
|
|
1740
|
-
#. Default: "tools available"
|
|
1741
|
-
#: components/Search/NavigatorCatalogue/NavigatorCatalogueMapView
|
|
1742
|
-
msgid "tools available"
|
|
1743
|
-
msgstr ""
|
|
1744
|
-
|
|
1745
1755
|
#. Default: "Upload an image from your computer"
|
|
1746
1756
|
#: components/theme/Widgets/ImageWidget
|
|
1747
1757
|
msgid "uploadAnImage"
|
|
1748
1758
|
msgstr ""
|
|
1749
1759
|
|
|
1760
|
+
#. Default: "{count, plural, =0 {No tools available} one {# tool available} other {# tools available}}"
|
|
1761
|
+
#: components/Search/NavigatorCatalogue/NavigatorCatalogueMapView
|
|
1762
|
+
msgid "{count, plural, =0 {No tools available} one {# tool available} other {# tools available}}"
|
|
1763
|
+
msgstr ""
|
|
1764
|
+
|
|
1750
1765
|
#. Default: "{count, plural, one {tool matches} other {tools match}}"
|
|
1751
1766
|
#: components/Search/NavigatorGuide/NavigatorGuideContentView
|
|
1752
1767
|
msgid "{count, plural, one {tool matches} other {tools match}}"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eeacms/volto-cca-policy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@eeacms/volto-eea-design-system": "*",
|
|
33
33
|
"@eeacms/volto-eea-website-theme": "*",
|
|
34
34
|
"@eeacms/volto-embed": "*",
|
|
35
|
-
"@eeacms/volto-globalsearch": "4.0
|
|
35
|
+
"@eeacms/volto-globalsearch": "4.1.0",
|
|
36
36
|
"@eeacms/volto-group-block": "^9.0.0",
|
|
37
37
|
"@eeacms/volto-openlayers-map": "2.0.1",
|
|
38
38
|
"@eeacms/volto-searchlib": "^2.1.10",
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
getCompareToolUid,
|
|
9
9
|
useCompareTools,
|
|
10
10
|
} from '../../theme/CompareTools/utils';
|
|
11
|
+
import { rawValueAsArray } from './utils';
|
|
11
12
|
|
|
12
13
|
const messages = defineMessages({
|
|
13
14
|
sector: {
|
|
@@ -35,18 +36,11 @@ const messages = defineMessages({
|
|
|
35
36
|
defaultMessage: 'Compare',
|
|
36
37
|
},
|
|
37
38
|
viewTool: {
|
|
38
|
-
id: 'View
|
|
39
|
-
defaultMessage: 'View
|
|
39
|
+
id: 'View',
|
|
40
|
+
defaultMessage: 'View',
|
|
40
41
|
},
|
|
41
42
|
});
|
|
42
43
|
|
|
43
|
-
const asArray = (value) => {
|
|
44
|
-
if (!value) return [];
|
|
45
|
-
const raw = value.raw !== undefined ? value.raw : value;
|
|
46
|
-
if (!raw) return [];
|
|
47
|
-
return Array.isArray(raw) ? raw.filter(Boolean) : [raw].filter(Boolean);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
44
|
const publicationDateFormatter = new Intl.DateTimeFormat('en-GB', {
|
|
51
45
|
day: '2-digit',
|
|
52
46
|
month: 'short',
|
|
@@ -119,14 +113,14 @@ const CycleElements = ({ intl, values }) => {
|
|
|
119
113
|
const NavigatorCatalogueCardItem = (props) => {
|
|
120
114
|
const { result } = props;
|
|
121
115
|
const intl = useIntl();
|
|
122
|
-
const sectors =
|
|
123
|
-
const hazards =
|
|
124
|
-
const licenseStatus =
|
|
116
|
+
const sectors = rawValueAsArray(result.cca_adaptation_sectors);
|
|
117
|
+
const hazards = rawValueAsArray(result.cca_climate_impacts);
|
|
118
|
+
const licenseStatus = rawValueAsArray(result.cca_license_status)
|
|
125
119
|
.map((value) => value?.title || value)
|
|
126
120
|
.filter(Boolean)
|
|
127
121
|
.join(', ');
|
|
128
122
|
const toolProvider = result?._result?.tool_provider?.raw;
|
|
129
|
-
const adaptationSupportCycleSteps =
|
|
123
|
+
const adaptationSupportCycleSteps = rawValueAsArray(
|
|
130
124
|
result.adaptation_support_cycle_step,
|
|
131
125
|
)
|
|
132
126
|
.map((value) => value?.title?.split(':')[0])
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { compose } from 'redux';
|
|
3
|
-
import { Icon, Button } from 'semantic-ui-react';
|
|
3
|
+
import { Icon, Button, Loader } from 'semantic-ui-react';
|
|
4
4
|
import { defineMessages, useIntl } from 'react-intl';
|
|
5
5
|
import { useSearchContext, useViews } from '@eeacms/search/lib/hocs';
|
|
6
6
|
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import {
|
|
8
|
+
Map,
|
|
9
|
+
Layer,
|
|
10
|
+
Layers,
|
|
11
|
+
Controls,
|
|
12
|
+
useMapContext,
|
|
13
|
+
} from '@eeacms/volto-openlayers-map/api';
|
|
14
|
+
import { euCountryNames, clientOnly } from '@eeacms/volto-cca-policy/helpers';
|
|
12
15
|
import {
|
|
13
16
|
withResponsiveContainer,
|
|
14
17
|
withVisibilitySensor,
|
|
18
|
+
withGeoJsonData,
|
|
15
19
|
} from '@eeacms/volto-cca-policy/hocs';
|
|
16
20
|
import {
|
|
17
21
|
getColorForCount,
|
|
@@ -210,8 +214,8 @@ const NavigatorCatalogueMapViewInner = (props) => {
|
|
|
210
214
|
if (!tileWMSSources || !euCountriesSource) {
|
|
211
215
|
return (
|
|
212
216
|
<div className="navigator-catalogue-map-loading">
|
|
213
|
-
<
|
|
214
|
-
Loading map
|
|
217
|
+
<Loader active inline="centered" />
|
|
218
|
+
<span>Loading map...</span>
|
|
215
219
|
</div>
|
|
216
220
|
);
|
|
217
221
|
}
|
|
@@ -8,33 +8,33 @@ import {
|
|
|
8
8
|
|
|
9
9
|
describe('getColorForCount', () => {
|
|
10
10
|
it('returns darkest green for 10+ tools', () => {
|
|
11
|
-
expect(getColorForCount(10)).toBe('#
|
|
12
|
-
expect(getColorForCount(15)).toBe('#
|
|
13
|
-
expect(getColorForCount(100)).toBe('#
|
|
11
|
+
expect(getColorForCount(10)).toBe('#0F6B3F');
|
|
12
|
+
expect(getColorForCount(15)).toBe('#0F6B3F');
|
|
13
|
+
expect(getColorForCount(100)).toBe('#0F6B3F');
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('returns dark green for 7-9 tools', () => {
|
|
17
|
-
expect(getColorForCount(7)).toBe('#
|
|
18
|
-
expect(getColorForCount(8)).toBe('#
|
|
19
|
-
expect(getColorForCount(9)).toBe('#
|
|
17
|
+
expect(getColorForCount(7)).toBe('#007B6C');
|
|
18
|
+
expect(getColorForCount(8)).toBe('#007B6C');
|
|
19
|
+
expect(getColorForCount(9)).toBe('#007B6C');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
it('returns base accent green for 4-6 tools', () => {
|
|
23
|
-
expect(getColorForCount(4)).toBe('#
|
|
24
|
-
expect(getColorForCount(5)).toBe('#
|
|
25
|
-
expect(getColorForCount(6)).toBe('#
|
|
23
|
+
expect(getColorForCount(4)).toBe('#84C79A');
|
|
24
|
+
expect(getColorForCount(5)).toBe('#84C79A');
|
|
25
|
+
expect(getColorForCount(6)).toBe('#84C79A');
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
it('returns light green for 1-3 tools', () => {
|
|
29
|
-
expect(getColorForCount(1)).toBe('#
|
|
30
|
-
expect(getColorForCount(2)).toBe('#
|
|
31
|
-
expect(getColorForCount(3)).toBe('#
|
|
29
|
+
expect(getColorForCount(1)).toBe('#C2E3CD');
|
|
30
|
+
expect(getColorForCount(2)).toBe('#C2E3CD');
|
|
31
|
+
expect(getColorForCount(3)).toBe('#C2E3CD');
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
it('returns lightest gray-green for 0 or falsy counts', () => {
|
|
35
|
-
expect(getColorForCount(0)).toBe('#
|
|
36
|
-
expect(getColorForCount(null)).toBe('#
|
|
37
|
-
expect(getColorForCount(undefined)).toBe('#
|
|
35
|
+
expect(getColorForCount(0)).toBe('#E1E7DF');
|
|
36
|
+
expect(getColorForCount(null)).toBe('#E1E7DF');
|
|
37
|
+
expect(getColorForCount(undefined)).toBe('#E1E7DF');
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -140,20 +140,20 @@ describe('mapLegendItems', () => {
|
|
|
140
140
|
expect(mapLegendItems).toHaveLength(5);
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
-
it('
|
|
144
|
-
expect(mapLegendItems[0].color).toBe(
|
|
145
|
-
expect(mapLegendItems[1].color).toBe(
|
|
146
|
-
expect(mapLegendItems[2].color).toBe(
|
|
147
|
-
expect(mapLegendItems[3].color).toBe(
|
|
148
|
-
expect(mapLegendItems[4].color).toBe(
|
|
143
|
+
it('uses the current legend color palette', () => {
|
|
144
|
+
expect(mapLegendItems[0].color).toBe('#0F6B3F');
|
|
145
|
+
expect(mapLegendItems[1].color).toBe('#007B6C');
|
|
146
|
+
expect(mapLegendItems[2].color).toBe('#84C79A');
|
|
147
|
+
expect(mapLegendItems[3].color).toBe('#C2E3CD');
|
|
148
|
+
expect(mapLegendItems[4].color).toBe('#E1E7DF');
|
|
149
149
|
});
|
|
150
150
|
|
|
151
151
|
it('has correct labels', () => {
|
|
152
152
|
expect(mapLegendItems.map((item) => item.label)).toEqual([
|
|
153
|
-
'10
|
|
154
|
-
'7
|
|
155
|
-
'4
|
|
156
|
-
'1
|
|
153
|
+
'10 or more',
|
|
154
|
+
'7 - 9',
|
|
155
|
+
'4 - 6',
|
|
156
|
+
'1 - 3',
|
|
157
157
|
'None',
|
|
158
158
|
]);
|
|
159
159
|
});
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
* Color scale for tool counts (EEA green tones)
|
|
3
3
|
* Used by the map view to color-code countries
|
|
4
4
|
*/
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
export const mapColorScale = [
|
|
6
|
+
{ minimum: 10, label: '10 or more', color: '#0F6B3F' },
|
|
7
|
+
{ minimum: 7, label: '7 - 9', color: '#007B6C' },
|
|
8
|
+
{ minimum: 4, label: '4 - 6', color: '#84C79A' },
|
|
9
|
+
{ minimum: 1, label: '1 - 3', color: '#C2E3CD' },
|
|
10
|
+
{ minimum: 0, label: 'None', color: '#E1E7DF' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export const getColorForCount = (count) =>
|
|
14
|
+
mapColorScale.find(({ minimum }) => count >= minimum)?.color ||
|
|
15
|
+
mapColorScale.at(-1).color;
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* Normalize country names between GeoJSON and facet data
|
|
@@ -46,29 +50,27 @@ export const buildCountryCounts = (facets) => {
|
|
|
46
50
|
/**
|
|
47
51
|
* Legend items for the map view
|
|
48
52
|
*/
|
|
49
|
-
export const mapLegendItems =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
{ label: '1–3', color: '#6fc4b8' },
|
|
54
|
-
{ label: 'None', color: '#e8eded' },
|
|
55
|
-
];
|
|
53
|
+
export const mapLegendItems = mapColorScale.map(({ label, color }) => ({
|
|
54
|
+
label,
|
|
55
|
+
color,
|
|
56
|
+
}));
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const raw = value.raw !== undefined ? value.raw : value;
|
|
60
|
-
if (!raw) return [];
|
|
61
|
-
const values = Array.isArray(raw)
|
|
62
|
-
? raw.filter(Boolean)
|
|
63
|
-
: [raw].filter(Boolean);
|
|
58
|
+
const unwrapRawValue = (value) =>
|
|
59
|
+
value?.raw === undefined ? value : value.raw;
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
export const rawValueAsArray = (value) => {
|
|
62
|
+
const raw = unwrapRawValue(value);
|
|
63
|
+
if (!raw) return [];
|
|
64
|
+
return Array.isArray(raw) ? raw.filter(Boolean) : [raw].filter(Boolean);
|
|
66
65
|
};
|
|
67
66
|
|
|
67
|
+
export const asArray = (value) =>
|
|
68
|
+
rawValueAsArray(value).map((value) => value?.title || value?.token || value);
|
|
69
|
+
|
|
68
70
|
export const arrayFieldToString = (value) => asArray(value).join(', ');
|
|
69
71
|
|
|
70
72
|
export const formatFunctionalityScore = (value) => {
|
|
71
|
-
const raw = value
|
|
73
|
+
const raw = unwrapRawValue(value);
|
|
72
74
|
const score = raw === null || raw === undefined ? Number.NaN : Number(raw);
|
|
73
75
|
|
|
74
76
|
return Number.isFinite(score) ? `${Math.min(6, Math.max(0, score))}/6` : '—';
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
formatFunctionalityScore,
|
|
8
8
|
getComparePageURL,
|
|
9
9
|
getLocalizedLandingPageURL,
|
|
10
|
+
rawValueAsArray,
|
|
10
11
|
} from './utils';
|
|
11
12
|
|
|
12
13
|
describe('Navigator Catalogue utilities', () => {
|
|
@@ -40,6 +41,10 @@ describe('Navigator Catalogue utilities', () => {
|
|
|
40
41
|
});
|
|
41
42
|
|
|
42
43
|
it('normalizes raw, scalar, title, token, and empty values', () => {
|
|
44
|
+
expect(rawValueAsArray({ raw: ['One', null, { title: 'Two' }] })).toEqual([
|
|
45
|
+
'One',
|
|
46
|
+
{ title: 'Two' },
|
|
47
|
+
]);
|
|
43
48
|
expect(asArray()).toEqual([]);
|
|
44
49
|
expect(asArray({ raw: null })).toEqual([]);
|
|
45
50
|
expect(asArray({ raw: ['One', null, { title: 'Two' }] })).toEqual([
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
euCountryNames,
|
|
5
5
|
setTooltipVisibility,
|
|
6
6
|
getClosestFeatureToCoordinate,
|
|
7
|
-
} from '@eeacms/volto-cca-policy/helpers
|
|
7
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
8
8
|
import { useMapContext } from '@eeacms/volto-openlayers-map/api';
|
|
9
9
|
|
|
10
10
|
export const Interactions = ({
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { compose } from 'redux';
|
|
3
|
-
import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
|
|
4
|
-
|
|
5
|
-
import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
|
|
6
|
-
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
7
3
|
import {
|
|
4
|
+
clientOnly,
|
|
8
5
|
euCountryNames as euCountryNamesRaw,
|
|
9
6
|
tooltipStyle,
|
|
10
7
|
getImageUrl,
|
|
11
8
|
adjustEuCountryNames,
|
|
12
|
-
} from '@eeacms/volto-cca-policy/helpers
|
|
13
|
-
import {
|
|
9
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
10
|
+
import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
|
|
11
|
+
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
14
12
|
import {
|
|
15
13
|
withResponsiveContainer,
|
|
16
14
|
withVisibilitySensor,
|
|
15
|
+
withGeoJsonData,
|
|
17
16
|
} from '@eeacms/volto-cca-policy/hocs';
|
|
18
17
|
import { makeStyles } from './mapstyle';
|
|
19
18
|
import { Interactions } from './Interactions';
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { getBaseUrl } from '@eeacms/volto-cca-policy/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { compose } from 'redux';
|
|
4
|
-
import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
|
|
5
|
-
import { useHistory } from 'react-router-dom';
|
|
6
|
-
|
|
7
|
-
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
8
|
-
import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
|
|
9
4
|
import {
|
|
5
|
+
clientOnly,
|
|
10
6
|
euCountryNames,
|
|
11
7
|
tooltipStyle,
|
|
12
8
|
getImageUrl,
|
|
13
|
-
} from '@eeacms/volto-cca-policy/helpers
|
|
14
|
-
import {
|
|
9
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
10
|
+
import { useHistory } from 'react-router-dom';
|
|
11
|
+
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
12
|
+
import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
|
|
15
13
|
import {
|
|
16
14
|
withResponsiveContainer,
|
|
17
15
|
withVisibilitySensor,
|
|
16
|
+
withGeoJsonData,
|
|
18
17
|
} from '@eeacms/volto-cca-policy/hocs';
|
|
19
18
|
import { makeStyles } from './mapstyle';
|
|
20
19
|
import { Interactions } from './Interactions';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { euCountryNames } from '@eeacms/volto-cca-policy/helpers
|
|
3
|
+
import { euCountryNames } from '@eeacms/volto-cca-policy/helpers';
|
|
4
4
|
import { useMapContext } from '@eeacms/volto-openlayers-map/api';
|
|
5
5
|
|
|
6
6
|
let highlight = null; // easy global
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
euCountryNames,
|
|
4
4
|
setTooltipVisibility,
|
|
5
5
|
getClosestFeatureToCoordinate,
|
|
6
|
-
} from '@eeacms/volto-cca-policy/helpers
|
|
6
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
7
7
|
import { useMapContext } from '@eeacms/volto-openlayers-map/api';
|
|
8
8
|
|
|
9
9
|
export const Interactions = ({
|
|
@@ -2,13 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { compose } from 'redux';
|
|
3
3
|
import { Grid } from 'semantic-ui-react';
|
|
4
4
|
import {
|
|
5
|
+
clientOnly,
|
|
5
6
|
getImageUrl,
|
|
6
7
|
tooltipStyle,
|
|
7
8
|
adjustEuCountryNames,
|
|
8
9
|
euCountryNamesIncludingEnergy as euCountryNamesRaw,
|
|
9
|
-
} from '@eeacms/volto-cca-policy/helpers
|
|
10
|
-
import { withGeoJsonData } from '@eeacms/volto-cca-policy/helpers/country_map/hocs';
|
|
11
|
-
import { clientOnly } from '@eeacms/volto-cca-policy/helpers';
|
|
10
|
+
} from '@eeacms/volto-cca-policy/helpers';
|
|
12
11
|
import { withOpenLayers } from '@eeacms/volto-openlayers-map';
|
|
13
12
|
import { Map, Layer, Layers, Controls } from '@eeacms/volto-openlayers-map/api';
|
|
14
13
|
import { makeStyles } from './mapstyle';
|
|
@@ -18,6 +17,7 @@ import Filter from './Filter';
|
|
|
18
17
|
import {
|
|
19
18
|
withResponsiveContainer,
|
|
20
19
|
withVisibilitySensor,
|
|
20
|
+
withGeoJsonData,
|
|
21
21
|
} from '@eeacms/volto-cca-policy/hocs';
|
|
22
22
|
import { addAppURL } from '@plone/volto/helpers/Url/Url';
|
|
23
23
|
|
|
@@ -10,6 +10,7 @@ import './style.less';
|
|
|
10
10
|
const FlourishEmbedBlockView = ({ data, mode }) => {
|
|
11
11
|
const isEditMode = mode === 'edit';
|
|
12
12
|
const embed_code = data?.embed_code || '';
|
|
13
|
+
const height = data?.height || '980';
|
|
13
14
|
const flourishPath = getDataSrcFromEmbedCode(embed_code);
|
|
14
15
|
const flourishUrl = buildFlourishUrl(flourishPath);
|
|
15
16
|
|
|
@@ -26,7 +27,7 @@ const FlourishEmbedBlockView = ({ data, mode }) => {
|
|
|
26
27
|
}}
|
|
27
28
|
>
|
|
28
29
|
<iframe
|
|
29
|
-
height=
|
|
30
|
+
height={height}
|
|
30
31
|
width="100%"
|
|
31
32
|
src={flourishUrl}
|
|
32
33
|
title="Flourish visualization"
|
|
@@ -4,7 +4,7 @@ const schema = {
|
|
|
4
4
|
{
|
|
5
5
|
id: 'default',
|
|
6
6
|
title: 'Default',
|
|
7
|
-
fields: ['embed_code'],
|
|
7
|
+
fields: ['embed_code', 'height'],
|
|
8
8
|
},
|
|
9
9
|
],
|
|
10
10
|
properties: {
|
|
@@ -12,6 +12,12 @@ const schema = {
|
|
|
12
12
|
title: 'Flourish embed code',
|
|
13
13
|
widget: 'textarea',
|
|
14
14
|
},
|
|
15
|
+
height: {
|
|
16
|
+
title: 'Embed height',
|
|
17
|
+
description:
|
|
18
|
+
'Height of the Flourish iframe in pixels. If left empty, the default height is 980 px.',
|
|
19
|
+
type: 'number',
|
|
20
|
+
},
|
|
15
21
|
},
|
|
16
22
|
required: [],
|
|
17
23
|
};
|