Mercurial > gemma
annotate client/src/components/importconfiguration/types/WaterwayProfiles.vue @ 5342:08dc7e5de1f5 extented-report
fixing linting errors
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 18 Jun 2021 12:05:57 +0200 |
parents | eb79bc545482 |
children | 84d01a536bec |
rev | line source |
---|---|
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
2 <div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
3 <div class="mb-2 px-2"> |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
4 <div :key="1" class="flex-column mr-4"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
5 <div class="flex-row text-left"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
6 <small class="text-muted"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
7 <translate>Email Notification</translate> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
8 </small> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
9 </div> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
10 <div class="flex-flex-row text-left"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
11 <toggle-button |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
12 v-model="eMailNotification" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
13 class="mt-2" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
14 :speed="100" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
15 :labels="{ |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
16 checked: this.$options.on, |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
17 unchecked: this.$options.off |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
18 }" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
19 :width="60" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
20 :height="30" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
21 /> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
22 </div> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
23 </div> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
24 <div class="d-flex flex-row"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
25 <div class="flex-column w-100"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
26 <div class="flex-row text-left"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
27 <small class="text-muted"> <translate>URL</translate> </small> |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
28 </div> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
29 <div class="w-100"> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
30 <input |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
31 class="form-control form-control-sm" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
32 type="url" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
33 v-model="url" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
34 /> |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
35 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
36 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
37 </div> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
38 <div v-if="!url" class="d-flex flex-row"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
39 <small |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
40 ><translate class="text-danger">Please enter a URL</translate></small |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
41 > |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
42 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
43 <div class="d-flex flex-row"> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
44 <div class="flex-column mt-2 mr-3 w-50"> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
45 <div class="flex-row text-left"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
46 <small class="text-muted"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
47 <translate>Featuretype</translate> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
48 </small> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
49 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
50 <div class="w-100"> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
51 <input |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
52 class="form-control form-control-sm" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
53 type="text" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
54 v-model="featureType" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
55 /> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
56 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
57 <div v-if="!featureType" class="d-flex flex-row"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
58 <small |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
59 ><translate class="text-danger" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
60 >Please enter a Featuretype</translate |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
61 ></small |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
62 > |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
63 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
64 </div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
65 <div class="flex-column mt-2 w-50"> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
66 <div class="flex-row text-left"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
67 <small class="text-muted"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
68 <translate>SortBy</translate> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
69 </small> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
70 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
71 <div class="w-100"> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
72 <input |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
73 class="form-control form-control-sm" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
74 type="text" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
75 v-model="sortBy" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
76 /> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
77 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
78 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
79 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
80 </div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
81 <div class="d-flex text-left px-2"> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
82 <div class="mt-3 mb-3 flex-column w-100"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
83 <div class="custom-file"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
84 <input |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
85 accept=".csv" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
86 type="file" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
87 @change="fileSelected" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
88 class="custom-file-input" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
89 id="uploadFile" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
90 /> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
91 <label class="pointer custom-file-label" for="uploadFile"> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
92 {{ uploadLabel }} |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
93 </label> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
94 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
95 </div> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
96 </div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
97 <div class="d-flex justify-content-between w-100 p-2 border-top"> |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
98 <button :key="1" @click="back()" class="btn btn-sm btn-warning"> |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
99 Back |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
100 </button> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
101 <button |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
102 :key="2" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
103 type="submit" |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
104 @click="submit" |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
105 class="btn btn-sm btn-info submit-button" |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
106 > |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
107 <translate>Submit</translate> |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
108 </button> |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
109 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
110 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
111 </template> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
112 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
113 <script> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
114 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 * without warranty, see README.md and license for details. |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 * |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
117 * SPDX-License-Identifier: AGPL-3.0-or-later |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
118 * License-Filename: LICENSES/AGPL-3.0.txt |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
119 * |
5268
1ff56484db4e
Made SortBy parameter in WMS import optional
wilde@azure1.rgb.intevation.de
parents:
3281
diff
changeset
|
120 * Copyright (C) 2018, 2019, 2020 by via donau |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
121 * – Österreichische Wasserstraßen-Gesellschaft mbH |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
122 * Software engineering by Intevation GmbH |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
123 * |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
124 * Author(s): |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
125 * Thomas Junk <thomas.junk@intevation.de> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
126 */ |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
127 |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2978
diff
changeset
|
128 import { displayError, displayInfo } from "@/lib/errors"; |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
129 import { HTTP } from "@/lib/http"; |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
130 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
131 export default { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
132 data() { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
133 return { |
2135
60c493aaee43
import_waterwayprofile: prefill url
Thomas Junk <thomas.junk@intevation.de>
parents:
2134
diff
changeset
|
134 url: "https://service.d4d-portal.info/wamos/wfs/", |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
135 sortBy: "hydro_scamin", |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
136 featureType: "ws-wamos:ienc_wtwprf", |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
137 disableUploadButton: false, |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
138 uploadLabel: this.$gettext("choose file to upload"), |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
139 uploadFile: null, |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
140 eMailNotification: false |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
141 }; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
142 }, |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
143 computed: { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
144 importWaterwayProfilesLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
145 return this.$gettext("Import Waterway Profiles"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
146 } |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
147 }, |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
148 methods: { |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
149 back() { |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
150 this.url = "https://service.d4d-portal.info/wamos/wfs/"; |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
151 this.uploadFile = null; |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
152 this.uploadLabel = this.$gettext("choose file to upload"); |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
153 this.$store.commit("importschedule/setListMode"); |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
154 }, |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
155 fileSelected(e) { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
156 const files = e.target.files || e.dataTransfer.files; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
157 if (!files) return; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
158 this.uploadLabel = files[0].name; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
159 this.uploadFile = files[0]; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
160 }, |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
161 submit() { |
5342
08dc7e5de1f5
fixing linting errors
Thomas Junk <thomas.junk@intevation.de>
parents:
5269
diff
changeset
|
162 if (!this.url || !this.featureType || !this.uploadFile) return; |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
163 let formData = new FormData(); |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
164 formData.append("wp", this.uploadFile); |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
165 formData.append("url", this.url); |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
166 formData.append("feature-type", this.featureType); |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
167 formData.append("sort-by", this.sortBy); |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
168 if (this.eMailNotification) { |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
169 formData.append("send-email", this.eMailNotification); |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
170 } |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
171 HTTP.post("/imports/wp", formData, { |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
172 headers: { |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
173 "X-Gemma-Auth": localStorage.getItem("token"), |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
174 "Content-Type": "multipart/form-data" |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
175 } |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
176 }) |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
177 .then(() => { |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
178 displayInfo({ |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
179 title: this.$gettext("Import"), |
2784
387fe9f088a6
Client: (minor) improve a string marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2760
diff
changeset
|
180 message: |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
181 this.uploadLabel + this.$gettext(" was successfully uploaded.") |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
182 }); |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2920
diff
changeset
|
183 this.back(); |
2134
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
184 }) |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
185 .catch(error => { |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
186 const { status, data } = error.response; |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
187 const messages = data.messages ? data.messages.join(", ") : ""; |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
188 displayError({ |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
189 title: this.$gettext("Backend Error"), |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
190 message: `${status}: ${messages}` |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
191 }); |
8ad8ce85fcbf
import_waterwayprofiles: UI etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
192 }); |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
193 } |
3156
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
194 }, |
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
195 on: "on", |
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
196 off: "off" |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
197 }; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
198 </script> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
199 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
200 <style lang="scss" scoped></style> |