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