Mercurial > gemma
annotate client/src/components/importconfiguration/types/ApprovedGaugeMeasurement.vue @ 4329:83eb99662a91
client: improve ability to test FW diagrams
* Restructure code in fairwayavailability.js to seperate external data
retrieval and adding the data into the store. Good side effects are
that using a mutation for setting test data is easier and only
one commit call is necessary, which means less clutter in the state history.
* Adding an example how to use this for testing to docs/developers.md .
* Bump copyright year for one file.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 04 Sep 2019 17:05:43 +0200 |
parents | 439e1865a2d2 |
children | 008bc1ae8897 |
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> |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
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="d-flex 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> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
24 <div class="d-flex flex-column text-left w-25"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
25 <label class="text-nowrap" for="originator"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
26 <small class="text-muted" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
27 >{{ $options.ORIGINATOR }} / {{ $options.FROM }}</small |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
28 > |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
29 </label> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
30 <input |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
31 type="text" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
32 v-model="originator" |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
33 class="form-control form-control-sm" |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
34 id="originator" |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
35 /> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
36 <span class="text-left text-danger"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
37 <small v-if="!originator"> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
38 <translate>Please enter an originator</translate> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
39 </small> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
40 </span> |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
41 </div> |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
42 </div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
43 <div class="mt-4 flex-column px-2 w-100"> |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
44 <div class="custom-file"> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
45 <input |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
46 accept=".csv" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
47 type="file" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
48 @change="fileSelected" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
49 class="custom-file-input" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
50 id="uploadFile" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
51 /> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
52 <label class="pointer custom-file-label" for="uploadFile"> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
53 {{ uploadLabel }} |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
54 </label> |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
55 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
56 </div> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
57 <div class="d-flex w-100 mt-3 border-top justify-content-between p-2"> |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
58 <button :key="1" @click="back()" class="btn btn-sm btn-warning"> |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
59 Back |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
60 </button> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
61 <button |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
62 :key="2" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
63 type="submit" |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
64 @click="submit" |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3156
diff
changeset
|
65 class="btn btn-sm btn-info" |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
66 > |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
67 <translate>Submit</translate> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
68 </button> |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
69 </div> |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
70 </div> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
71 </template> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
72 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
73 <script> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
74 /* 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
|
75 * 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
|
76 * |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
77 * 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
|
78 * 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
|
79 * |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
80 * Copyright (C) 2018 by via donau |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
81 * – Ö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
|
82 * 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
|
83 * |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 * Author(s): |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 * 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
|
86 */ |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
87 |
1784
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
88 import { HTTP } from "@/lib/http"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2978
diff
changeset
|
89 import { displayError, displayInfo } from "@/lib/errors"; |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
90 import app from "@/main"; |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
91 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
92 export default { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
93 name: "importapprovedgaugemeasurements", |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
94 data() { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
95 return { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 disableUploadButton: false, |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 uploadLabel: this.$gettext("choose file to upload"), |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
98 uploadFile: null, |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
99 originator: "viadonau", |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
100 eMailNotification: false |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
101 }; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
102 }, |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
103 computed: { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
104 importGaugmeasurmentLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
105 return this.$gettext("Import approved gaugemeasurements"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
106 } |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2534
diff
changeset
|
107 }, |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
108 methods: { |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
109 back() { |
2975
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2974
diff
changeset
|
110 this.uploadLabel = this.$gettext("choose file to upload"); |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2974
diff
changeset
|
111 this.uploadFile = null; |
2a29bf8776d0
unified_imports: waterway profiles moved to new UI
Thomas Junk <thomas.junk@intevation.de>
parents:
2974
diff
changeset
|
112 this.originator = "viadonau"; |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
113 this.$store.commit("importschedule/setListMode"); |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
114 }, |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
115 fileSelected(e) { |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
116 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
|
117 if (!files) return; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
118 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
|
119 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
|
120 }, |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
121 submit() { |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
122 if (!this.originator || !this.uploadFile) return; |
1784
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
123 let formData = new FormData(); |
2255
33af355047e1
Approved gauge meassurement import: Unified file upload parameter to 'agm'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2154
diff
changeset
|
124 formData.append("agm", this.uploadFile); |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
125 formData.append("originator", this.originator); |
3013
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
126 if (this.eMailNotification) { |
30222bcbfec9
import_configuration: add email option to onetime imports
Thomas Junk <thomas.junk@intevation.de>
parents:
2985
diff
changeset
|
127 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
|
128 } |
2144
e22a354a2312
approved_gauge_measurements: url adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
2123
diff
changeset
|
129 HTTP.post("/imports/agm", formData, { |
1784
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
130 headers: { |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
131 "X-Gemma-Auth": localStorage.getItem("token"), |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
132 "Content-Type": "multipart/form-data" |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
133 } |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
134 }) |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
135 .then(() => { |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
136 displayInfo({ |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
137 title: this.$gettext("Import"), |
1804 | 138 message: this.$gettext( |
139 "Starting import of Approved Gauge Measurements" | |
140 ) | |
1784
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
141 }); |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2919
diff
changeset
|
142 this.back(); |
1784
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
143 }) |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
144 .catch(error => { |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
145 const { status, data } = error.response; |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
146 displayError({ |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
147 title: this.$gettext("Backend Error"), |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
148 message: `${status}: ${data.message || data}` |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
149 }); |
724758455a4e
Submit Approved Gaugemeasurements data to backend.
Sascha Wilde <wilde@intevation.de>
parents:
1753
diff
changeset
|
150 }); |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
151 } |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
152 }, |
2366
ff1e4f1b54c6
agm_import: originator field added
Thomas Junk <thomas.junk@intevation.de>
parents:
2255
diff
changeset
|
153 ORIGINATOR: app.$gettext("originator"), |
3156
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
154 FROM: app.$gettext("from"), |
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
155 on: "on", |
cb3b31566e48
import_configuration: added missing labels
Thomas Junk <thomas.junk@intevation.de>
parents:
3013
diff
changeset
|
156 off: "off" |
1753
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
157 }; |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
158 </script> |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
159 |
68bd990dd8e5
feat: added import dialogs for approved gauge meas. and waterway profiles
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
160 <style lang="scss" scoped></style> |