annotate client/src/components/importconfiguration/types/Soundingresults.vue @ 5736:55892008ec96 default tip

Fixed a bunch of corner cases in WG import.
author Sascha Wilde <wilde@sha-bang.de>
date Wed, 29 May 2024 19:02:42 +0200
parents 2576a399c2cf
children
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"
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
25 :key="bn.properties.bottleneck_id"
3692
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 >
5586
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
28 {{ bn.properties.displayName }}
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
29 <!-- objnam for label is okay -->
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
30 </option>
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
31 </optgroup>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
32 </select>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
33 <span class="text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
34 <small v-if="!bottleneck">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
35 <translate>Please select a bottleneck</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
36 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
37 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
38 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
39 <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
40 <small class="text-muted">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
41 <translate>Projection</translate>&nbsp;(EPSG)
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
42 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
43 <input
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
44 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
45 v-model="projection"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
46 value="4326"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
47 placeholder="e.g. 4326"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
48 type="number"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
49 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
50 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
51 <small v-if="!projection">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
52 <translate>Please enter a projection</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 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
55 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
56 <div class="text-left ml-1">
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
57 <small class="text-muted">
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
58 <translate>BeamType</translate>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
59 </small>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
60 <select
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
61 v-model="beamType"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
62 class="custom-select custom-select-sm"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
63 id="beamtype"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
64 >
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
65 <option
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
66 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
67 :key="option"
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
68 >{{ $options.BEAMTYPES[option] }}</option
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
69 >
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
70 </select>
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
71 </div>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
72 </div>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
73 <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
74 <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
75 <small class="text-muted">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
76 <translate>Depthreference</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
77 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
78 <select
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
79 v-model="depthReference"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
80 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
81 id="depthreference"
2432
851c904416f6 client: import soundingresults: html cleanup
Markus Kottlaender <markus@intevation.de>
parents: 2414
diff changeset
82 >
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
83 <option
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
84 v-for="option in this.depthReferenceOptions"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
85 :key="option"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
86 >{{ option }}</option
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
87 >
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
88 </select>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
89 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
90 <small v-if="!depthReference">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
91 <translate>Please enter a reference</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
92 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
93 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
94 </div>
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
95 <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
96 <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
97 <input
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
98 id="importdate"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
99 type="date"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
100 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
101 placeholder="Date of import"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
102 v-model="importDate"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
103 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
104 <span class="text-left text-danger">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
105 <small v-if="!importDate">
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
106 <translate>Please enter a date</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
107 </small>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
108 </span>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
109 </div>
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
110 <div class="ml-3 text-left d-flex flex-column">
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
111 <div class="text-left">
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
112 <small class="text-muted">
3948
5020128dc5a0 Be more precise in labeling negate-z box.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3947
diff changeset
113 <translate>Negate Z values in XYZ files</translate>
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
114 </small>
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
115 </div>
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
116 <div class="ml-4 mt-2 text-left">
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
117 <input
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
118 id="negatez"
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
119 type="checkbox"
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
120 class="form-check-input"
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
121 v-model="negateZ"
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
122 />
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
123 </div>
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
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>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
126 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
127 <div class="mt-2">
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
128 <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
129 <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
130 <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
131 <small class="text-muted">
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
132 <translate>Email Notification</translate>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
133 </small>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
134 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
135 <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
136 <toggle-button
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
137 v-model="eMailNotification"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
138 class="mt-2"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
139 :speed="100"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
140 :labels="{
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
141 checked: this.$options.on,
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
142 unchecked: this.$options.off
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
143 }"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
144 :width="60"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
145 :height="30"
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
146 />
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
147 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
148 </div>
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
149 <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
150 <input
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
151 accept=".zip,.txt"
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
152 type="file"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
153 @change="fileSelected"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
154 class="custom-file-input"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
155 id="uploadFile"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
156 />
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
157 <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
158 {{ uploadLabel }}
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
159 </label>
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
160 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
161 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
162 <div
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
163 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
164 v-if="editState"
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 <button
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
167 :key="1"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
168 @click="deleteTempData()"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
169 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
170 >
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
171 Back
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
172 </button>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
173 <span>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
174 <a
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
175 download="meta.json"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
176 :href="dataLink"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
177 :class="[
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
178 'btn btn-sm btn-outline-info',
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
179 { disabled: !bottleneck || !importDate || !depthReference }
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
180 ]"
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
181 >
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
182 <translate>Download Meta.json</translate>
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
183 </a>
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
184 <button
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
185 :disabled="disableUploadButton"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
186 @click="confirm"
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
187 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
188 type="button"
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
189 >
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
190 <translate>Confirm</translate>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
191 </button>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
192 </span>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
193 </div>
3281
439e1865a2d2 client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents: 3156
diff changeset
194 <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
195 <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
196 Back
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
197 </button>
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
198 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
200 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 </template>
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203 <script>
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
204 /* 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
205 * without warranty, see README.md and license for details.
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
206 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
207 * SPDX-License-Identifier: AGPL-3.0-or-later
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
208 * License-Filename: LICENSES/AGPL-3.0.txt
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
209 *
1350
58d41573e530 staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1348
diff changeset
210 * Copyright (C) 2018 by via donau
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
211 * – Österreichische Wasserstraßen-Gesellschaft mbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
212 * Software engineering by Intevation GmbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
213 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
214 * Author(s):
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
215 * Thomas Junk <thomas.junk@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
216 * Markus Kottländer <markus.kottlaender@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
217 */
1613
f2d24dceecc7 refac: cleanup import paths
Thomas Junk <thomas.junk@intevation.de>
parents: 1607
diff changeset
218 import { HTTP } from "@/lib/http";
2985
1b8bb4f89227 client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents: 2978
diff changeset
219 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
220 import { mapState, mapGetters } from "vuex";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
221
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
222 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
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 export default {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
225 data() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
226 return {
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
227 beamType: this.$options.BEAMTYPES.MULTIBEAM,
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228 importState: IMPORTSTATE.UPLOAD,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 depthReference: "",
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 bottleneck: "",
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
231 projection: "4326",
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
232 importDate: "",
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
233 uploadLabel: this.$gettext(this.$options.UPLOADLABEL),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 uploadFile: null,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
235 disableUpload: false,
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
236 token: null,
3013
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
237 messages: [],
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
238 eMailNotification: false,
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
239 negateZ: false
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 };
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 methods: {
2977
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
243 back() {
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
244 this.$store.commit("importschedule/setListMode");
ab26fb7a76f6 unified_imports: soundingresults moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents: 2919
diff changeset
245 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
246 initialState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
247 this.importState = IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
248 this.depthReference = "";
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
249 this.bottleneck = null;
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
250 this.projection = "4326";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 this.importDate = "";
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
252 this.uploadLabel = this.$gettext(this.$options.UPLOADLABEL);
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
253 this.uploadFile = null;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
254 this.disableUpload = false;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 this.token = null;
3013
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
256 this.eMailNotification = false;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
257 this.messages = [];
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
258 this.beamType = "";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 fileSelected(e) {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261 const files = e.target.files || e.dataTransfer.files;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 if (!files) return;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
263 this.uploadLabel = files[0].name;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
264 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
265 this.upload();
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
266 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
267 deleteTempData() {
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
268 HTTP.delete("/imports/sr-upload/" + this.token, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
270 "X-Gemma-Auth": localStorage.getItem("token")
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 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
274 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
275 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
276 .catch(error => {
4869
6b054b91d9b2 backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents: 4868
diff changeset
277 let message = "Backend not reachable";
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
278 if (error.response) {
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
279 const { status, data } = error.response;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
280 message = `${status}: ${data.message || data}`;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
281 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
282 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
283 title: this.$gettext("Backend Error"),
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
284 message: message
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
285 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
286 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
287 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
288 upload() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
289 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
290 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
291 if (this.eMailNotification) {
30222bcbfec9 import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents: 2985
diff changeset
292 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
293 }
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
294 HTTP.post("/imports/sr-upload", formData, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
295 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
296 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
297 "Content-Type": "multipart/form-data"
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 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
300 .then(response => {
5409
d668ccc7d12c SR Import: Minor fix in guarding clause
Thomas Junk <thomas.junk@intevation.de>
parents: 5404
diff changeset
301 if (response.data && response.data.meta) {
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
302 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
303 const depthReference = response.data.meta["depth-reference"];
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
304 const surveyType = response.data.meta["survey-type"];
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
305 this.negateZ = response.data.meta["negate-z"];
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
306 this.bottleneck = this.bottlenecks.find(
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
307 bn => bn.properties.bottleneck_id === bottleneck
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
308 );
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
309 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
310 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
311 this.projection = epsg;
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
312 switch (surveyType) {
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
313 case "single":
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
314 this.beamType = this.$options.BEAMTYPES.SINGLEBEAM;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
315 break;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
316 case "multi":
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
317 this.beamType = this.$options.BEAMTYPES.MULTIBEAM;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
318 break;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
319 case "marking":
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
320 this.beamType = this.$options.BEAMTYPES.MARKING;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
321 break;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
322 default:
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
323 this.beamType = this.$options.BEAMTYPES.MULTIBEAM;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
324 break;
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
325 }
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
326 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
327 this.importState = IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
328 this.token = response.data.token;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
329 this.messages = response.data.messages;
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
330 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
331 .catch(error => {
4869
6b054b91d9b2 backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents: 4868
diff changeset
332 let message = "Backend not reachable";
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
333 if (error.response) {
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
334 const { status, data } = error.response;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
335 message = `${status}: ${data.message || data}`;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
336 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
337 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
338 title: this.$gettext("Backend Error"),
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
339 message: message
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
340 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
341 });
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 confirm() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 formData.append("token", this.token);
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
346 if (this.bottleneck)
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
347 formData.append("bottleneck", this.bottleneck.properties.bottleneck_id);
1309
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
348 if (this.importDate)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
349 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
350 if (this.depthReference)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
351 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
352 if (this.projection) formData.append("epsg", this.projection);
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
353 if (this.beamType) formData.append("survey-type", this.beamType);
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
354 formData.append("negate-z", this.negateZ == true);
2294
b2de7a77b570 import soundingresult: fix URL
Thomas Junk <thomas.junk@intevation.de>
parents: 2154
diff changeset
355 HTTP.post("/imports/sr", formData, {
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
356 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
357 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
358 "Content-Type": "multipart/form-data"
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
359 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
360 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
361 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
362 displayInfo({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
363 title: this.$gettext("Import"),
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
364 message:
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
365 this.$gettext("Starting import for ") +
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
366 this.bottleneck.properties.objnam //objnam for display is okay
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
367 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
368 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
369 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
370 .catch(error => {
4869
6b054b91d9b2 backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents: 4868
diff changeset
371 let message = "Backend not reachable";
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
372 if (error.response) {
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
373 const { status, data } = error.response;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
374 message = `${status}: ${data.message || data}`;
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
375 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
376 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
377 title: this.$gettext("Backend Error"),
4868
008bc1ae8897 exception handling
Thomas Junk <thomas.junk@intevation.de>
parents: 3948
diff changeset
378 message: message
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
379 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
380 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
381 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
382 },
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
383 mounted() {
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
384 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
385 },
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
386 watch: {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
387 showContextBox() {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
388 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
389 }
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
390 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
391 computed: {
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
392 ...mapState("application", ["showContextBox"]),
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
393 ...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
394 ...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
395 ...mapGetters("usermanagement", ["userCountries"]),
3702
ee7dc0bea083 import_soundingresult: sysadmin sees full list of bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3700
diff changeset
396 ...mapGetters("user", ["isSysAdmin"]),
2760
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
397 importSoundingresultsLabel() {
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
398 return this.$gettext("Import Soundingresults");
c6fba10926cc client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents: 2534
diff changeset
399 },
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
400 disableUploadButton() {
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
401 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
402 if (
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
403 !this.bottleneck ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
404 !this.importDate ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
405 !this.depthReference ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
406 !this.projection
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
407 )
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
408 return true;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
409 return this.disableUpload;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
410 },
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
411 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
412 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
413 if (userCountrycode === "global" || this.isSysAdmin)
ee7dc0bea083 import_soundingresult: sysadmin sees full list of bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3700
diff changeset
414 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
415 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
416 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
417 );
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
418 },
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
419 placeholder() {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
420 return this.$gettext("Select bottleneck");
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
421 },
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
422 orderedBottlenecks() {
5586
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
423 const groupedBottlenecks = {};
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
424 const orderedGroups = {};
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
425
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
426 // group bottlenecks by cc
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
427 this.availableBottlenecks.forEach(bn => {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
428 let cc = bn.properties.responsible_country;
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
429 if (groupedBottlenecks.hasOwnProperty(cc)) {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
430 groupedBottlenecks[cc].push(bn);
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
431 } else {
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
432 groupedBottlenecks[cc] = [bn];
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
433 }
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
434 });
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
435
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
436 // order groups by cc
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
437 Object.keys(groupedBottlenecks)
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
438 .sort()
5586
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
439 .forEach(cc => {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
440 const names = {};
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
441 const doubleNames = {};
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
442 groupedBottlenecks[cc].forEach(bn => {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
443 const name = bn.properties.name || bn.properties.objnam;
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
444 if (!names[name]) {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
445 names[name] = name;
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
446 } else {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
447 doubleNames[name] = name;
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
448 }
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
449 });
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
450 groupedBottlenecks[cc].forEach(bn => {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
451 const name = bn.properties.name || bn.properties.objnam;
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
452 if (doubleNames[name]) {
5587
2576a399c2cf Using squarebrackets in displayName
Thomas Junk <thomas.junk@intevation.de>
parents: 5586
diff changeset
453 bn.properties.displayName = `${name} [${bn.properties.bottleneck_id}]`;
5586
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
454 } else {
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
455 bn.properties.displayName = name;
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
456 }
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
457 });
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
458 orderedGroups[cc] = groupedBottlenecks[cc];
215e6ba9651b Added property "displayName" to bottlenecks.
Thomas Junk <thomas.junk@intevation.de>
parents: 5580
diff changeset
459 });
3692
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
460 return orderedGroups;
3138836bf840 import_soundingresults: bottlenecks grouped by countrycode
Thomas Junk <thomas.junk@intevation.de>
parents: 3675
diff changeset
461 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
462 editState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
463 return this.importState === IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
464 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
465 uploadState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
466 return this.importState === IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
467 },
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
468 Upload() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
469 return this.$gettext("Upload");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
470 },
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
471 Confirm() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
472 return this.$gettext("Confirm");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
473 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
474 dataLink() {
3672
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
475 if (
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
476 this.bottleneck &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
477 this.depthReference &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
478 this.importDate &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
479 this.beamType &&
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
480 this.projection
2c92e9cd0889 import_sounding_results: download meta.json fixed
Thomas Junk <thomas.junk@intevation.de>
parents: 3577
diff changeset
481 ) {
2445
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
482 return (
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
483 "data:text/json;charset=utf-8," +
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
484 encodeURIComponent(
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
485 JSON.stringify({
3675
3c4f6b9acaad import_soundingresults: rename depthReference to 'depth-reference'
Thomas Junk <thomas.junk@intevation.de>
parents: 3672
diff changeset
486 "depth-reference": this.depthReference,
5580
0f258757e73a Change objnam in Soundingresults.vue to bottleneck_id. Add comments for places where objnam is okay.
Thomas Junk <thomas.junk@intevation.de>
parents: 5409
diff changeset
487 bottleneck: this.bottleneck.properties.bottleneck_id,
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
488 date: this.importDate,
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
489 "survey-type": this.beamType,
3947
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
490 epsg: Number(this.projection),
5da5de770ec4 sr_upload: negate-z-index checkbox added
Thomas Junk <thomas.junk@intevation.de>
parents: 3899
diff changeset
491 "negate-z": this.negateZ == true
2445
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
492 })
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
493 )
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
494 );
e0f423606929 client: import soundingdata: fix npe bug
Markus Kottlaender <markus@intevation.de>
parents: 2438
diff changeset
495 }
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
496 },
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
497 depthReferenceOptions() {
3407
7ea54c3b3fd6 afd: breaks for bottlenecks
Thomas Junk <thomas.junk@intevation.de>
parents: 3283
diff changeset
498 if (this.bottleneck) {
5342
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
499 const bnProperties = this.bottleneck.properties;
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
500 const referenceLevels =
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
501 JSON.parse(bnProperties.reference_water_levels) || {};
3492
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
502 const result = Object.keys(referenceLevels);
5342
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
503 const bottleneckBGorRO =
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
504 bnProperties.responsible_country == "BG" ||
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
505 bnProperties.responsible_country == "RO";
5313
1b4cb1545a44 Allow ZPG as available depth-reference under stricter rules
Thomas Junk <thomas.junk@intevation.de>
parents: 4869
diff changeset
506 const hasLDC = referenceLevels.hasOwnProperty("LDC");
1b4cb1545a44 Allow ZPG as available depth-reference under stricter rules
Thomas Junk <thomas.junk@intevation.de>
parents: 4869
diff changeset
507 const hasZPG = referenceLevels.hasOwnProperty("ZPG");
5342
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
508 if ((hasLDC && !hasZPG) || (!hasLDC && !hasZPG && bottleneckBGorRO)) {
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
509 result.push("ZPG");
08dc7e5de1f5 fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents: 5313
diff changeset
510 }
3492
73285a90cab2 soundingresult_import: added ZPG only if not available
Thomas Junk <thomas.junk@intevation.de>
parents: 3491
diff changeset
511 return result;
2438
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
512 }
bbc31150248c client: import soundingresults: depthreferences from selected bottleneck
Markus Kottlaender <markus@intevation.de>
parents: 2436
diff changeset
513 return [];
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
514 }
3156
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
515 },
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
516 BEAMTYPES: {
5404
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
517 MULTIBEAM: "multi",
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
518 SINGLEBEAM: "single",
47b12e8308bf SR-Upload dialogue migrated towards "surveytype"
Thomas Junk <thomas.junk@intevation.de>
parents: 5342
diff changeset
519 MARKING: "marking"
3577
959312a236a0 sr-import: sent 'beam-type' along
Thomas Junk <thomas.junk@intevation.de>
parents: 3574
diff changeset
520 },
3574
d5959f69e903 import_sounding_result: accept txt files
Thomas Junk <thomas.junk@intevation.de>
parents: 3570
diff changeset
521 UPLOADLABEL: "choose a .zip or .txt file",
3156
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
522 on: "on",
cb3b31566e48 import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents: 3013
diff changeset
523 off: "off"
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
524 };
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
525 </script>