Mercurial > gemma
comparison client/src/components/identify/formatter.js @ 2371:045bac575294
client: fixed broken previous commit
I forgot to add/remove files.... gnarf sry.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 21 Feb 2019 15:22:10 +0100 |
parents | |
children | ef928c63388a |
comparison
equal
deleted
inserted
replaced
2370:7fe2f5d334dc | 2371:045bac575294 |
---|---|
1 const formatter = { | |
2 bottlenecks_geoserver: { | |
3 label: "Bottleneck", | |
4 props: p => { | |
5 if (p.key === "bottleneck_id") p.key = "ID"; | |
6 if (p.key === "objnam") p.key = "Name"; | |
7 if (p.key === "responsible_country") p.key = "Responsible Country"; | |
8 if (p.key === "date_info") { | |
9 p.val = new Date(p.val).toLocaleString(); | |
10 } | |
11 | |
12 // remove certain props | |
13 let propsToRemove = ["nobjnm"]; | |
14 if (propsToRemove.indexOf(p.key) !== -1) return null; | |
15 | |
16 return p; | |
17 } | |
18 }, | |
19 fairway_dimensions: { | |
20 label: "Fairway Dimensions", | |
21 props: p => { | |
22 if (p.key === "staging_done") p.val = p.val ? "yes" : "no"; | |
23 if (p.key === "date_info") { | |
24 p.val = new Date(p.val).toLocaleString(); | |
25 } | |
26 | |
27 // remove certain props | |
28 let propsToRemove = []; | |
29 if (propsToRemove.indexOf(p.key) !== -1) return null; | |
30 | |
31 return p; | |
32 } | |
33 }, | |
34 waterway_area: { | |
35 label: "Waterway Area", | |
36 props: p => p | |
37 }, | |
38 distance_marks_geoserver: { | |
39 label: "Distance Mark", | |
40 props: p => p | |
41 }, | |
42 waterway_axis: { | |
43 label: "Waterway Axis", | |
44 props: p => { | |
45 if (p.key === "objnam") p.key = "Name"; | |
46 return p; | |
47 } | |
48 }, | |
49 waterway_profiles: { | |
50 label: "Waterway Profile", | |
51 props: p => { | |
52 if (p.key === "staging_done") p.val = p.val ? "yes" : "no"; | |
53 if (p.key === "date_info") { | |
54 p.key = "Date info"; | |
55 p.val = new Date(p.val).toLocaleString(); | |
56 } | |
57 | |
58 // remove certain props | |
59 let propsToRemove = []; | |
60 if (propsToRemove.indexOf(p.key) !== -1) return null; | |
61 | |
62 return p; | |
63 } | |
64 } | |
65 }; | |
66 | |
67 export { formatter }; |