Mercurial > gemma
view client/src/components/identify/formatter.js @ 2920:c1f2b9148cc8
client: removed more unnecessary closing tags and opzimized imports
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 03 Apr 2019 16:23:25 +0200 |
parents | 4063adda3095 |
children | 9107c959bb3b |
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.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"; // remove certain props let propsToRemove = ["nobjnm", "reference_water_levels"]; 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" }, waterway_axis: { label: "Waterway Axis" }, waterway_profiles: { label: "Waterway Profile" }, stretches_geoserver: { label: "Stretch" }, gauges_geoserver: { label: "Gauge" } }; export { formatter };