Mercurial > gemma
annotate client/src/components/staging/StagingDetail.vue @ 2107:6747a4cf3639
staging: zoom to Stretch implemented
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 04 Feb 2019 16:00:02 +0100 |
parents | c9af355d4a2c |
children | cac5d2fba591 |
rev | line source |
---|---|
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
2 <div :class="detail"> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
3 <div class="d-flex flex-row"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
4 <div class="mt-auto d-flex flex-row mb-auto small name text-left"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
5 <a |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
6 v-if="isSoundingResult(data.kind.toUpperCase())" |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
7 @click="zoomTo()" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
8 href="#" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
9 >{{ data.summary.bottleneck }}</a |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
10 > |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
11 <span v-if="isBottleneck(data.kind.toUpperCase())" class="text-left" |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
12 ><translate>Bottlenecks</translate> ({{ |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
13 data.summary.bottlenecks.length |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
14 }})</span |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
15 > |
2028
a8d8e855cb26
staging. FD added source-organization and LOS as name for entry
Thomas Junk <thomas.junk@intevation.de>
parents:
1891
diff
changeset
|
16 <span v-if="isFairwayDimension(data.kind.toUpperCase())" |
a8d8e855cb26
staging. FD added source-organization and LOS as name for entry
Thomas Junk <thomas.junk@intevation.de>
parents:
1891
diff
changeset
|
17 >{{ data.summary["source-organization"] }} (LOS: |
a8d8e855cb26
staging. FD added source-organization and LOS as name for entry
Thomas Junk <thomas.junk@intevation.de>
parents:
1891
diff
changeset
|
18 {{ data.summary.los }})</span |
a8d8e855cb26
staging. FD added source-organization and LOS as name for entry
Thomas Junk <thomas.junk@intevation.de>
parents:
1891
diff
changeset
|
19 > |
2107
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
20 <a |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
21 href="#" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
22 @click="zoomToStretch(data.summary.stretch)" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
23 v-if="isStretch(data.kind.toUpperCase())" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
24 >{{ data.summary.stretch }}</a |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
25 > |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
26 </div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
27 <div class="mt-auto mb-auto small text-left type"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
28 {{ data.kind.toUpperCase() }} |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
29 </div> |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
30 <div v-if="data.summary" class="mt-auto mb-auto small text-left date"> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
31 {{ formatSurveyDate(data.summary.date) }} |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
32 </div> |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
33 <div v-else class="mt-auto mb-auto small text-left date">-</div> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
34 <div class="mt-auto mb-auto small text-left imported"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
35 {{ formatSurveyDate(data.enqueued.split("T")[0]) }} |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
36 </div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
37 <div class="mt-auto mb-auto small text-left username"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
38 {{ data.user }} |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
39 </div> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
40 <div class="controls d-flex flex-row justify-content-end"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
41 <div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
42 <button |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
43 :class="{ |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
44 'ml-3': true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
45 'mr-3': true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
46 btn: true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
47 'btn-sm': true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
48 'btn-outline-success': needsApproval(data) || isRejected(data), |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
49 'btn-success': isApproved(data) |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
50 }" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
51 @click="toggleApproval(data.id, $options.STATES.APPROVED)" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
52 > |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
53 <font-awesome-icon icon="check"></font-awesome-icon> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
54 </button> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
55 </div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
56 <div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
57 <button |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
58 :class="{ |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
59 'mr-3': true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
60 btn: true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
61 'btn-sm': true, |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
62 'btn-outline-danger': needsApproval(data) || isApproved(data), |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
63 'btn-danger': isRejected(data) |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
64 }" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
65 @click="toggleApproval(data.id, $options.STATES.REJECTED)" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
66 > |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
67 <font-awesome-icon icon="times"></font-awesome-icon> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
68 </button> |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
69 </div> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
70 <div v-if="isBottleneck(data.kind.toUpperCase())"> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
71 <div |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
72 @click="showDetails()" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
73 class="mt-auto mb-auto text-info text-left" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
74 > |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
75 <font-awesome-icon |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
76 v-if="show" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
77 icon="angle-up" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
78 fixed-width |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
79 ></font-awesome-icon> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
80 <font-awesome-icon |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
81 v-if="loading" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
82 icon="spinner" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
83 fixed-width |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
84 ></font-awesome-icon> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
85 <font-awesome-icon |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
86 v-if="!show && !loading" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
87 icon="angle-down" |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
88 fixed-width |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
89 ></font-awesome-icon> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
90 </div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
91 </div> |
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
92 <div v-else class="empty"></div> |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
93 </div> |
1621
eeddc5dcb80c
staging now with details
Thomas Junk <thomas.junk@intevation.de>
parents:
1620
diff
changeset
|
94 </div> |
2107
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
95 <div v-if="show && bottlenecks.length > 0"> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
96 <div |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
97 v-for="(bottleneck, index) in bottlenecks" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
98 :key="index" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
99 class="d-flex flex-row" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
100 > |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
101 <div class="d-flex flex-column"> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
102 <div class="d-flex flex-row"> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
103 <a @click="moveToBottleneck(index)" class="small" href="#">{{ |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
104 bottleneck.properties.objnam |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
105 }}</a> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
106 <div |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
107 @click="showFull = !showFull" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
108 class="small mt-auto mb-auto text-info text-left" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
109 > |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
110 <font-awesome-icon |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
111 v-if="showFull" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
112 icon="angle-up" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
113 fixed-width |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
114 ></font-awesome-icon> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
115 <font-awesome-icon |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
116 v-if="!showFull" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
117 icon="angle-down" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
118 fixed-width |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
119 ></font-awesome-icon> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
120 </div> |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
121 </div> |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
122 |
2107
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
123 <div class="d-flex flex-row" v-if="showFull"> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
124 <table> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
125 <tr |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
126 v-for="(info, index) in Object.keys(bottleneck.properties)" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
127 :key="index" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
128 class="mr-1 small text-muted" |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
129 > |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
130 <td class="condensed text-left">{{ info }}</td> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
131 <td class="condensed pl-3 text-left"> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
132 {{ bottleneck.properties[info] }} |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
133 </td> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
134 </tr> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
135 </table> |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
136 </div> |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
137 </div> |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
138 </div> |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
139 </div> |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
140 </div> |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
141 </template> |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
142 |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
143 <script> |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
144 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
145 * without warranty, see README.md and license for details. |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
146 * |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
147 * SPDX-License-Identifier: AGPL-3.0-or-later |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
148 * License-Filename: LICENSES/AGPL-3.0.txt |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
149 * |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
150 * Copyright (C) 2018 by via donau |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
151 * – Österreichische Wasserstraßen-Gesellschaft mbH |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
152 * Software engineering by Intevation GmbH |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
153 * |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
154 * Author(s): |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
155 * Thomas Junk <thomas.junk@intevation.de> |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
156 */ |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
157 |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
158 import { formatSurveyDate } from "@/lib/date.js"; |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
159 import { STATES } from "@/store/imports.js"; |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
160 import { HTTP } from "@/lib/http"; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
161 import { WFS } from "ol/format.js"; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
162 import { or as orFilter, equalTo as equalToFilter } from "ol/format/filter.js"; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
163 import { displayError } from "@/lib/errors.js"; |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
164 import { mapState } from "vuex"; |
1643
1fde2f48977b
fix: calculate center to zoom to via turfjs
Thomas Junk <thomas.junk@intevation.de>
parents:
1633
diff
changeset
|
165 import center from "@turf/center"; |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
166 |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
167 export default { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
168 name: "stagingdetail", |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
169 props: ["data"], |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
170 data() { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
171 return { |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
172 showFull: false, |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
173 show: false, |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
174 loading: false, |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
175 bottlenecks: [] |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
176 }; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
177 }, |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
178 mounted() { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
179 this.bottlenecks = []; |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
180 if (this.open) this.showDetails(); |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
181 }, |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
182 computed: { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
183 ...mapState("imports", ["importToReview"]), |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
184 open() { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
185 return this.importToReview == this.data.id; |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
186 }, |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
187 detail() { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
188 return [ |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
189 "pb-2", |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
190 "pt-2", |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
191 "d-flex", |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
192 "flex-column", |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
193 "w-100", |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
194 { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
195 highlight: this.open && this.needsApproval(this.data) |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
196 } |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
197 ]; |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
198 } |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
199 }, |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
200 watch: { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
201 open() { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
202 const { review } = this.$route.query; |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
203 if (review) { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
204 this.showDetails(); |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
205 } |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
206 } |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
207 }, |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
208 methods: { |
2107
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
209 zoomToStretch(name) { |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
210 this.$store |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
211 .dispatch("imports/loadStretch", name) |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
212 .then(response => { |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
213 if (response.data.features.length < 1) |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
214 throw new Error("no feaures found for: " + name); |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
215 const { coordinates } = center(response.data.features[0]).geometry; |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
216 this.moveMap(coordinates); |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
217 }) |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
218 .catch(error => { |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
219 console.log(error); |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
220 const { status, data } = error.response; |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
221 displayError({ |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
222 title: this.$gettext("Backend Error"), |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
223 message: `${status}: ${data.message || data}` |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
224 }); |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
225 }); |
6747a4cf3639
staging: zoom to Stretch implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2104
diff
changeset
|
226 }, |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
227 showDetails() { |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
228 if (this.data.kind.toUpperCase() !== "BN") return; |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
229 if (this.show) { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
230 this.show = false; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
231 return; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
232 } |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
233 if (this.bottlenecks.length > 0) { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
234 this.show = true; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
235 return; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
236 } |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
237 this.loading = true; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
238 const generateFilter = () => { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
239 const { bottlenecks } = this.data.summary; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
240 if (bottlenecks.length === 1) |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
241 return equalToFilter("bottleneck_id", bottlenecks[0]); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
242 const orExpressions = bottlenecks.map(x => { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
243 equalToFilter("bottleneck_id", x); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
244 }); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
245 return orFilter(...orExpressions); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
246 }; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
247 const filterExpression = generateFilter(); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
248 const bottleneckFeatureCollectionRequest = new WFS().writeGetFeature({ |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
249 srsName: "EPSG:4326", |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
250 featureNS: "gemma", |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
251 featurePrefix: "gemma", |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
252 featureTypes: ["bottlenecks"], |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
253 outputFormat: "application/json", |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
254 filter: filterExpression |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
255 }); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
256 HTTP.post( |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
257 "/internal/wfs", |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
258 new XMLSerializer().serializeToString( |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
259 bottleneckFeatureCollectionRequest |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
260 ), |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
261 { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
262 headers: { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
263 "X-Gemma-Auth": localStorage.getItem("token"), |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
264 "Content-type": "text/xml; charset=UTF-8" |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
265 } |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
266 } |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
267 ) |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
268 .then(response => { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
269 this.bottlenecks = response.data.features; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
270 this.show = true; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
271 this.loading = false; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
272 }) |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
273 .catch(error => { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
274 const { status, data } = error.response; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
275 displayError({ |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
276 title: this.$gettext("Backend Error"), |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
277 message: `${status}: ${data.message || data}` |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
278 }); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
279 }); |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
280 }, |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
281 isFairwayDimension(kind) { |
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
282 return kind === "FD"; |
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
283 }, |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
284 isBottleneck(kind) { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
285 return kind === "BN"; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
286 }, |
2103
404eae390298
make default errorfree
Thomas Junk <thomas.junk@intevation.de>
parents:
2102
diff
changeset
|
287 isStretch(kind) { |
404eae390298
make default errorfree
Thomas Junk <thomas.junk@intevation.de>
parents:
2102
diff
changeset
|
288 return kind === "ST"; |
404eae390298
make default errorfree
Thomas Junk <thomas.junk@intevation.de>
parents:
2102
diff
changeset
|
289 }, |
1891
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
290 isSoundingResult(kind) { |
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
291 return kind === "SR"; |
80d3ac4328fe
staging: fixed display of fd import
Thomas Junk <thomas.junk@intevation.de>
parents:
1650
diff
changeset
|
292 }, |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
293 formatSurveyDate(date) { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
294 return formatSurveyDate(date); |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
295 }, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
296 needsApproval(item) { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
297 return item.status === STATES.NEEDSAPPROVAL; |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
298 }, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
299 isRejected(item) { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
300 return item.status === STATES.REJECTED; |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
301 }, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
302 isApproved(item) { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
303 return item.status === STATES.APPROVED; |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
304 }, |
1633
f034371c5d11
refac: move to map in staging component resolves now via id
Thomas Junk <thomas.junk@intevation.de>
parents:
1625
diff
changeset
|
305 moveToBottleneck(index) { |
1643
1fde2f48977b
fix: calculate center to zoom to via turfjs
Thomas Junk <thomas.junk@intevation.de>
parents:
1633
diff
changeset
|
306 const { coordinates } = center(this.bottlenecks[index]).geometry; |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
307 this.moveMap(coordinates); |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
308 }, |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
309 moveMap(coordinates) { |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
310 this.$store.commit("map/moveMap", { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
311 coordinates: coordinates, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
312 zoom: 17, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
313 preventZoomOut: true |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
314 }); |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
315 }, |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
316 zoomTo() { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
317 const { lat, lon, bottleneck, date } = this.data.summary; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
318 const coordinates = [lat, lon]; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
319 this.moveMap(coordinates); |
1615
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
320 this.$store |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
321 .dispatch("bottlenecks/setSelectedBottleneck", bottleneck) |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
322 .then(() => { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
323 this.$store.commit("bottlenecks/setSelectedSurveyByDate", date); |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
324 }); |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
325 }, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
326 toggleApproval(id, newStatus) { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
327 this.$store.commit("imports/toggleApproval", { |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
328 id: id, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
329 newStatus: newStatus |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
330 }); |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
331 } |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
332 }, |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
333 STATES: STATES |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
334 }; |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
335 </script> |
95641748383f
refac: extracted staging details view
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
336 |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
337 <style lang="scss" scoped> |
1650
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
338 .highlight { |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
339 background-color: #f9f9f9; |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
340 } |
90211725e4a9
highlighing feature for staging area
Thomas Junk <thomas.junk@intevation.de>
parents:
1643
diff
changeset
|
341 |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
342 .condensed { |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
343 font-stretch: condensed; |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
344 } |
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
345 |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
346 .empty { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
347 margin-right: 20px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
348 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
349 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
350 .name { |
1625
de4e4dcb8f87
staging area: implemented details and zoom to bbox
Thomas Junk <thomas.junk@intevation.de>
parents:
1621
diff
changeset
|
351 width: 180px; |
1620
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
352 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
353 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
354 .date { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
355 width: 90px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
356 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
357 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
358 .type { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
359 width: 40px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
360 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
361 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
362 .imported { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
363 width: 90px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
364 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
365 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
366 .username { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
367 width: 150px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
368 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
369 |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
370 .controls { |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
371 width: 60px; |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
372 } |
2e4ec4251c57
refac: staging rebuilt with divs instead tables to accomplish detailsview
Thomas Junk <thomas.junk@intevation.de>
parents:
1615
diff
changeset
|
373 </style> |