annotate client/src/components/ImportSoundingresults.vue @ 1607:38f91897ca69

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