Mercurial > gemma
view client/src/components/identify/formatter.js @ 3515:c64c47ff2ab1 password
import: fix for passwordleakage. No passwords are received/sent if configuration is edited.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 29 May 2019 09:56:42 +0200 |
parents | d136ceed5d41 |
children | 6d6577a87963 |
line wrap: on
line source
const formatter = { all(p) { if (p.key === "objnam") p.key = "Name"; 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" || p.key === "gm_measuredate" ) { p.val = new Date(p.val).toLocaleString(); } // remove certain props let propsToRemove = ["bbox"]; if (propsToRemove.indexOf(p.key) !== -1) return null; return p; }, bottlenecks_geoserver: { label: "Bottleneck", 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"; 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", "fa_data"]; if (propsToRemove.indexOf(p.key) !== -1) return null; return p; } }, fairway_dimensions: { label: "Fairway Dimensions" }, waterway_area: { label: "Waterway Area" }, distance_marks_geoserver: { label: "Distance Mark" }, distance_marks_ashore_geoserver: { label: "Distance Mark ashore" }, waterway_axis: { label: "Waterway Axis" }, waterway_profiles: { label: "Waterway Profile" }, stretches_geoserver: { label: "Stretch" }, sections_geoserver: { label: "Section" }, 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"; // remove certain props let propsToRemove = ["nsc_data"]; if (propsToRemove.indexOf(p.key) !== -1) return null; return p; } } }; export { formatter };