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