annotate client/src/components/map/contextbox/ImportSoundingresults.vue @ 1441:a4554e942954

Client: add a set of marked translations * add a number of marked translatios in javascript part of some .vue files * generate the corresponding .po files and translation.json file * add some examples translations for ImportSoundingresults.vue
author Fadi Abbud <fadi.abbud@intevation.de>
date Fri, 30 Nov 2018 13:09:40 +0100
parents 15c3672e2e86
children bb47531bdd22
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
1 <template>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
2 <div>
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
3 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
4 <font-awesome-icon icon="upload" class="mr-2"></font-awesome-icon>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
5 <translate>Import Soundingresults</translate>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
6 </h6>
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
7 <div v-if="editState" class="ml-auto mr-auto mt-4 w-95">
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
8 <div class="d-flex flex-column">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
9 <div class="d-flex flex-row">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
10 <div class="mt-1 text-left w-50 ml-2 mr-4">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
11 <small class="text-muted">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
12 <translate>Bottleneck</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
13 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
14 <select v-model="bottleneck" class="custom-select">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
15 <option v-for="bottleneck in availableBottlenecks" :key="bottleneck">{{bottleneck}}</option>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
16 </select>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
17 <span class="text-danger">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
18 <small v-if="!bottleneck">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
19 <translate>Please select a bottleneck</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
20 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
21 </span>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
22 </div>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
23 <div class="mt-1 text-left w-50 mr-2">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
24 <small class="text-muted">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
25 <translate>Projection</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
26 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
27 <select v-model="projection" class="custom-select" id="depthreference">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
28 <option
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
29 v-for="projection in this.$options.projections"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
30 :key="projection"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
31 >{{ projection }}</option>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
32 </select>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
33 <span class="text-left text-danger">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
34 <small v-if="!projection">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
35 <translate>Please enter a projection</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
36 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
37 </span>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
38 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
39 </div>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
40 <div class="d-flex flex-row">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
41 <div class="mt-1 text-left w-50 ml-2 mr-4">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
42 <small class="text-muted">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
43 <translate>Depthreference</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
44 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
45 <select v-model="depthReference" class="custom-select" id="depthreference">
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
46 <option
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
47 v-for="option in this.$options.depthReferenceOptions"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
48 :key="option"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
49 >{{ option }}</option>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
50 </select>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
51 <span class="text-left text-danger">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
52 <small v-if="!depthReference">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
53 <translate>Please enter a reference</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
54 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
55 </span>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
56 </div>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
57 <div class="mt-1 text-left w-50 mr-2">
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
58 <small class="text-muted">
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
59 <translate>Date</translate>
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
60 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
61 <input
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
62 id="importdate"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
63 type="date"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
64 class="form-control"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
65 placeholder="Date of import"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
66 aria-label="bottleneck"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
67 aria-describedby="bottlenecklabel"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
68 v-model="importDate"
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
69 >
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
70 <span class="text-left text-danger">
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
71 <small v-if="!importDate">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
72 <translate>Please enter a date</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
73 </small>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
74 </span>
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
75 </div>
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
76 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
77 </div>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
78 <div class="ml-2 mt-2 text-left">
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
79 <small v-for="(message, index) in messages" :key="index">
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
80 {{
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
81 message
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
82 }}
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
83 </small>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
84 </div>
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
85 </div>
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
86 <div class="w-95 ml-auto mr-auto mt-4 mb-4">
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
87 <div v-if="uploadState" class="d-flex flex-row input-group mb-4">
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
88 <div class="custom-file">
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
89 <input
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
90 accept=".zip"
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
91 type="file"
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
92 @change="fileSelected"
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
93 class="custom-file-input"
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
94 id="uploadFile"
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
95 >
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
96 <label class="custom-file-label" for="uploadFile">
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
97 {{
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
98 uploadLabel
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
99 }}
58113365c51d Import sounding results: fix empty metajson not displaying dialog. Pattern constrained to .zip
Thomas Junk <thomas.junk@intevation.de>
parents: 1350
diff changeset
100 </label>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
101 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
102 </div>
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
103 <div class="buttons text-right">
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
104 <a
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
105 v-if="editState"
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
106 download="meta.json"
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
107 :href="dataLink"
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
108 class="btn btn-outline-info pull-left"
1412
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
109 >
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
110 <translate>Download Meta.json</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
111 </a>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
112 <button v-if="editState" @click="deleteTempData" class="btn btn-danger" type="button">
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
113 <translate>Cancel Upload</translate>
15c3672e2e86 translations readded
Thomas Junk <thomas.junk@intevation.de>
parents: 1405
diff changeset
114 </button>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
115 <button
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
116 :disabled="disableUploadButton"
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
117 @click="submit"
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
118 class="btn btn-info"
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
119 type="button"
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
120 >{{ uploadState ? Upload : Confirm }}</button>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
121 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
122 </div>
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
123 </div>
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
124 </template>
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
125
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
126 <script>
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
127 /* 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
128 * without warranty, see README.md and license for details.
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
129 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
130 * SPDX-License-Identifier: AGPL-3.0-or-later
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
131 * License-Filename: LICENSES/AGPL-3.0.txt
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
132 *
1350
58d41573e530 staging: now with real data from backend
Thomas Junk <thomas.junk@intevation.de>
parents: 1348
diff changeset
133 * Copyright (C) 2018 by via donau
1279
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
134 * – Österreichische Wasserstraßen-Gesellschaft mbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
135 * Software engineering by Intevation GmbH
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
136 *
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
137 * Author(s):
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
138 * Thomas Junk <thomas.junk@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
139 * Markus Kottländer <markus.kottlaender@intevation.de>
60e15c2d26a2 licensing info updated
Thomas Junk <thomas.junk@intevation.de>
parents: 1278
diff changeset
140 */
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
141 import { HTTP } from "../../../lib/http";
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
142 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
143 import { mapState } from "vuex";
1278
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 const IMPORTSTATE = { UPLOAD: "UPLOAD", EDIT: "EDIT" };
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
146
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
147 export default {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
148 name: "imports",
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
149 data() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
150 return {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
151 importState: IMPORTSTATE.UPLOAD,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
152 depthReference: "",
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
153 bottleneck: "",
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
154 projection: "",
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
155 importDate: "",
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
156 uploadLabel: this.$gettext("choose .zip- file"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
157 uploadFile: null,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
158 disableUpload: false,
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
159 token: null,
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
160 messages: []
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
161 };
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
162 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
163 methods: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
164 initialState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
165 this.importState = IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
166 this.depthReference = "";
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
167 this.bottleneck = "";
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
168 this.projection = "";
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
169 this.importDate = "";
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
170 this.uploadLabel = this.$gettext("choose .zip- file");
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
171 this.uploadFile = null;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
172 this.disableUpload = false;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
173 this.token = null;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
174 this.messages = [];
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
175 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
176 fileSelected(e) {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
177 const files = e.target.files || e.dataTransfer.files;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
178 if (!files) return;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
179 this.uploadLabel = files[0].name;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
180 this.uploadFile = files[0];
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
181 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
182 deleteTempData() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
183 HTTP.delete("/imports/soundingresult-upload/" + this.token, {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
184 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
185 "X-Gemma-Auth": localStorage.getItem("token")
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
186 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
187 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
188 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
189 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
190 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
191 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
192 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
193 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
194 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
195 message: `${status}: ${data.message || data}`
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
196 });
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 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
199 submit() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
200 if (!this.uploadFile || this.disableUpload) return;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
201 if (this.importState === IMPORTSTATE.UPLOAD) {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
202 this.upload();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
203 } else {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
204 this.confirm();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
205 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
206 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
207 upload() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
208 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
209 formData.append("soundingresult", this.uploadFile);
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
210 HTTP.post("/imports/soundingresult-upload", formData, {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
211 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
212 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
213 "Content-Type": "multipart/form-data"
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 .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
217 if (response.data.meta) {
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
218 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
219 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
220 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
221 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
222 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
223 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
224 }
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
225 this.importState = IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
226 this.token = response.data.token;
1302
3c10c868cba7 import sounding results: display messages as text
Thomas Junk <thomas.junk@intevation.de>
parents: 1299
diff changeset
227 this.messages = response.data.messages;
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
228 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
229 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
230 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
231 const messages = data.messages ? data.messages.join(", ") : "";
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
232 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
233 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
234 message: `${status}: ${messages}`
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
235 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
236 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
237 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
238 confirm() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
239 let formData = new FormData();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
240 formData.append("token", this.token);
1309
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
241 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
242 if (this.importDate)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
243 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
244 if (this.depthReference)
3c91930367ee import sounding results: manually add formdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1308
diff changeset
245 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
246 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
247
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
248 HTTP.post("/imports/soundingresult", formData, {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
249 headers: {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
250 "X-Gemma-Auth": localStorage.getItem("token"),
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
251 "Content-Type": "multipart/form-data"
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 .then(() => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
255 displayInfo({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
256 title: this.$gettext("Import"),
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
257 message: this.$gettext("Starting import for ") + this.bottleneck
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
258 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
259 this.initialState();
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
260 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
261 .catch(error => {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
262 const { status, data } = error.response;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
263 displayError({
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
264 title: this.$gettext("Backend Error"),
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
265 message: `${status}: ${data.message || data}`
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
266 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
267 });
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
268 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
269 },
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
270 mounted() {
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
271 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
272 },
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
273 watch: {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
274 showContextBox() {
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
275 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
276 }
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
277 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
278 computed: {
1348
c539cb678c5b import soundingresults: closing contextbox clears uploaded tempdata
Thomas Junk <thomas.junk@intevation.de>
parents: 1309
diff changeset
279 ...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
280 ...mapState("bottlenecks", ["bottlenecks"]),
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
281 disableUploadButton() {
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
282 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
283 if (
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
284 !this.bottleneck ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
285 !this.importDate ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
286 !this.depthReference ||
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
287 !this.projection
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
288 )
1357
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
289 return true;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
290 return this.disableUpload;
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
291 },
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
292 availableBottlenecks() {
f3bcce4e6f22 import soundingresults: lists bottlenecks and awaits until user makes inputs
Thomas Junk <thomas.junk@intevation.de>
parents: 1352
diff changeset
293 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
294 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
295 editState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
296 return this.importState === IMPORTSTATE.EDIT;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
297 },
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
298 uploadState() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
299 return this.importState === IMPORTSTATE.UPLOAD;
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
300 },
1441
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
301 Upload() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
302 return this.$gettext("Upload");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
303 },
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
304 Confirm() {
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
305 return this.$gettext("Confirm");
a4554e942954 Client: add a set of marked translations
Fadi Abbud <fadi.abbud@intevation.de>
parents: 1412
diff changeset
306 },
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
307 dataLink() {
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
308 return (
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
309 "data:text/json;charset=utf-8," +
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
310 encodeURIComponent(
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
311 JSON.stringify({
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
312 depthReference: this.depthReference,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
313 bottleneck: this.bottleneck,
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
314 date: this.importDate
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
315 })
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
316 )
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
317 );
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
318 }
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
319 },
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
320 projections: ["", "4326"],
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
321 depthReferenceOptions: [
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
322 "",
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
323 // "NAP",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
324 // "KP",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
325 // "FZP",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
326 // "ADR",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
327 // "TAW",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
328 // "PUL",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
329 // "NGM",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
330 // "ETRS",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
331 // "POT",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
332 // "LDC",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
333 // "HDC",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
334 // "ZPG",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
335 // "GLW",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
336 // "HSW",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
337 // "LNW",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
338 // "HNW",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
339 // "IGN",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
340 // "WGS",
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
341 "RN" //,
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
342 // "HBO"
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
343 ]
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
344 };
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
345 </script>
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
346
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
347 <style lang="sass" scoped>
1405
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
348 .projectionLabel
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
349 margin-left: $small-offset
522488564de0 import soundingresults: layout adjusted and epsg selection added
Thomas Junk <thomas.junk@intevation.de>
parents: 1402
diff changeset
350
1285
f674ce380de1 layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents: 1281
diff changeset
351 .depthreferencelabel
f674ce380de1 layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents: 1281
diff changeset
352 margin-left: $small-offset
f674ce380de1 layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents: 1281
diff changeset
353
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
354 .offset-r
1285
f674ce380de1 layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents: 1281
diff changeset
355 margin-right: $small-offset
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 .buttons button
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
358 margin-left: $offset !important
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
359
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
360 .label-text
1285
f674ce380de1 layout soundingresults
Thomas Junk <thomas.junk@intevation.de>
parents: 1281
diff changeset
361 width: 5rem
1278
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
362 text-align: left
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
363 line-height: 2.25rem
8f4bf8576acd removed directory with only one file
Markus Kottlaender <markus@intevation.de>
parents:
diff changeset
364 </style>