Mercurial > gemma
annotate client/src/components/importconfiguration/types/Soundingresults.vue @ 3013:30222bcbfec9
import_configuration: add email option to onetime imports
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 11 Apr 2019 14:37:13 +0200 |
parents | 1b8bb4f89227 |
children | cb3b31566e48 |
rev | line source |
---|---|
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
2 <div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
3 <div v-if="editState" class="mb-3"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
4 <div |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
5 v-for="(message, index) in messages" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
6 :key="index" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
7 class="alert alert-warning small rounded-0" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
8 > |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
9 {{ message }} |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
10 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
11 <div class="d-flex flex-row w-100"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
12 <div class="w-50 mr-2 text-left"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
13 <small class="text-muted"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
14 <translate>Bottleneck</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
15 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
16 <select v-model="bottleneck" class="custom-select"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
17 <option |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
18 v-for="bottleneck in availableBottlenecks" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
19 :value="bottleneck" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
20 :key="bottleneck.properties.objnam" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
21 > |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
22 {{ bottleneck.properties.objnam }} |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
23 </option> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
24 </select> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
25 <span class="text-danger"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
26 <small v-if="!bottleneck"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
27 <translate>Please select a bottleneck</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
28 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
29 </span> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
30 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
31 <div class="w-50 ml-3 text-left"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
32 <small class="text-muted"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
33 <translate>Projection</translate> (EPSG) |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
34 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
35 <input |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
36 class="form-control" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
37 v-model="projection" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
38 value="4326" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
39 placeholder="e.g. 4326" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
40 type="number" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
41 /> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
42 <span class="text-left text-danger"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
43 <small v-if="!projection"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
44 <translate>Please enter a projection</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
45 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
46 </span> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
47 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
48 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
49 <div class="d-flex flex-row w-100 mt-3"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
50 <div class="w-50 mr-2 text-left"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
51 <small class="text-muted"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
52 <translate>Depthreference</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
53 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
54 <select |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
55 v-model="depthReference" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
56 class="custom-select" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
57 id="depthreference" |
2432
851c904416f6
client: import soundingresults: html cleanup
Markus Kottlaender <markus@intevation.de>
parents:
2414
diff
changeset
|
58 > |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
59 <option |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
60 v-for="option in this.depthReferenceOptions" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
61 :key="option" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
62 >{{ option }}</option |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
63 > |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
64 </select> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
65 <span class="text-left text-danger"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
66 <small v-if="!depthReference"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
67 <translate>Please enter a reference</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
68 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
69 </span> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
70 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
71 <div class="w-50 ml-3 text-left"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
72 <small class="text-muted"> <translate>Date</translate> </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
73 <input |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
74 id="importdate" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
75 type="date" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
76 class="form-control" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
77 placeholder="Date of import" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
78 aria-label="bottleneck" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
79 aria-describedby="bottlenecklabel" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
80 v-model="importDate" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
81 /> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
82 <span class="text-left text-danger"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
83 <small v-if="!importDate"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
84 <translate>Please enter a date</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
85 </small> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
86 </span> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
87 </div> |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
88 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
89 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
90 <div class="mt-3"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
91 <div v-if="uploadState" class="input-group"> |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
92 <div :key="1" class="flex-column mr-4"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
93 <div class="flex-row text-left"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
94 <small class="text-muted"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
95 <translate>Email Notification</translate> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
96 </small> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
97 </div> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
98 <div class="flex-flex-row text-left"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
99 <toggle-button |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
100 v-model="eMailNotification" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
101 class="mt-2" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
102 :speed="100" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
103 :labels="{ |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
104 checked: this.$options.on, |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
105 unchecked: this.$options.off |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
106 }" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
107 :width="60" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
108 :height="30" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
109 /> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
110 </div> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
111 </div> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
112 <div class="custom-file mt-4"> |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
113 <input |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
114 accept=".zip" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
115 type="file" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
116 @change="fileSelected" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
117 class="custom-file-input" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
118 id="uploadFile" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
119 /> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
120 <label class="pointer custom-file-label" for="uploadFile"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
121 {{ uploadLabel }} |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
122 </label> |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
123 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
124 </div> |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
125 <div class="d-flex justify-content-between mt-3" v-if="editState"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
126 <a |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
127 download="meta.json" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
128 :href="dataLink" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
129 :class="[ |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
130 'btn btn-outline-info', |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
131 { disabled: !bottleneck || !importDate || !depthReference } |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
132 ]" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
133 > |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
134 <translate>Download Meta.json</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
135 </a> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
136 <span> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
137 <button |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
138 :disabled="disableUploadButton" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
139 @click="confirm" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
140 class="btn btn-info mr-2" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
141 type="button" |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
142 > |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
143 <translate>Confirm</translate> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
144 </button> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
145 <button :key="1" @click="deleteTempData()" class="btn btn-warning"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
146 Back |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
147 </button> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
148 </span> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
149 </div> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
150 <div v-if="uploadState" class="d-flex flex-row-100 mt-3"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
151 <button :key="2" @click="back()" class="ml-auto btn btn-warning"> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
152 Back |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
153 </button> |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
154 </div> |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
155 </div> |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
156 </div> |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
157 </template> |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
158 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
159 <script> |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
160 /* 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
|
161 * without warranty, see README.md and license for details. |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
162 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
163 * SPDX-License-Identifier: AGPL-3.0-or-later |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
164 * License-Filename: LICENSES/AGPL-3.0.txt |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
165 * |
1350
58d41573e530
staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents:
1348
diff
changeset
|
166 * Copyright (C) 2018 by via donau |
1279
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
167 * – Österreichische Wasserstraßen-Gesellschaft mbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
168 * Software engineering by Intevation GmbH |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
169 * |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
170 * Author(s): |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
171 * Thomas Junk <thomas.junk@intevation.de> |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
172 * Markus Kottländer <markus.kottlaender@intevation.de> |
60e15c2d26a2
licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents:
1278
diff
changeset
|
173 */ |
1613
f2d24dceecc7
refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents:
1607
diff
changeset
|
174 import { HTTP } from "@/lib/http"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2978
diff
changeset
|
175 import { displayError, displayInfo } from "@/lib/errors"; |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
176 import { mapState } from "vuex"; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
177 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
178 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
179 |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
180 export default { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
181 data() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
182 return { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
183 importState: IMPORTSTATE.UPLOAD, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
184 depthReference: "", |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
185 bottleneck: "", |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
186 projection: "", |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
187 importDate: "", |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
188 uploadLabel: this.$gettext("choose .zip- file"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
189 uploadFile: null, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
190 disableUpload: false, |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
191 token: null, |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
192 messages: [], |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
193 eMailNotification: false |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
194 }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
195 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
196 methods: { |
2977
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
197 back() { |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
198 this.$store.commit("importschedule/setListMode"); |
ab26fb7a76f6
unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
199 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
200 initialState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
201 this.importState = IMPORTSTATE.UPLOAD; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
202 this.depthReference = ""; |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
203 this.bottleneck = null; |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
204 this.projection = ""; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
205 this.importDate = ""; |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
206 this.uploadLabel = this.$gettext("choose .zip- file"); |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
207 this.uploadFile = null; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
208 this.disableUpload = false; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
209 this.token = null; |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
210 this.eMailNotification = false; |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
211 this.messages = []; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
212 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
213 fileSelected(e) { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
214 const files = e.target.files || e.dataTransfer.files; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
215 if (!files) return; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
216 this.uploadLabel = files[0].name; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
217 this.uploadFile = files[0]; |
2349
2e57fd9b4f3a
client: imports: removed upload button from soundingresults import and trigger upload automatically
Markus Kottlaender <markus@intevation.de>
parents:
2294
diff
changeset
|
218 this.upload(); |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
219 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
220 deleteTempData() { |
2294
b2de7a77b570
import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents:
2154
diff
changeset
|
221 HTTP.delete("/imports/sr-upload/" + this.token, { |
1278
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 } |
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 .then(() => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
227 this.initialState(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
228 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
229 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
230 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
231 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
232 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
233 message: `${status}: ${data.message || data}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
234 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
235 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
236 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
237 upload() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
238 let formData = new FormData(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
239 formData.append("soundingresult", this.uploadFile); |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
240 if (this.eMailNotification) { |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
241 formData.append("send-email", this.eMailNotification); |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
242 } |
2294
b2de7a77b570
import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents:
2154
diff
changeset
|
243 HTTP.post("/imports/sr-upload", formData, { |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
244 headers: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
245 "X-Gemma-Auth": localStorage.getItem("token"), |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
246 "Content-Type": "multipart/form-data" |
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 .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
|
250 if (response.data.meta) { |
1405
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
251 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
|
252 const depthReference = response.data.meta["depth-reference"]; |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
253 this.bottleneck = this.bottlenecks.find( |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
254 bn => bn.properties.objnam === bottleneck |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
255 ); |
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
|
256 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
|
257 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
|
258 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
|
259 } |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
260 this.importState = IMPORTSTATE.EDIT; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
261 this.token = response.data.token; |
1302
3c10c868cba7
import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents:
1299
diff
changeset
|
262 this.messages = response.data.messages; |
1278
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 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
265 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
266 const messages = data.messages ? data.messages.join(", ") : ""; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
267 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
268 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
269 message: `${status}: ${messages}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
270 }); |
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 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
273 confirm() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
274 let formData = new FormData(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
275 formData.append("token", this.token); |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
276 if (this.bottleneck) |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
277 formData.append("bottleneck", this.bottleneck.properties.objnam); |
1309
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
278 if (this.importDate) |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
279 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
|
280 if (this.depthReference) |
3c91930367ee
import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1308
diff
changeset
|
281 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
|
282 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
|
283 |
2294
b2de7a77b570
import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents:
2154
diff
changeset
|
284 HTTP.post("/imports/sr", formData, { |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
285 headers: { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
286 "X-Gemma-Auth": localStorage.getItem("token"), |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
287 "Content-Type": "multipart/form-data" |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
288 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
289 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
290 .then(() => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
291 displayInfo({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
292 title: this.$gettext("Import"), |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
293 message: |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
294 this.$gettext("Starting import for ") + |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
295 this.bottleneck.properties.objnam |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
296 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
297 this.initialState(); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
298 }) |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
299 .catch(error => { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
300 const { status, data } = error.response; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
301 displayError({ |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
302 title: this.$gettext("Backend Error"), |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
303 message: `${status}: ${data.message || data}` |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
304 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
305 }); |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
306 } |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
307 }, |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
308 mounted() { |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
309 this.$store.dispatch("bottlenecks/loadBottlenecks"); |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
310 }, |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
311 watch: { |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
312 showContextBox() { |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
313 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
|
314 } |
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
315 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
316 computed: { |
1348
c539cb678c5b
import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents:
1309
diff
changeset
|
317 ...mapState("application", ["showContextBox"]), |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
318 ...mapState("bottlenecks", ["bottlenecks"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
319 importSoundingresultsLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
320 return this.$gettext("Import Soundingresults"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
321 }, |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
322 disableUploadButton() { |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
323 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
|
324 if ( |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
325 !this.bottleneck || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
326 !this.importDate || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
327 !this.depthReference || |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
328 !this.projection |
522488564de0
import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents:
1402
diff
changeset
|
329 ) |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
330 return true; |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
331 return this.disableUpload; |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
332 }, |
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
333 availableBottlenecks() { |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
334 return this.bottlenecks; |
1357
f3bcce4e6f22
import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents:
1352
diff
changeset
|
335 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
336 editState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
337 return this.importState === IMPORTSTATE.EDIT; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
338 }, |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
339 uploadState() { |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
340 return this.importState === IMPORTSTATE.UPLOAD; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
341 }, |
1441
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
342 Upload() { |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
343 return this.$gettext("Upload"); |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
344 }, |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
345 Confirm() { |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
346 return this.$gettext("Confirm"); |
a4554e942954
Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1412
diff
changeset
|
347 }, |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
348 dataLink() { |
2445
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
349 if (this.bottleneck && this.depthReference && this.import) { |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
350 return ( |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
351 "data:text/json;charset=utf-8," + |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
352 encodeURIComponent( |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
353 JSON.stringify({ |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
354 depthReference: this.depthReference, |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
355 bottleneck: this.bottleneck.properties.objnam, |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
356 date: this.importDate |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
357 }) |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
358 ) |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
359 ); |
e0f423606929
client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents:
2438
diff
changeset
|
360 } |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
361 }, |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
362 depthReferenceOptions() { |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
363 if ( |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
364 this.bottleneck && |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
365 this.bottleneck.properties.reference_water_levels |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
366 ) { |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
367 return Object.keys( |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
368 JSON.parse(this.bottleneck.properties.reference_water_levels) |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
369 ); |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
370 } |
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
371 return []; |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
372 } |
2438
bbc31150248c
client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents:
2436
diff
changeset
|
373 } |
1278
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
374 }; |
8f4bf8576acd
removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
375 </script> |