@eeacms/volto-cca-policy 0.3.34 → 0.3.35
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 +12 -0
- package/package.json +1 -1
- package/src/components/manage/Blocks/CountryMapObservatory/CountryMapObservatoryOLView.jsx +8 -6
- package/src/components/manage/Blocks/CountryMapObservatory/Interactions.jsx +6 -2
- package/src/customizations/@plone/volto-slate/widgets/HtmlSlateWidget.jsx +2 -1
- package/src/customizations/@plone/volto-slate/widgets/README.md +13 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
### [0.3.35](https://github.com/eea/volto-cca-policy/compare/0.3.34...0.3.35) - 6 May 2025
|
|
8
|
+
|
|
9
|
+
#### :house: Internal changes
|
|
10
|
+
|
|
11
|
+
- style: Automated code fix [eea-jenkins - [`3ee5c45`](https://github.com/eea/volto-cca-policy/commit/3ee5c45a2c6240ca4891b424278b66d36b097bd2)]
|
|
12
|
+
|
|
13
|
+
#### :hammer_and_wrench: Others
|
|
14
|
+
|
|
15
|
+
- Customize html widget to let it treat whitespace [Tiberiu Ichim - [`c587517`](https://github.com/eea/volto-cca-policy/commit/c58751740401480d5e87674cc1a16d9a010385be)]
|
|
16
|
+
- Refs #287349 - remove uk from observatory map dependency [Tripon Eugen - [`6b90a59`](https://github.com/eea/volto-cca-policy/commit/6b90a599a2aaa9c00b9b24625216c5c34e518075)]
|
|
17
|
+
- Refs #287349 - remove uk from observatory map eslint [Tripon Eugen - [`b535431`](https://github.com/eea/volto-cca-policy/commit/b5354318a41f03cc8d5dec9ae5a93cd8e1182d0d)]
|
|
18
|
+
- Refs #287349 - remove uk from observatory map [Tripon Eugen - [`d3d89dd`](https://github.com/eea/volto-cca-policy/commit/d3d89ddf80e63af63ebcc4a3a2eb538dce1eec3b)]
|
|
7
19
|
### [0.3.34](https://github.com/eea/volto-cca-policy/compare/0.3.33...0.3.34) - 6 May 2025
|
|
8
20
|
|
|
9
21
|
#### :bug: Bug Fixes
|
package/package.json
CHANGED
|
@@ -37,12 +37,14 @@ const CountryMapObservatoryView = (props) => {
|
|
|
37
37
|
setOverlaySource(new ol.source.Vector());
|
|
38
38
|
|
|
39
39
|
const features = new ol.format.GeoJSON().readFeatures(geofeatures);
|
|
40
|
-
const updateEuCountryNames = euCountryNames
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
const updateEuCountryNames = euCountryNames
|
|
41
|
+
.map((countryName) => {
|
|
42
|
+
if ('Turkey' === countryName) {
|
|
43
|
+
countryName = 'Türkiye';
|
|
44
|
+
}
|
|
45
|
+
return countryName;
|
|
46
|
+
})
|
|
47
|
+
.filter((countryName) => countryName !== 'United Kingdom');
|
|
46
48
|
|
|
47
49
|
const filtered = features.filter((f) =>
|
|
48
50
|
updateEuCountryNames.includes(f.get('na')),
|
|
@@ -21,6 +21,10 @@ function setTooltipVisibility(node, label, event, visible) {
|
|
|
21
21
|
export const Interactions = ({ overlaySource, tooltipRef, onFeatureClick }) => {
|
|
22
22
|
const map = useMapContext().map;
|
|
23
23
|
|
|
24
|
+
const euCountryNamesFiltered = euCountryNames.filter(
|
|
25
|
+
(euCountryName) => euCountryName !== 'United Kingdom',
|
|
26
|
+
);
|
|
27
|
+
|
|
24
28
|
React.useEffect(() => {
|
|
25
29
|
if (!map) return;
|
|
26
30
|
|
|
@@ -40,7 +44,7 @@ export const Interactions = ({ overlaySource, tooltipRef, onFeatureClick }) => {
|
|
|
40
44
|
overlaySource.removeFeature(highlight);
|
|
41
45
|
} catch {}
|
|
42
46
|
}
|
|
43
|
-
if (feature &&
|
|
47
|
+
if (feature && euCountryNamesFiltered.includes(feature.get('na'))) {
|
|
44
48
|
overlaySource.addFeature(feature);
|
|
45
49
|
map.getTargetElement().style.cursor = 'pointer';
|
|
46
50
|
const node = tooltipRef.current;
|
|
@@ -64,7 +68,7 @@ export const Interactions = ({ overlaySource, tooltipRef, onFeatureClick }) => {
|
|
|
64
68
|
onFeatureClick(feature);
|
|
65
69
|
}
|
|
66
70
|
});
|
|
67
|
-
}, [map, overlaySource, tooltipRef, onFeatureClick]);
|
|
71
|
+
}, [map, overlaySource, tooltipRef, onFeatureClick, euCountryNamesFiltered]);
|
|
68
72
|
|
|
69
73
|
return null;
|
|
70
74
|
};
|
|
@@ -80,7 +80,8 @@ const HtmlSlateWidget = (props) => {
|
|
|
80
80
|
parsed.getElementsByTagName('google-sheets-html-origin').length > 0
|
|
81
81
|
? parsed.querySelector('google-sheets-html-origin > table')
|
|
82
82
|
: parsed.body;
|
|
83
|
-
let data = deserialize(editor, body, { collapseWhitespace:
|
|
83
|
+
let data = deserialize(editor, body, { collapseWhitespace: true });
|
|
84
|
+
// console.log({ data, parsed, body, html });
|
|
84
85
|
if (data.length) {
|
|
85
86
|
data = normalizeExternalData(editor, data);
|
|
86
87
|
} else {
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
# Customizations
|
|
2
|
+
|
|
1
3
|
Customized for this
|
|
2
4
|
|
|
5
|
+
```js
|
|
6
|
+
if (data.length) {
|
|
7
|
+
data = normalizeExternalData(editor, data);
|
|
8
|
+
} else {
|
|
9
|
+
return [createEmptyParagraph()];
|
|
10
|
+
}
|
|
3
11
|
```
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
|
|
13
|
+
and this:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
let data = deserialize(editor, body, { collapseWhitespace: true });
|
|
9
17
|
```
|