Mercurial > gemma
annotate client/src/components/importconfiguration/Import.vue @ 5307:4ba3fda13c50 zpg-exception
Fixed typo in migration script.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 28 May 2021 11:17:12 +0200 |
parents | 9f0830a1845d |
children |
rev | line source |
---|---|
2968 | 1 <template> |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
2 <div> |
3023
5d06629a14df
client: imports: added missing close button
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
3 <UIBoxHeader icon="clock" :title="title" :closeCallback="$parent.close" /> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
4 <div v-if="mode === $options.MODES.LIST"> |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
5 <UISpinnerOverlay v-if="loading" /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
6 <UITableHeader |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
7 :columns="[ |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
8 { id: 'id', title: `${idLabel}`, width: '60px;' }, |
4981
9f0830a1845d
squashed the total layout to enable display of long fm importnames
Thomas Junk <thomas.junk@intevation.de>
parents:
4975
diff
changeset
|
9 { id: 'kind', title: `${typeLabel}`, width: '125px;' }, |
4975
b599ad718971
layout fix for FM imports
Thomas Junk <thomas.junk@intevation.de>
parents:
4924
diff
changeset
|
10 { id: 'user', title: `${ownerLabel}`, width: '220px' }, |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
11 { id: 'country', title: `${countryLabel}`, width: '80px' }, |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
12 { id: 'config.cron', title: `${scheduleLabel}`, width: '100px' }, |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
13 { id: 'config.send-email', title: `${emailLabel}`, width: '70px' } |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
14 ]" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
15 /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
16 <UITableBody |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
17 :data="filteredSchedules | sortTable(sortColumn, sortDirection)" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
18 :isActive="item => currentSchedule && item.id === currentSchedule.id" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
19 > |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
20 <template v-slot:row="{ item: schedule }"> |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
21 <div style="width:60px" class="table-cell py-1"> |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
22 {{ schedule.id }} |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
23 </div> |
4981
9f0830a1845d
squashed the total layout to enable display of long fm importnames
Thomas Junk <thomas.junk@intevation.de>
parents:
4975
diff
changeset
|
24 <div style="width:125px" class="table-cell py-1"> |
4924
565da29060e7
Strip prefix 'fm_' in import configuration overview
Thomas Junk <thomas.junk@intevation.de>
parents:
4914
diff
changeset
|
25 {{ schedule.kind.replace("fm_", "").toUpperCase() }} |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
26 </div> |
4975
b599ad718971
layout fix for FM imports
Thomas Junk <thomas.junk@intevation.de>
parents:
4924
diff
changeset
|
27 <div style="width:220px;" class="table-cell py-1"> |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
28 {{ schedule.user }} |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
29 </div> |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
30 <div style="width:80px;" class="table-cell py-1"> |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
31 {{ userCountries[schedule.user] }} |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
32 </div> |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
33 <div style="width:100px" class="table-cell py-1"> |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
34 {{ schedule.config.cron }} |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
35 </div> |
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
36 <div style="width:70px" class="table-cell py-1 truncate"> |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
37 <font-awesome-icon |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
38 v-if="schedule.config['send-email']" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
39 class="fa-fw mr-2" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
40 fixed-width |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
41 icon="check" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
42 /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
43 </div> |
4876
6a8d967baf1d
import configuration: overhaul table layout to have lined up borders
Thomas Junk <thomas.junk@intevation.de>
parents:
4869
diff
changeset
|
44 <div class="table-cell py-1 justify-content-end"> |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
45 <button |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
46 @click="triggerManualImport(schedule.id)" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
47 class="btn btn-xs btn-dark mr-1" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
48 :disabled="importScheduleDetailVisible" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
49 > |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
50 <font-awesome-icon icon="play" fixed-width /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
51 </button> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
52 <button |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
53 @click="editSchedule(schedule.id)" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
54 class="btn btn-xs btn-dark mr-1" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
55 :disabled="importScheduleDetailVisible" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
56 > |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
57 <font-awesome-icon icon="pencil-alt" fixed-width /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
58 </button> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
59 <button |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
60 @click="deleteSchedule(schedule)" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
61 class="btn btn-xs btn-dark" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
62 :disabled="importScheduleDetailVisible" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
63 > |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
64 <font-awesome-icon icon="trash" fixed-width /> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
65 </button> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
66 </div> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
67 </template> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
68 </UITableBody> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
69 </div> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
70 <ImportDetails v-if="mode === $options.MODES.EDIT"></ImportDetails> |
3281
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
71 <div |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
72 class="text-right border-top p-2" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
73 v-if="mode === $options.MODES.LIST && !isOnetime" |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
74 > |
439e1865a2d2
client: define stretches/imports: code cleanup / style improvements
Markus Kottlaender <markus@intevation.de>
parents:
3023
diff
changeset
|
75 <button :key="3" @click="newConfiguration()" class="btn btn-sm btn-info"> |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
76 <translate>New import</translate> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
77 </button> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
78 </div> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
79 </div> |
2968 | 80 </template> |
81 | |
82 <script> | |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
83 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
84 * without warranty, see README.md and license for details. |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
85 * |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
86 * SPDX-License-Identifier: AGPL-3.0-or-later |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
87 * License-Filename: LICENSES/AGPL-3.0.txt |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
88 * |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
89 * Copyright (C) 2018 by via donau |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
90 * – Österreichische Wasserstraßen-Gesellschaft mbH |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
91 * Software engineering by Intevation GmbH |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
92 * |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
93 * Author(s): |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
94 * Thomas Junk <thomas.junk@intevation.de> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
95 * Markus Kottländer <markus.kottlaender@intevation.de> |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
96 */ |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
97 import { mapState, mapGetters } from "vuex"; |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
98 import { displayInfo, displayError } from "@/lib/errors"; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
99 import { HTTP } from "@/lib/http"; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
100 import { |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
101 IMPORTTYPES, |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
102 MODES |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
103 // IMPORTTYPEKIND, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
104 // initializeCurrentSchedule |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
105 } from "@/store/importschedule"; |
3558
fb810668e45d
client: import configuration: added missing sortTable mixin
Markus Kottlaender <markus@intevation.de>
parents:
3510
diff
changeset
|
106 import { sortTable } from "@/lib/mixins"; |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
107 |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
108 export default { |
3558
fb810668e45d
client: import configuration: added missing sortTable mixin
Markus Kottlaender <markus@intevation.de>
parents:
3510
diff
changeset
|
109 mixins: [sortTable], |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
110 components: { |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2980
diff
changeset
|
111 ImportDetails: () => import("./ImportDetails") |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
112 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
113 data() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
114 return { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
115 loading: false, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
116 sortColumn: "", |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
117 sortDirection: "" |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
118 }; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
119 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
120 methods: { |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
121 back() { |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
122 this.$store.commit("importschedule/setListMode"); |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
123 }, |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
124 newConfiguration() { |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
125 this.$store.commit("importschedule/setEditMode"); |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
126 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
127 getSchedules() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
128 this.loading = true; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
129 this.$store |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
130 .dispatch("importschedule/loadSchedules") |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
131 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
132 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
133 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
134 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
135 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
136 } |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
137 displayError({ |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
138 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
139 message: message |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
140 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
141 }) |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
142 .finally(() => { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
143 this.loading = false; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
144 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
145 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
146 editSchedule(id) { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
147 this.$store |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
148 .dispatch("importschedule/loadSchedule", id) |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
149 .then(() => { |
2980
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
150 this.$store.commit("importschedule/setEditMode"); |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
151 }) |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
152 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
153 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
154 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
155 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
156 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
157 } |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
158 displayError({ |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
159 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
160 message: message |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
161 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
162 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
163 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
164 triggerManualImport(id) { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
165 HTTP.get("/imports/config/" + id + "/run", { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
166 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
167 }) |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
168 .then(response => { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
169 const { id } = response.data; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
170 displayInfo({ |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
171 title: this.$gettext("Imports"), |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
172 message: this.$gettext("Manually triggered import: #") + id |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
173 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
174 }) |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
175 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
176 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
177 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
178 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
179 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
180 } |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
181 displayError({ |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
182 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
183 message: message |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
184 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
185 }); |
2980
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
186 }, |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
187 deleteSchedule(schedule) { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
188 this.$store.commit("application/popup", { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
189 icon: "trash", |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
190 title: this.$gettext("Delete Import"), |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
191 content: |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
192 this.$gettext("Do you really want to delete the import with ID") + |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
193 `<b>${schedule.id}</b>` + |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
194 this.$gettext("of type") + |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
195 `<b>${schedule.kind.toUpperCase()}</b>?`, |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
196 confirm: { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
197 label: this.$gettext("Delete"), |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
198 icon: "trash", |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
199 callback: () => { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
200 this.$store |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
201 .dispatch("importschedule/deleteSchedule", schedule.id) |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
202 .then(() => { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
203 this.getSchedules(); |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
204 displayInfo({ |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
205 title: this.$gettext("Imports"), |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
206 message: this.$gettext("Deleted import: #") + schedule.id |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
207 }); |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
208 }) |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
209 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
210 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
211 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
212 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
213 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
214 } |
2980
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
215 displayError({ |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
216 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
217 message: message |
2980
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
218 }); |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
219 }); |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
220 } |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
221 }, |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
222 cancel: { |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
223 label: this.$gettext("Cancel"), |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
224 icon: "times" |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
225 } |
a9b61290fcc2
unified_imports: edit capabilities added
Thomas Junk <thomas.junk@intevation.de>
parents:
2979
diff
changeset
|
226 }); |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
227 } |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
228 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
229 computed: { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
230 ...mapState("application", ["searchQuery"]), |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
231 ...mapState("importschedule", [ |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
232 "mode", |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
233 "schedules", |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
234 "currentSchedule", |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
235 "importScheduleDetailVisible" |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
236 ]), |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
237 ...mapGetters("usermanagement", ["userCountries"]), |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
238 countryLabel() { |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
239 return this.$gettext("Country"); |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
240 }, |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
241 isOnetime() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
242 for (let kind of [ |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
243 this.$options.IMPORTTYPES.SOUNDINGRESULTS, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
244 this.$options.IMPORTTYPES.APPROVEDGAUGEMEASUREMENTS, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
245 this.$options.IMPORTTYPES.WATERWAYPROFILES |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
246 ]) { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
247 if (kind === this.currentSchedule.importType) return true; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
248 } |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
249 return false; |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
250 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
251 title() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
252 return this.$gettext("Imports"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
253 }, |
3676
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
254 enhancedSchedules() { |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
255 return this.schedules.map(x => { |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
256 x["country"] = this.userCountries[x.user]; |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
257 return x; |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
258 }); |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
259 }, |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
260 filteredSchedules() { |
3676
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
261 return this.enhancedSchedules.filter(s => { |
f107e82b64ae
import_configuration: enhance schedule with country of user
Thomas Junk <thomas.junk@intevation.de>
parents:
3674
diff
changeset
|
262 return (s.id + s.kind + s.user + s.country) |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
263 .toLowerCase() |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
264 .includes(this.searchQuery.toLowerCase()); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
265 }); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
266 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
267 importScheduleLabel() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
268 return this.$gettext("Import Schedule"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
269 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
270 idLabel() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
271 return this.$gettext("ID"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
272 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
273 typeLabel() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
274 return this.$gettext("Type"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
275 }, |
3559
c220ad7e61ed
client: import review/configuration: unified column names in table (User/Author -> Owner)
Markus Kottlaender <markus@intevation.de>
parents:
3558
diff
changeset
|
276 ownerLabel() { |
c220ad7e61ed
client: import review/configuration: unified column names in table (User/Author -> Owner)
Markus Kottlaender <markus@intevation.de>
parents:
3558
diff
changeset
|
277 return this.$gettext("Owner"); |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
278 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
279 scheduleLabel() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
280 return this.$gettext("Schedule"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
281 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
282 emailLabel() { |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
283 return this.$gettext("Email"); |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
284 } |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
285 }, |
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
286 mounted() { |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
287 this.$store |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
288 .dispatch("usermanagement/loadUsers") |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
289 .then(() => { |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
290 this.$store.commit("importschedule/setListMode"); |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
291 this.$store.commit("importschedule/clearCurrentSchedule"); |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
292 this.getSchedules(); |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
293 }) |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
294 .catch(error => { |
4869
6b054b91d9b2
backend not reachable as error message etd. Login adjusted
Thomas Junk <thomas.junk@intevation.de>
parents:
4868
diff
changeset
|
295 let message = "Backend not reachable"; |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
296 if (error.response) { |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
297 const { status, data } = error.response; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
298 message = `${status}: ${data.message || data}`; |
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
299 } |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
300 displayError({ |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
301 title: this.$gettext("Backend Error"), |
4868
008bc1ae8897
exception handling
Thomas Junk <thomas.junk@intevation.de>
parents:
4454
diff
changeset
|
302 message: message |
3510
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
303 }); |
4d7b481e1d39
import_configuration_overview: user country column
Thomas Junk <thomas.junk@intevation.de>
parents:
3281
diff
changeset
|
304 }); |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
305 }, |
2974
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
306 IMPORTTYPES: IMPORTTYPES, |
e161e1ffb6b5
unified_imports: AGM moved to new interface
Thomas Junk <thomas.junk@intevation.de>
parents:
2972
diff
changeset
|
307 MODES: MODES |
2972
6f351e00e579
unified_imports: initial layout etd
Thomas Junk <thomas.junk@intevation.de>
parents:
2968
diff
changeset
|
308 }; |
2968 | 309 </script> |