changeset 3485:ef4803f87631

Add 'translation' and bottleneck attributes for measurement availability
author Tom Gottfried <tom@intevation.de>
date Mon, 27 May 2019 16:28:22 +0200
parents a303a746e471
children 1fbb6dc7d362
files client/src/components/identify/formatter.js schema/geoserver_views.sql
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/identify/formatter.js	Mon May 27 16:20:35 2019 +0200
+++ b/client/src/components/identify/formatter.js	Mon May 27 16:28:22 2019 +0200
@@ -4,7 +4,11 @@
     if (p.key === "objname") p.key = "Name";
     if (p.key === "staging_done" || p.key === "fa_critical")
       p.val = p.val ? "yes" : "no";
-    if (p.key === "date_info" || p.key === "fa_date_info") {
+    if (
+      p.key === "date_info" ||
+      p.key === "fa_date_info" ||
+      p.key === "gm_measuredate"
+    ) {
       p.val = new Date(p.val).toLocaleString();
     }
 
@@ -23,7 +27,9 @@
       if (p.key === "fa_critical") p.key = "Fairway Critical";
       if (p.key === "gauge_objname") p.key = "Reference Gauge";
       if (p.key === "source_organization") p.key = "Source Organization";
+      if (p.key === "gm_measuredate") p.key = "Gauge Waterlevel Date";
       if (p.key === "gm_waterlevel") p.key = "Gauge Waterlevel";
+      if (p.key === "gm_n_14d") p.key = "G.W. Count in Last 14 Days";
 
       // remove certain props
       let propsToRemove = ["nobjnm", "reference_water_levels"];
@@ -59,7 +65,9 @@
   gauges_geoserver: {
     label: "Gauge",
     props: p => {
+      if (p.key === "gm_measuredate") p.key = "Latest Waterlevel Date";
       if (p.key === "gm_waterlevel") p.key = "Latest Waterlevel";
+      if (p.key === "gm_n_14d") p.key = "Measurement Count in Last 14 Days";
 
       return p;
     }
--- a/schema/geoserver_views.sql	Mon May 27 16:20:35 2019 +0200
+++ b/schema/geoserver_views.sql	Mon May 27 16:28:22 2019 +0200
@@ -101,7 +101,9 @@
         g.reference_water_levels,
         fal.date_info AS fa_date_info,
         fal.critical AS fa_critical,
+        g.gm_measuredate,
         g.gm_waterlevel,
+        g.gm_n_14d,
         srl.date_max,
         g.forecast_accuracy_3d,
         g.forecast_accuracy_1d