annotate client/src/components/importconfiguration/types/Soundingresults.vue @ 3712:9eab897f66b6

import_soundingresult: form parameter for beamtype to boolean
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 20 Jun 2019 12:44:19 +0200
parents ee7dc0bea083
children 73589ed481f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
3 <div v-if="editState" class="mb-2 p-2">
2977
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"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
7 class="alert alert-warning small"
2977
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>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
11 <div class="d-flex">
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
12 <div class="text-left mr-3">
2977
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>
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
16 <select class="form-control font-weight-bold" v-model="bottleneck">
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
17 <option :value="null">{{ placeholder }}</option>
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
18 <optgroup
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
19 v-for="(bottlenecksForCountry, cc) in orderedBottlenecks"
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
20 :key="cc"
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
21 :label="cc"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
22 >
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
23 <option
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
24 v-for="bn in bottlenecksForCountry"
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
25 :key="bn.properties.objnam"
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
26 :value="bn"
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
27 >
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
28 {{ bn.properties.objnam }}
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
29 </option>
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
30 </optgroup>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
31 </select>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
32 <span class="text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
33 <small v-if="!bottleneck">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
34 <translate>Please select a bottleneck</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
35 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
36 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
37 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
38 <div class="text-left ml-2 mr-1">
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
39 <small class="text-muted">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
40 <translate>Projection</translate>&nbsp;(EPSG)
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
41 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
42 <input
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
43 class="form-control form-control-sm"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
44 v-model="projection"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
45 value="4326"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
46 placeholder="e.g. 4326"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
47 type="number"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
48 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
49 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
50 <small v-if="!projection">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
51 <translate>Please enter a projection</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
52 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
53 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
54 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
55 <div class="text-left ml-1">
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
56 <small class="text-muted">
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
57 <translate>BeamType</translate>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
58 </small>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
59 <select
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
60 v-model="beamType"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
61 class="custom-select custom-select-sm"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
62 id="beamtype"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
63 >
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
64 <option
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
65 v-for="option in Object.keys($options.BEAMTYPES)"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
66 :key="option"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
67 >{{ $options.BEAMTYPES[option] }}</option
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
68 >
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
69 </select>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
70 </div>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
71 </div>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
72 <div class="d-flex flex-row w-100 mt-3">
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
73 <div class="mr-2 text-left">
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
74 <small class="text-muted">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
75 <translate>Depthreference</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
76 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
77 <select
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
78 v-model="depthReference"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
79 class="custom-select custom-select-sm"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
80 id="depthreference"
2432
851c904416f6 client: import soundingresults: html cleanup
Markus Kottlaender <markus@intevation.de>
parents: 2414
diff changeset
81 >
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
82 <option
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
83 v-for="option in this.depthReferenceOptions"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
84 :key="option"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
85 >{{ option }}</option
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
86 >
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
87 </select>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
88 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
89 <small v-if="!depthReference">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
90 <translate>Please enter a reference</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
91 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
92 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
93 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
94 <div class="ml-3 text-left">
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
95 <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
96 <input
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
97 id="importdate"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
98 type="date"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
99 class="form-control form-control-sm"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
100 placeholder="Date of import"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
101 v-model="importDate"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
102 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
103 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
104 <small v-if="!importDate">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
105 <translate>Please enter a date</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
106 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
107 </span>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
108 </div>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
109 </div>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
110 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
111 <div class="mt-2">
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
112 <div v-if="uploadState" class="input-group px-2">
3013
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
113 <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
114 <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
115 <small class="text-muted">
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
116 <translate>Email Notification</translate>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
117 </small>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
118 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
119 <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
120 <toggle-button
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
121 v-model="eMailNotification"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
122 class="mt-2"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
123 :speed="100"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
124 :labels="{
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
125 checked: this.$options.on,
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
126 unchecked: this.$options.off
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
127 }"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
128 :width="60"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
129 :height="30"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
130 />
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
131 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
132 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
133 <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
134 <input
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
135 accept=".zip,.txt"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
136 type="file"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
137 @change="fileSelected"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
138 class="custom-file-input"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
139 id="uploadFile"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
140 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
141 <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
142 {{ uploadLabel }}
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
143 </label>
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
144 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
145 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
146 <div
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
147 class="d-flex justify-content-between mt-2 p-2 border-top"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
148 v-if="editState"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
149 >
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
150 <button
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
151 :key="1"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
152 @click="deleteTempData()"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
153 class="btn btn-sm btn-warning"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
154 >
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
155 Back
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
156 </button>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
157 <span>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
158 <a
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
159 download="meta.json"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
160 :href="dataLink"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
161 :class="[
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
162 'btn btn-sm btn-outline-info',
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
163 { disabled: !bottleneck || !importDate || !depthReference }
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
164 ]"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
165 >
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
166 <translate>Download Meta.json</translate>
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
167 </a>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
168 <button
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
169 :disabled="disableUploadButton"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
170 @click="confirm"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
171 class="btn btn-sm btn-info ml-2"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
172 type="button"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
173 >
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
174 <translate>Confirm</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
175 </button>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
176 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
177 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
178 <div v-if="uploadState" class="d-flex mt-2 p-2 border-top">
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
179 <button :key="2" @click="back()" class="btn btn-sm btn-warning">
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
180 Back
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
181 </button>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
182 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
183 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
184 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
185 </template>
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 <script>
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
188 /* 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
189 * without warranty, see README.md and license for details.
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
190 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
191 * SPDX-License-Identifier: AGPL-3.0-or-later
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
192 * License-Filename: LICENSES/AGPL-3.0.txt
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
193 *
1350
58d41573e530 staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1348
diff changeset
194 * Copyright (C) 2018 by via donau
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
195 * – Österreichische Wasserstraßen-Gesellschaft mbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
196 * Software engineering by Intevation GmbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
197 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
198 * Author(s):
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
199 * Thomas Junk <thomas.junk@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
200 * Markus Kottländer <markus.kottlaender@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
201 */
1613
f2d24dceecc7 refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents: 1607
diff changeset
202 import { HTTP } from "@/lib/http";
2985
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2978
diff changeset
203 import { displayError, displayInfo } from "@/lib/errors";
3700
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
204 import { mapState, mapGetters } from "vuex";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
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 export default {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
209 data() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210 return {
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
211 beamType: this.$options.BEAMTYPES.MULTIBEAM,
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
212 importState: IMPORTSTATE.UPLOAD,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213 depthReference: "",
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
214 bottleneck: "",
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
215 projection: "4326",
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
216 importDate: "",
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
217 uploadLabel: this.$gettext(this.$options.UPLOADLABEL),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
218 uploadFile: null,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
219 disableUpload: false,
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
220 token: null,
3013
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
221 messages: [],
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
222 eMailNotification: false
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
223 };
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 methods: {
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
226 back() {
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
227 this.$store.commit("importschedule/setListMode");
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
228 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 initialState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 this.importState = IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231 this.depthReference = "";
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
232 this.bottleneck = null;
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
233 this.projection = "4326";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 this.importDate = "";
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
235 this.uploadLabel = this.$gettext(this.$options.UPLOADLABEL);
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
236 this.uploadFile = null;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
237 this.disableUpload = false;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238 this.token = null;
3013
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
239 this.eMailNotification = false;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
240 this.messages = [];
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
241 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
242 fileSelected(e) {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
243 const files = e.target.files || e.dataTransfer.files;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
244 if (!files) return;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
245 this.uploadLabel = files[0].name;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
246 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
247 this.upload();
1278
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 deleteTempData() {
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
250 HTTP.delete("/imports/sr-upload/" + this.token, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
252 "X-Gemma-Auth": localStorage.getItem("token")
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
253 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
254 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
256 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
257 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
258 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
261 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 message: `${status}: ${data.message || 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 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
266 upload() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
267 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
268 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
269 if (this.eMailNotification) {
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
270 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
271 }
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
272 HTTP.post("/imports/sr-upload", formData, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
273 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
275 "Content-Type": "multipart/form-data"
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
276 }
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 .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
279 if (response.data.meta) {
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
280 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
281 const depthReference = response.data.meta["depth-reference"];
3695
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
282 const singlebeam = response.data.meta["single-beam"];
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
283 this.bottleneck = this.bottlenecks.find(
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
284 bn => bn.properties.objnam === bottleneck
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
285 );
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
286 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
287 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
288 this.projection = epsg;
3695
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
289 this.beamType = singlebeam
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
290 ? this.$options.BEAMTYPES.SINGLEBEAM
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
291 : this.$options.BEAMTYPES.MULTIBEAM;
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
292 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
293 this.importState = IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
294 this.token = response.data.token;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
295 this.messages = response.data.messages;
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 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
298 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
299 const messages = data.messages ? data.messages.join(", ") : "";
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
300 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
301 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
302 message: `${status}: ${messages}`
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
303 });
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 confirm() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
307 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
308 formData.append("token", this.token);
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
309 if (this.bottleneck)
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
310 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
311 if (this.importDate)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
312 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
313 if (this.depthReference)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
314 formData.append("depth-reference", this.depthReference);
3570
2ec49a2dca83 Fixed projection selection to back end for SR import.
Sascha Wilde <wilde@intevation.de>
parents: 3492
diff changeset
315 if (this.projection) formData.append("epsg", this.projection);
3695
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
316 if (this.beamType)
3712
9eab897f66b6 import_soundingresult: form parameter for beamtype to boolean
Thomas Junk <thomas.junk@intevation.de>
parents: 3702
diff changeset
317 formData.append(
9eab897f66b6 import_soundingresult: form parameter for beamtype to boolean
Thomas Junk <thomas.junk@intevation.de>
parents: 3702
diff changeset
318 "single-beam",
9eab897f66b6 import_soundingresult: form parameter for beamtype to boolean
Thomas Junk <thomas.junk@intevation.de>
parents: 3702
diff changeset
319 this.beamType === this.$options.BEAMTYPES.SINGLEBEAM
9eab897f66b6 import_soundingresult: form parameter for beamtype to boolean
Thomas Junk <thomas.junk@intevation.de>
parents: 3702
diff changeset
320 );
1309
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
321
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
322 HTTP.post("/imports/sr", formData, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
323 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
324 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
325 "Content-Type": "multipart/form-data"
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 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
329 displayInfo({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
330 title: this.$gettext("Import"),
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
331 message:
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
332 this.$gettext("Starting import for ") +
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
333 this.bottleneck.properties.objnam
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
334 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
335 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
336 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
337 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
338 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
339 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
340 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
341 message: `${status}: ${data.message || data}`
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
342 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
343 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 },
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
346 mounted() {
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
347 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
348 },
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
349 watch: {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
350 showContextBox() {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
351 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
352 }
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
353 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
354 computed: {
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
355 ...mapState("application", ["showContextBox"]),
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
356 ...mapState("bottlenecks", ["bottlenecks"]),
3700
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
357 ...mapState("user", ["user"]),
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
358 ...mapGetters("usermanagement", ["userCountries"]),
3702
ee7dc0bea083 import_soundingresult: sysadmin sees full list of bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3700
diff changeset
359 ...mapGetters("user", ["isSysAdmin"]),
2760
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
360 importSoundingresultsLabel() {
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
361 return this.$gettext("Import Soundingresults");
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
362 },
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
363 disableUploadButton() {
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
364 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
365 if (
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
366 !this.bottleneck ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
367 !this.importDate ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
368 !this.depthReference ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
369 !this.projection
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
370 )
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
371 return true;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
372 return this.disableUpload;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
373 },
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
374 availableBottlenecks() {
3700
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
375 const userCountrycode = this.userCountries[this.user];
3702
ee7dc0bea083 import_soundingresult: sysadmin sees full list of bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3700
diff changeset
376 if (userCountrycode === "global" || this.isSysAdmin)
ee7dc0bea083 import_soundingresult: sysadmin sees full list of bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3700
diff changeset
377 return this.bottlenecks;
3700
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
378 return this.bottlenecks.filter(
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
379 bn => bn.properties.responsible_country === userCountrycode
2d77a7447d09 import_soundingresult: restrict users to import only data for bottlenecks they are responsible for
Thomas Junk <thomas.junk@intevation.de>
parents: 3695
diff changeset
380 );
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
381 },
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
382 placeholder() {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
383 return this.$gettext("Select bottleneck");
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
384 },
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
385 orderedBottlenecks() {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
386 let groupedBottlenecks = {},
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
387 orderedGroups = {};
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
388
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
389 // group bottlenecks by cc
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
390 this.availableBottlenecks.forEach(bn => {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
391 let cc = bn.properties.responsible_country;
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
392 if (groupedBottlenecks.hasOwnProperty(cc)) {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
393 groupedBottlenecks[cc].push(bn);
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
394 } else {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
395 groupedBottlenecks[cc] = [bn];
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
396 }
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
397 });
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
398
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
399 // order groups by cc
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
400 Object.keys(groupedBottlenecks)
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
401 .sort()
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
402 .forEach(cc => (orderedGroups[cc] = groupedBottlenecks[cc]));
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
403
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
404 return orderedGroups;
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
405 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
406 editState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
407 return this.importState === IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
408 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
409 uploadState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
410 return this.importState === IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
411 },
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
412 Upload() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
413 return this.$gettext("Upload");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
414 },
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
415 Confirm() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
416 return this.$gettext("Confirm");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
417 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
418 dataLink() {
3672
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
419 if (
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
420 this.bottleneck &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
421 this.depthReference &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
422 this.importDate &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
423 this.beamType &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
424 this.projection
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
425 ) {
2445
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
426 return (
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
427 "data:text/json;charset=utf-8," +
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
428 encodeURIComponent(
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
429 JSON.stringify({
3675
3c4f6b9acaad import_soundingresults: rename depthReference to 'depth-reference'
Thomas Junk <thomas.junk@intevation.de>
parents: 3672
diff changeset
430 "depth-reference": this.depthReference,
2445
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
431 bottleneck: this.bottleneck.properties.objnam,
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
432 date: this.importDate,
3695
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
433 "single-beam":
5754793ff9b0 import_configuration: adapt backend notation 'single-beam'
Thomas Junk <thomas.junk@intevation.de>
parents: 3692
diff changeset
434 this.beamType === this.$options.BEAMTYPES.SINGLEBEAM,
3672
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
435 projection: this.projection
2445
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
436 })
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
437 )
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
438 );
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
439 }
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
440 },
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
441 depthReferenceOptions() {
3407
7ea54c3b3fd6 afd: breaks for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3283
diff changeset
442 if (this.bottleneck) {
3492
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
443 const referenceLevels = JSON.parse(
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
444 this.bottleneck.properties.reference_water_levels
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
445 );
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
446 const result = Object.keys(referenceLevels);
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
447 if (!referenceLevels["ZPG"]) result.push("ZPG"); // ZPG should always be available
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
448 return result;
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
449 }
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
450 return [];
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
451 }
3156
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
452 },
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
453 BEAMTYPES: {
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
454 MULTIBEAM: "multibeam",
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
455 SINGLEBEAM: "singlebeam"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
456 },
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
457 UPLOADLABEL: "choose a .zip or .txt file",
3156
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
458 on: "on",
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
459 off: "off"
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
460 };
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
461 </script>