@eeacms/volto-clms-theme 1.1.170 → 1.1.172
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
CHANGED
|
@@ -4,6 +4,16 @@ 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
|
+
### [1.1.172](https://github.com/eea/volto-clms-theme/compare/1.1.171...1.1.172) - 18 July 2024
|
|
8
|
+
|
|
9
|
+
### [1.1.171](https://github.com/eea/volto-clms-theme/compare/1.1.170...1.1.171) - 18 July 2024
|
|
10
|
+
|
|
11
|
+
#### :hammer_and_wrench: Others
|
|
12
|
+
|
|
13
|
+
- CLMS-27147 (task): static dependency for useEffect [Unai Bolivar - [`db3614d`](https://github.com/eea/volto-clms-theme/commit/db3614dbb6816086839acb4e939d5a6c6465c5c1)]
|
|
14
|
+
- CLMS-27147 (task): reuploading [Unai Bolivar - [`eafdeeb`](https://github.com/eea/volto-clms-theme/commit/eafdeeb87091f0e082c41b37c65b571d715b44ee)]
|
|
15
|
+
- CLMS-27147 (bug): extracted comples expression from dependency array [Unai Bolivar - [`f68b933`](https://github.com/eea/volto-clms-theme/commit/f68b9330d11063885a47620e56391e0c60b96076)]
|
|
16
|
+
- CLMS-271247 (task): When the selected format is NetCDF, the projection combo should have EPSG:4326 value [Unai Bolivar - [`e37590a`](https://github.com/eea/volto-clms-theme/commit/e37590ab0069dcadbcb99308f5698e93d9274afc)]
|
|
7
17
|
### [1.1.170](https://github.com/eea/volto-clms-theme/compare/1.1.169...1.1.170) - 18 July 2024
|
|
8
18
|
|
|
9
19
|
#### :hammer_and_wrench: Others
|
package/package.json
CHANGED
|
@@ -20,7 +20,9 @@ const _ProjectionNaming = ({
|
|
|
20
20
|
const setProjectionValue = (unique_id, value, cI) => {
|
|
21
21
|
const new_cartItems = [...cI];
|
|
22
22
|
const objIndex = cI.findIndex((obj) => obj.unique_id === unique_id);
|
|
23
|
-
if (new_cartItems[objIndex])
|
|
23
|
+
if (new_cartItems[objIndex]) {
|
|
24
|
+
new_cartItems[objIndex].projection = value;
|
|
25
|
+
}
|
|
24
26
|
setCartItems([...new_cartItems]);
|
|
25
27
|
};
|
|
26
28
|
const utm = getUtm(item, utmProjections);
|
|
@@ -44,44 +46,53 @@ const _ProjectionNaming = ({
|
|
|
44
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
47
|
}, [choices]);
|
|
46
48
|
|
|
49
|
+
const datasetProjections = JSON.stringify(
|
|
50
|
+
projections_uid?.[item.dataset_uid],
|
|
51
|
+
);
|
|
52
|
+
|
|
47
53
|
useEffect(() => {
|
|
48
|
-
if (
|
|
49
|
-
projections_uid?.[item.dataset_uid] &&
|
|
50
|
-
projections_uid?.[item.dataset_uid].length > 0
|
|
51
|
-
) {
|
|
54
|
+
if (datasetProjections && datasetProjections.length > 0) {
|
|
52
55
|
setLoading(true);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (Number(a.split(':')[1]) > Number(b.split(':')[1])) {
|
|
57
|
-
return 1;
|
|
58
|
-
} else {
|
|
59
|
-
return -1;
|
|
60
|
-
}
|
|
61
|
-
})
|
|
62
|
-
.filter((p) => utm.includes(p) || baseSources.includes(p))
|
|
63
|
-
.map((p) => {
|
|
64
|
-
const re = new RegExp(p.split(':')[1]);
|
|
65
|
-
return {
|
|
66
|
-
key: p,
|
|
67
|
-
value: p,
|
|
68
|
-
default: re.test(item.original_projection) ? true : false,
|
|
69
|
-
text: re.test(item.original_projection)
|
|
70
|
-
? `${p} (Source system of the dataset)`
|
|
71
|
-
: p,
|
|
72
|
-
className: re.test(item.original_projection)
|
|
73
|
-
? 'original_projection'
|
|
74
|
-
: 'projection',
|
|
75
|
-
};
|
|
76
|
-
}),
|
|
56
|
+
const newBaseSources = ['EPSG:4326'];
|
|
57
|
+
const sortedProjections = projections_uid[item.dataset_uid].sort((a, b) =>
|
|
58
|
+
Number(a.split(':')[1]) > Number(b.split(':')[1]) ? 1 : -1,
|
|
77
59
|
);
|
|
60
|
+
|
|
61
|
+
const filteredProjections =
|
|
62
|
+
item?.format === 'Netcdf' ||
|
|
63
|
+
item?.format?.token === 'Netcdf' ||
|
|
64
|
+
item?.format?.title === 'Netcdf'
|
|
65
|
+
? sortedProjections.filter(
|
|
66
|
+
(p) => utm.includes(p) || newBaseSources.includes(p),
|
|
67
|
+
)
|
|
68
|
+
: sortedProjections.filter(
|
|
69
|
+
(p) => utm.includes(p) || baseSources.includes(p),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const choices = filteredProjections.map((p) => {
|
|
73
|
+
const re = new RegExp(p.split(':')[1]);
|
|
74
|
+
return {
|
|
75
|
+
key: p,
|
|
76
|
+
value: p,
|
|
77
|
+
default: re.test(item.original_projection),
|
|
78
|
+
text: re.test(item.original_projection)
|
|
79
|
+
? `${p} (Source system of the dataset)`
|
|
80
|
+
: p,
|
|
81
|
+
className: re.test(item.original_projection)
|
|
82
|
+
? 'original_projection'
|
|
83
|
+
: 'projection',
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
setChoices(choices);
|
|
88
|
+
setLoading(false);
|
|
78
89
|
} else {
|
|
79
90
|
setLoading(true);
|
|
80
91
|
}
|
|
81
92
|
return () => {};
|
|
82
93
|
|
|
83
94
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
|
-
}, [
|
|
95
|
+
}, [datasetProjections, item.unique_id, item.format]);
|
|
85
96
|
|
|
86
97
|
useEffect(() => {
|
|
87
98
|
!item.projection && choices.length > 0 && choices.find((ch) => ch.default)
|