changeset 2509:3dc7c0f60a62

client: identify box: formatted fa_date_info and fa_critical
author Markus Kottlaender <markus@intevation.de>
date Tue, 05 Mar 2019 09:12:29 +0100
parents ae257e0238f1
children f2758dafe390
files client/src/components/identify/formatter.js
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/identify/formatter.js	Tue Mar 05 08:46:55 2019 +0100
+++ b/client/src/components/identify/formatter.js	Tue Mar 05 09:12:29 2019 +0100
@@ -1,8 +1,9 @@
 const formatter = {
   all(p) {
     if (p.key === "objnam") p.key = "Name";
-    if (p.key === "staging_done") p.val = p.val ? "yes" : "no";
-    if (p.key === "date_info") {
+    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") {
       p.val = new Date(p.val).toLocaleString();
     }
     return p;
@@ -12,6 +13,8 @@
     props: p => {
       if (p.key === "bottleneck_id") p.key = "ID";
       if (p.key === "responsible_country") p.key = "Responsible Country";
+      if (p.key === "fa_date_info") p.key = "Fairway Date";
+      if (p.key === "fa_critical") p.key = "Fairway Critical";
 
       // remove certain props
       let propsToRemove = ["nobjnm", "reference_water_levels"];