-
{/* El label que mencionas */}
+
Apologies,
@@ -179,7 +186,10 @@ function Visualization() {
const depthValue = monitoredData
? monitoredData.values.find((value) => value.type === "depth")
: null;
-
+ const climatology_depthValue = monitoredData
+ ? monitoredData.values.find((value) => value.type === "climatology_depth")
+ : null;
+
const hasContentsWp =
monitoredData.am || monitoredData.or || monitoredData.en;
@@ -187,11 +197,13 @@ function Visualization() {
? null
: !filter.green && depthValue.value >= 0.7
? null
- : !filter.yellow && depthValue.value >= 0.3 && depthValue.value < 0.7
+ : !filter.yellow && depthValue.value > 0.3 && depthValue.value < 0.7
? null
- : !filter.brown && depthValue.value >= 0.2 && depthValue.value < 0.3
+ : !filter.brown && depthValue.value > 0.2 && depthValue.value < 0.3
? null
- : !filter.red && depthValue.value < 0.2
+ : !filter.red && depthValue.value < 0.2 && depthValue.value >= 0
+ ? null
+ : !filter.gray && depthValue.value === 0 && climatology_depthValue.value === 0
? null
: (
<>
@@ -236,11 +248,13 @@ function Visualization() {
= 0 && depthValue.value < 0.2
? redIcon
- : depthValue.value >= 0.2 && depthValue.value < 0.3
+ : depthValue.value > 0.2 && depthValue.value < 0.3
? brownIcon
- : depthValue.value >= 0.3 && depthValue.value < 0.7
+ : depthValue.value > 0.3 && depthValue.value < 0.7
? yellowIcon
: greenIcon
}
@@ -317,20 +331,24 @@ function Visualization() {
= 0 && depthValue.value < 0.2
? "td-red"
- : depthValue.value >= 0.2 && depthValue.value < 0.3
+ : depthValue.value > 0.2 && depthValue.value < 0.3
? "td-brown"
- : depthValue.value >= 0.3 && depthValue.value < 0.7
+ : depthValue.value > 0.3 && depthValue.value < 0.7
? "td-yellow"
: "td-green"
}`}
>
- {depthValue.value < 0.2
+ {depthValue.value == 0 && climatology_depthValue.value == 0
+ ? t("monitoring.seasonally")
+ : depthValue.value >= 0 && depthValue.value < 0.2
? t("monitoring.near")
- : depthValue.value >= 0.2 && depthValue.value < 0.3
+ : depthValue.value > 0.2 && depthValue.value < 0.3
? t("monitoring.alert")
- : depthValue.value >= 0.3 && depthValue.value < 0.7
+ : depthValue.value > 0.3 && depthValue.value < 0.7
? t("monitoring.watch")
: t("monitoring.good")}
@@ -463,6 +481,7 @@ function Visualization() {
}
});
};
+ console.log(wpstolabel)
return (
<>
@@ -540,7 +559,6 @@ function Visualization() {
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{waterpoints && }
-
{route && (
>;
}
};
+ console.log(wp)
return (
<>
{idWater ? (
@@ -321,9 +322,11 @@ function Waterprofile() {
= 0 && wp.depth <0.2
? redIcon
- : wp.depth > 0.2 && wp.depth <0.3
+ : wp.depth > 0.2 && wp.depth < 0.3
? brownIcon
: wp.depth > 0.3 && wp.depth < 0.7
? yellowIcon
diff --git a/src/src/pages/userprofile/Userprofile.js b/src/src/pages/userprofile/Userprofile.js
index 6a84b7f..7ee086d 100644
--- a/src/src/pages/userprofile/Userprofile.js
+++ b/src/src/pages/userprofile/Userprofile.js
@@ -148,7 +148,6 @@ function Userprofile() {
[event.target.name]: event.target.checked,
});
};
-
return (
<>
= 0 && waterpoint.last_monitored_deph < 0.2
? "td-red"
: waterpoint.last_monitored_deph > 0.2 && waterpoint.last_monitored_deph < 0.3
? "td-brown"
|