Mercurial > gemma
annotate client/src/components/ImportSoundingresults.vue @ 1599:5e16d1fbe91f
WFS Capabilities parser: Parse constraints, too.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 17 Dec 2018 11:13:11 +0100 |
parents | 0ded4c56978e |
children | 38f91897ca69 |
rev | line source |
---|---|
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
2 <div> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
3 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
4 <font-awesome-icon icon="upload" class="mr-2"></font-awesome-icon> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
5 <translate>Import Soundingresults</translate> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
6 </h6> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
7 <div v-if="editState" class="ml-auto mr-auto mt-4 w-95"> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
8 <div class="d-flex flex-column"> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
9 <div class="d-flex flex-row"> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
10 <div class="mt-1 text-left w-50 ml-2 mr-4"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
11 <small class="text-muted"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
12 <translate>Bottleneck</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
13 </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
14 <select v-model="bottleneck" class="custom-select"> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
15 <option |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
16 v-for="bottleneck in availableBottlenecks" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
17 :key="bottleneck" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
18 >{{ bottleneck }}</option |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
19 > |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
20 </select> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
21 <span class="text-danger"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
22 <small v-if="!bottleneck"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
23 <translate>Please select a bottleneck</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
24 </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
25 </span> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
26 </div> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
27 <div class="d-flex flex-column mt-1 text-left w-50 mr-2"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
28 <small class="text-muted"> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
29 <translate>Projection</translate> (EPSG) |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
30 </small> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
31 <input |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
32 class="form-control" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
33 v-model="projection" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
34 value="4326" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
35 placeholder="e.g. 4326" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
36 type="number" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
37 /> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
38 <span class="text-left text-danger"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
39 <small v-if="!projection"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
40 <translate>Please enter a projection</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
41 </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
42 </span> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
43 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
44 </div> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
45 <div class="d-flex flex-row"> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
46 <div class="mt-1 text-left w-50 ml-2 mr-4"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
47 <small class="text-muted"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
48 <translate>Depthreference</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
49 </small> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
50 <select |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
51 v-model="depthReference" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
52 class="custom-select" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
53 id="depthreference" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
54 > |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
55 <option |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
56 v-for="option in this.$options.depthReferenceOptions" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
57 :key="option" |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
58 >{{ option }}</option |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
59 > |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
60 </select> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
61 <span class="text-left text-danger"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
62 <small v-if="!depthReference"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
63 <translate>Please enter a reference</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
64 </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
65 </span> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
66 </div> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
67 <div class="mt-1 text-left w-50 mr-2"> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
68 <small class="text-muted"> <translate>Date</translate> </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
69 <input |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
70 id="importdate" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
71 type="date" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
72 class="form-control" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
73 placeholder="Date of import" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
74 aria-label="bottleneck" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
75 aria-describedby="bottlenecklabel" |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
76 v-model="importDate" |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
77 /> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
78 <span class="text-left text-danger"> |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
79 <small v-if="!importDate"> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
80 <translate>Please enter a date</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
81 </small> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
82 </span> |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
83 </div> |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
84 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
85 </div> |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
86 <div class="ml-2 mt-2 text-left"> |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
87 <small v-for="(message, index) in messages" :key="index"> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
88 {{ message }} |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
89 </small> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
90 </div> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
91 </div> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
92 <div class="w-95 ml-auto mr-auto mt-4 mb-4"> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
93 <div v-if="uploadState" class="d-flex flex-row input-group mb-4"> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
94 <div class="custom-file"> |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
95 <input |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
96 accept=".zip" |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
97 type="file" |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
98 @change="fileSelected" |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
99 class="custom-file-input" |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
100 id="uploadFile" |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
101 /> |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
102 <label class="custom-file-label" for="uploadFile"> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
103 {{ uploadLabel }} |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
104 </label> |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
106 </div> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
107 <div class="buttons text-right"> |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
108 <a |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
109 v-if="editState" |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
110 download="meta.json" |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
111 :href="dataLink" |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
112 class="btn btn-outline-info pull-left" |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
113 > |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
114 <translate>Download Meta.json</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
115 </a> |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
116 <button |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
117 v-if="editState" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
118 @click="deleteTempData" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
119 class="btn btn-danger" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
120 type="button" |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
121 > |
1412
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
122 <translate>Cancel Upload</translate> |
15c3672e2e86
translations readded
Thomas Junk <thomas.junk@intevation.de>
parents:
1405
diff
changeset
|
123 </button> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
124 <button |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
125 :disabled="disableUploadButton" |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
126 @click="submit" |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
127 class="btn btn-info" |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
128 type="button" |
1464
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
129 > |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
130 {{ uploadState ? Upload : Confirm }} |
4af7eaca44a1
feat: Import Sounding results
Thomas Junk <thomas.junk@intevation.de>
parents:
1449
diff
changeset
|
131 </button> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
132 </div> |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
133 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
134 </div> |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
135 </template> |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
136 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
137 <script> |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
138 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
139 * without warranty, see README.md and license for details. |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
140 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
141 * SPDX-License-Identifier: AGPL-3.0-or-later |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
142 * License-Filename: LICENSES/AGPL-3.0.txt |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
143 * |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1348
diff
changeset
|
144 * Copyright (C) 2018 by via donau |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
145 * – Österreichische Wasserstraßen-Gesellschaft mbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
146 * Software engineering by Intevation GmbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
147 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
148 * Author(s): |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
149 * Thomas Junk <thomas.junk@intevation.de> |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
150 * Markus Kottländer <markus.kottlaender@intevation.de> |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
151 */ |
1558
0ded4c56978e
refac: component filestructure. remove admin/map hierarchy
Thomas Junk <thomas.junk@intevation.de>
parents:
1464
diff
changeset
|
152 import { HTTP } from "../lib/http"; |
0ded4c56978e
refac: component filestructure. remove admin/map hierarchy
Thomas Junk <thomas.junk@intevation.de>
parents:
1464
diff
changeset
|
153 import { displayError, displayInfo } from "../lib/errors.js"; |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
154 import { mapState } from "vuex"; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
156 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 export default { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 name: "imports", |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
160 data() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
161 return { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
162 importState: IMPORTSTATE.UPLOAD, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
163 depthReference: "", |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
164 bottleneck: "", |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
165 projection: "", |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
166 importDate: "", |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
167 uploadLabel: this.$gettext("choose .zip- file"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
168 uploadFile: null, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
169 disableUpload: false, |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
170 token: null, |
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
171 messages: [] |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
172 }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
173 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
174 methods: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
175 initialState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
176 this.importState = IMPORTSTATE.UPLOAD; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 this.depthReference = ""; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 this.bottleneck = ""; |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
179 this.projection = ""; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 this.importDate = ""; |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
181 this.uploadLabel = this.$gettext("choose .zip- file"); |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 this.uploadFile = null; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 this.disableUpload = false; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 this.token = null; |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
185 this.messages = []; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
186 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 fileSelected(e) { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
188 const files = e.target.files || e.dataTransfer.files; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 if (!files) return; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 this.uploadLabel = files[0].name; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
191 this.uploadFile = files[0]; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
192 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
193 deleteTempData() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 HTTP.delete("/imports/soundingresult-upload/" + this.token, { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 headers: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
196 "X-Gemma-Auth": localStorage.getItem("token") |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
197 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
198 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
199 .then(() => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
200 this.initialState(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
203 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
204 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
205 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
206 message: `${status}: ${data.message || data}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
207 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
208 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
209 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
210 submit() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
211 if (!this.uploadFile || this.disableUpload) return; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
212 if (this.importState === IMPORTSTATE.UPLOAD) { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
213 this.upload(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
214 } else { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 this.confirm(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
216 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
217 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
218 upload() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
219 let formData = new FormData(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
220 formData.append("soundingresult", this.uploadFile); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
221 HTTP.post("/imports/soundingresult-upload", formData, { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
222 headers: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
223 "X-Gemma-Auth": localStorage.getItem("token"), |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
224 "Content-Type": "multipart/form-data" |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
225 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
226 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
227 .then(response => { |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
228 if (response.data.meta) { |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
229 const { bottleneck, date, epsg } = response.data.meta; |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
230 const depthReference = response.data.meta["depth-reference"]; |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
231 this.bottleneck = bottleneck; |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
232 this.depthReference = depthReference; |
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
233 this.importDate = new Date(date).toISOString().split("T")[0]; |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
234 this.projection = epsg; |
1352
58113365c51d
Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents:
1350
diff
changeset
|
235 } |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
236 this.importState = IMPORTSTATE.EDIT; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
237 this.token = response.data.token; |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
238 this.messages = response.data.messages; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
239 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
240 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
241 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
242 const messages = data.messages ? data.messages.join(", ") : ""; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
243 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
244 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 message: `${status}: ${messages}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
247 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
248 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
249 confirm() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
250 let formData = new FormData(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
251 formData.append("token", this.token); |
1309
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
252 if (this.bottleneck) formData.append("bottleneck", this.bottleneck); |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
253 if (this.importDate) |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
254 formData.append("date", this.importDate.split("T")[0]); |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
255 if (this.depthReference) |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
256 formData.append("depth-reference", this.depthReference); |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
257 if (this.projection) formData.append("", this.projection); |
1309
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
258 |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
259 HTTP.post("/imports/soundingresult", formData, { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
260 headers: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 "X-Gemma-Auth": localStorage.getItem("token"), |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
262 "Content-Type": "multipart/form-data" |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
263 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
264 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
265 .then(() => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 displayInfo({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
267 title: this.$gettext("Import"), |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
268 message: this.$gettext("Starting import for ") + this.bottleneck |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 this.initialState(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
271 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
272 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
275 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
276 message: `${status}: ${data.message || data}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
277 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
278 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
279 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
280 }, |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
281 mounted() { |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
282 this.$store.dispatch("bottlenecks/loadBottlenecks"); |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
283 }, |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
284 watch: { |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
285 showContextBox() { |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
286 if (!this.showContextBox && this.token) this.deleteTempData(); |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
287 } |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
288 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 computed: { |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
290 ...mapState("application", ["showContextBox"]), |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
291 ...mapState("bottlenecks", ["bottlenecks"]), |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
292 disableUploadButton() { |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
293 if (this.importState === IMPORTSTATE.UPLOAD) return this.disableUpload; |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
294 if ( |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
295 !this.bottleneck || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
296 !this.importDate || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
297 !this.depthReference || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
298 !this.projection |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
299 ) |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
300 return true; |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
301 return this.disableUpload; |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
302 }, |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
303 availableBottlenecks() { |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
304 return this.bottlenecks.map(x => x.properties.name); |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
305 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
306 editState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 return this.importState === IMPORTSTATE.EDIT; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
308 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
309 uploadState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
310 return this.importState === IMPORTSTATE.UPLOAD; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
311 }, |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
312 Upload() { |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
313 return this.$gettext("Upload"); |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
314 }, |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
315 Confirm() { |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
316 return this.$gettext("Confirm"); |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
317 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
318 dataLink() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
319 return ( |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
320 "data:text/json;charset=utf-8," + |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
321 encodeURIComponent( |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
322 JSON.stringify({ |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
323 depthReference: this.depthReference, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
324 bottleneck: this.bottleneck, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
325 date: this.importDate |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
326 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
327 ) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
328 ); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
329 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
330 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
331 depthReferenceOptions: [ |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
332 "", |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
333 // "NAP", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
334 // "KP", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
335 // "FZP", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
336 // "ADR", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
337 // "TAW", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
338 // "PUL", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
339 // "NGM", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
340 // "ETRS", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
341 // "POT", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
342 // "LDC", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
343 // "HDC", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
344 // "ZPG", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
345 // "GLW", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
346 // "HSW", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
347 // "LNW", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
348 // "HNW", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
349 // "IGN", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
350 // "WGS", |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
351 "RN" //, |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
352 // "HBO" |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
353 ] |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
354 }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
355 </script> |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
356 |
1449 | 357 <style lang="scss" scoped> |
358 .projectionLabel { | |
359 margin-left: $small-offset; | |
360 } | |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
361 |
1449 | 362 .depthreferencelabel { |
363 margin-left: $small-offset; | |
364 } | |
1285
f674ce380de1
layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents:
1281
diff
changeset
|
365 |
1449 | 366 .offset-r { |
367 margin-right: $small-offset; | |
368 } | |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
369 |
1449 | 370 .buttons button { |
371 margin-left: $offset !important; | |
372 } | |
373 | |
374 .label-text { | |
375 width: 5rem; | |
376 text-align: left; | |
377 line-height: 2.25rem; | |
378 } | |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
379 </style> |