Mercurial > gemma
annotate client/src/components/map/contextbox/Staging.vue @ 1516:6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 06 Dec 2018 13:40:17 +0100 |
parents | 53fdbe1d9678 |
children | b03db5726ca5 |
rev | line source |
---|---|
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
2 <div class="w-90 stagingcard"> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
3 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center"> |
1480 | 4 <font-awesome-icon |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
5 class="mr-2" |
1480 | 6 icon="clipboard-check" |
7 ></font-awesome-icon> | |
1406
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
8 <translate>Staging Area</translate> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
9 </h6> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
10 <table class="table"> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
11 <thead> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
12 <tr> |
1480 | 13 <th><translate>Name</translate></th> |
14 <th><translate>Type</translate></th> | |
15 <th><translate>Date</translate></th> | |
16 <th><translate>Imported</translate></th> | |
17 <th><translate>Username</translate></th> | |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
18 <th> </th> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
19 <th> </th> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
20 </tr> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
21 </thead> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
22 <tbody v-if="filteredData.length"> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
23 <tr :key="data.id" v-for="data in filteredData"> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
24 <td> |
1480 | 25 <a @click="zoomTo(data.id)" href="#">{{ |
26 data.summary.bottleneck | |
27 }}</a> | |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
28 </td> |
1393
efd77496de75
stagingarea: using summary in display
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
29 <td>{{ data.kind.toUpperCase() }}</td> |
efd77496de75
stagingarea: using summary in display
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
30 <td>{{ data.summary.date }}</td> |
efd77496de75
stagingarea: using summary in display
Thomas Junk <thomas.junk@intevation.de>
parents:
1365
diff
changeset
|
31 <td>{{ data.enqueued.split("T")[0] }}</td> |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
32 <td>{{ data.user }}</td> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
33 <td> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
34 <button |
1480 | 35 :class="{ |
36 btn: true, | |
37 'btn-sm': true, | |
38 'btn-outline-success': needsApproval(data) || isRejected(data), | |
39 'btn-success': isApproved(data) | |
40 }" | |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
41 @click="toggleApproval(data.id, $options.STATES.APPROVED)" |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
42 > |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
43 <font-awesome-icon icon="check"></font-awesome-icon> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
44 </button> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
45 </td> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
46 <td> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
47 <button |
1480 | 48 :class="{ |
49 btn: true, | |
50 'btn-sm': true, | |
51 'btn-outline-danger': needsApproval(data) || isApproved(data), | |
52 'btn-danger': isRejected(data) | |
53 }" | |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
54 @click="toggleApproval(data.id, $options.STATES.REJECTED)" |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
55 > |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
56 <font-awesome-icon icon="times"></font-awesome-icon> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
57 </button> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
58 </td> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
59 </tr> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
60 </tbody> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
61 <tbody v-else> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
62 <tr> |
1406
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
63 <td class="text-center" colspan="6"> |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
64 <translate>No results.</translate> |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
65 </td> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
66 </tr> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
67 </tbody> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
68 </table> |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
69 <div class="p-3" v-if="filteredData.length"> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
70 <button @click="confirmReview" class="confirm-button btn btn-info"> |
1406
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
71 <translate>Confirm</translate> |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
72 </button> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
73 </div> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
74 <div class="p-3"> |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
75 <button @click="loadData" class="refresh btn btn-dark">Refresh</button> |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
76 </div> |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
77 </div> |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
78 </template> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
80 <script> |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
81 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
82 * without warranty, see README.md and license for details. |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
83 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
84 * SPDX-License-Identifier: AGPL-3.0-or-later |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
85 * License-Filename: LICENSES/AGPL-3.0.txt |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
86 * |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
87 * Copyright (C) 2018 by via donau |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
88 * – Österreichische Wasserstraßen-Gesellschaft mbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
89 * Software engineering by Intevation GmbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
90 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
91 * Author(s): |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
92 * Thomas Junk <thomas.junk@intevation.de> |
1360
3fee649d3d5d
add headers for licensing to some client files
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1314
diff
changeset
|
93 * Markus Kottländer <markus@intevation.de> |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1276
diff
changeset
|
94 */ |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 import { mapState } from "vuex"; |
1468 | 96 import { HTTP } from "../../../lib/http.js"; |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
97 import { STATES } from "../../../store/imports.js"; |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
98 import { displayError, displayInfo } from "../../../lib/errors.js"; |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
99 |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
100 export default { |
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
101 data() { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
102 return {}; |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 }, |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
104 mounted() { |
1468 | 105 this.loadData(); |
1310
d675e6439aa5
staging view: prepare retrieving list of pending imports for staging
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
106 }, |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 computed: { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 ...mapState("application", ["searchQuery"]), |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
109 ...mapState("imports", ["staging"]), |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 filteredData() { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
111 return this.staging.filter(data => { |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
112 const result = [data.id + "", data.enqueued, data.kind, data.user].some( |
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
113 x => x.toLowerCase().includes(this.searchQuery.toLowerCase()) |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 ); |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
115 return result; |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 }); |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 }, |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1344
diff
changeset
|
119 STATES: STATES, |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 methods: { |
1468 | 121 loadData() { |
122 this.$store.dispatch("imports/getStaging").catch(error => { | |
123 const { status, data } = error.response; | |
124 displayError({ | |
125 title: "Backend Error", | |
126 message: `${status}: ${data.message || data}` | |
127 }); | |
128 }); | |
129 }, | |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
130 confirmReview() { |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
131 const reviewResults = this.staging |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
132 .filter(x => x.status !== STATES.NEEDSAPPROVAL) |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
133 .map(r => { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
134 return { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
135 id: r.id, |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
136 state: r.status |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
137 }; |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
138 }); |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
139 if (!reviewResults.length) return; |
1468 | 140 HTTP.patch("/imports", reviewResults, { |
141 headers: { | |
142 "X-Gemma-Auth": localStorage.getItem("token"), | |
143 "Content-type": "application/json" | |
144 } | |
145 }) | |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
146 .then(response => { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
147 const messages = response.data |
1468 | 148 .map(x => { |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
149 if (x.message) return x.message; |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
150 if (x.error) return x.error; |
1468 | 151 }) |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
152 .join("\n\n"); |
1468 | 153 displayInfo({ |
154 title: "Staging Area", | |
1475
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
155 message: messages, |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
156 options: { |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
157 timeout: 0, |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
158 buttons: [{ text: "Ok", action: null, bold: true }] |
2365acde39dc
Staging area: Dealing with backend response.
Thomas Junk <thomas.junk@intevation.de>
parents:
1468
diff
changeset
|
159 } |
1468 | 160 }); |
161 this.loadData(); | |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
162 }) |
1468 | 163 .catch(error => { |
164 const { status, data } = error.response; | |
165 displayError({ | |
166 title: "Backend Error", | |
167 message: `${status}: ${data.message || data}` | |
168 }); | |
169 }); | |
1311
d5eda9f79610
staging: display visual feedback for now due missing backendcall
Thomas Junk <thomas.junk@intevation.de>
parents:
1310
diff
changeset
|
170 }, |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
171 needsApproval(item) { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
172 return item.status === STATES.NEEDSAPPROVAL; |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
173 }, |
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
174 isRejected(item) { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
175 return item.status === STATES.REJECTED; |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
176 }, |
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
177 isApproved(item) { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
178 return item.status === STATES.APPROVED; |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
179 }, |
1406
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
180 zoomTo(id) { |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
181 if (!id) return; |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
182 const soundingResult = this.filteredData.filter(x => x.id == id)[0]; |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
183 const { lat, lon, bottleneck, date } = soundingResult.summary; |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
184 const coordinates = [lat, lon]; |
9d2806002f50
staging: activate according soundingresult
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
185 |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 this.$store.commit("map/moveMap", { |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 coordinates: coordinates, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 zoom: 17, |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 preventZoomOut: true |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 }); |
1516
6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
Thomas Junk <thomas.junk@intevation.de>
parents:
1511
diff
changeset
|
191 this.$store |
6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
Thomas Junk <thomas.junk@intevation.de>
parents:
1511
diff
changeset
|
192 .dispatch("bottlenecks/setSelectedBottleneck", bottleneck) |
6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
Thomas Junk <thomas.junk@intevation.de>
parents:
1511
diff
changeset
|
193 .then(() => { |
6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
Thomas Junk <thomas.junk@intevation.de>
parents:
1511
diff
changeset
|
194 this.$store.commit("bottlenecks/setSelectedSurveyByDate", date); |
6b3756676bbe
refac: bottlenecks and surveydata are now retrieved via promises
Thomas Junk <thomas.junk@intevation.de>
parents:
1511
diff
changeset
|
195 }); |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
196 }, |
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
197 toggleApproval(id, newStatus) { |
1344
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
198 this.$store.commit("imports/toggleApproval", { |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
199 id: id, |
eda98694e678
staging: retrieve real data instead of displaying demodata
Thomas Junk <thomas.junk@intevation.de>
parents:
1314
diff
changeset
|
200 newStatus: newStatus |
1290
ad528ad130d6
staging area: basic layout and selectionlogic
Thomas Junk <thomas.junk@intevation.de>
parents:
1279
diff
changeset
|
201 }); |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
203 } |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 }; |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
205 </script> |
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 |
1449 | 207 <style lang="scss" scoped> |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
208 .refresh { |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
209 position: absolute; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
210 left: $offset; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
211 bottom: $offset; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
212 } |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
213 .table th, |
1449 | 214 td { |
215 font-size: 0.9rem; | |
216 border-top: 0px !important; | |
217 border-bottom-width: 1px; | |
218 text-align: left; | |
219 padding: 0.5rem !important; | |
220 } | |
1503
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
221 |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
222 .stagingcard { |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
223 position: relative; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
224 min-height: 150px; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
225 } |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
226 |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
227 .confirm-button { |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
228 position: absolute; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
229 right: $offset; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
230 bottom: $offset; |
b76b23b3df61
staging-area: added refresh button
Thomas Junk <thomas.junk@intevation.de>
parents:
1480
diff
changeset
|
231 } |
1276
aec9ed491dad
more cleanup in client/src
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
232 </style> |