Mercurial > gemma
annotate client/src/components/importoverview/ImportOverview.vue @ 2654:3c04c8e46bd4
importoverview: reload reloads current selection
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 14 Mar 2019 15:37:10 +0100 |
parents | 9f3856337f55 |
children | 0d2650dd8f62 |
rev | line source |
---|---|
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
1 <template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
2 <div class="overview"> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
3 <UIBoxHeader |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
4 icon="clipboard-check" |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
5 title="Staging Area" |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 :closeCallback="$parent.close" |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
7 :actions="[{ callback: loadLogs, icon: 'redo' }]" |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
8 /> |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
9 <div class="position-relative"> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
10 <transition name="fade"> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
11 <div |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
12 class="loading d-flex justify-content-center align-items-center" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
13 v-if="loading" |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
14 > |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
15 <font-awesome-icon icon="spinner" spin /> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
16 </div> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
17 </transition> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
18 <div class="p-2 d-flex flex-row flex-fill justify-content-between"> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
19 <Filters></Filters> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
20 <div> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
21 <button |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
22 class="btn btn-sm btn-info" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
23 :disabled="!reviewed.length" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
24 @click="save" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
25 > |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
26 <translate>Commit</translate> {{ reviewed.length }} |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
27 </button> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
28 </div> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
29 </div> |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
30 <LogEntry |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
31 class="border-top d-flex-flex-column w-100" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
32 :entry="entry" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
33 v-for="entry in imports" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
34 :key="entry.id" |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
35 ></LogEntry> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
36 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
37 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
38 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
39 |
2632
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
40 <style lang="sass" scoped> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
41 .loading |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
42 background: rgba(255, 255, 255, 0.9) |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
43 position: absolute |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
44 z-index: 99 |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
45 top: 0 |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
46 right: 0 |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
47 bottom: 0 |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
48 left: 0 |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
49 </style> |
0b14de0bb85f
client: importoverview2: moved refresh button to box header, added loading animation like in other boxes
Markus Kottlaender <markus@intevation.de>
parents:
2626
diff
changeset
|
50 |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
51 <script> |
2578 | 52 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
53 * without warranty, see README.md and license for details. | |
54 * | |
55 * SPDX-License-Identifier: AGPL-3.0-or-later | |
56 * License-Filename: LICENSES/AGPL-3.0.txt | |
57 * | |
58 * Copyright (C) 2018 by via donau | |
59 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
60 * Software engineering by Intevation GmbH | |
61 * | |
62 * Author(s): | |
63 * Thomas Junk <thomas.junk@intevation.de> | |
64 */ | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
65 |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
66 import { mapState, mapGetters } from "vuex"; |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
67 import { displayError, displayInfo } from "@/lib/errors.js"; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
68 import { STATES } from "@/store/imports.js"; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
69 |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
70 export default { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
71 name: "importoverviewalt", |
2578 | 72 components: { |
73 Filters: () => import("./Filters.vue"), | |
74 LogEntry: () => import("./LogEntry.vue") | |
75 }, | |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
76 data() { |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
77 return { |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
78 loading: false |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
79 }; |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
80 }, |
2578 | 81 computed: { |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
82 ...mapState("imports", ["imports", "reviewed"]), |
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
83 ...mapGetters("imports", ["filters"]) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
84 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
85 methods: { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
86 loadLogs() { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
87 this.loading = true; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
88 this.$store |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
89 .dispatch("imports/getImports", this.filters) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
90 .then(() => { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
91 this.loading = false; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
92 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
93 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
94 const { status, data } = error.response; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
95 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
96 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
97 message: `${status}: ${data.message || data}` |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
98 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
99 }); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
100 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
101 save() { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
102 if (!this.reviewed.length) return; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
103 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
104 let popupContent = `<table class="table table-sm small mb-0 border-0" style="margin-top: -1px;">`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
105 this.reviewed.forEach(r => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
106 let imp = this.imports.find(i => i.id === r.id); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
107 let approved = STATES.APPROVED === r.status; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
108 popupContent += `<tr> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
109 <td>${imp.id}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
110 <td>${imp.kind.toUpperCase()}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
111 <td>${this.$options.filters.dateTime(imp.enqueued)}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
112 <td class="text-${approved ? "success" : "danger"}"> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
113 ${this.$gettext(approved ? "approved" : "declined")} |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
114 </td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
115 </tr>`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
116 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
117 popupContent += "</table>"; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
118 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
119 this.$store.commit("application/popup", { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
120 icon: "clipboard-check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
121 title: this.$gettext("Finish Review"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
122 padding: false, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
123 big: true, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
124 content: popupContent, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
125 confirm: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
126 icon: "check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
127 callback: () => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
128 let data = this.reviewed.map(r => ({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
129 id: r.id, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
130 state: r.status |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
131 })); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
132 this.$store |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
133 .dispatch("imports/confirmReview", data) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
134 .then(response => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
135 this.loadLogs(); |
2638
6c1730fc3dc1
client: importsoverview2: clear reviewed array after finishing review
Markus Kottlaender <markus@intevation.de>
parents:
2632
diff
changeset
|
136 this.$store.commit("imports/setReviewed", []); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
137 const messages = response.data |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
138 .map(x => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
139 if (x.message) return x.message; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
140 if (x.error) return x.error; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
141 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
142 .join("\n\n"); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
143 displayInfo({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
144 title: "Staging Area", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
145 message: messages, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
146 options: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
147 timeout: 0, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
148 buttons: [{ text: "Ok", action: null, bold: true }] |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
149 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
150 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
151 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
152 .catch(error => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
153 const { status, data } = error.response; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
154 displayError({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
155 title: "Backend Error", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
156 message: `${status}: ${data.message || data}` |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
157 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
158 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
159 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
160 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
161 cancel: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
162 label: this.$gettext("Cancel"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
163 icon: "times" |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
164 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
165 }); |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
166 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
167 }, |
2593 | 168 watch: { |
169 filters() { | |
170 this.$store.dispatch("imports/getImports", this.filters); | |
171 } | |
172 }, | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
173 mounted() { |
2578 | 174 this.loadLogs(); |
175 } | |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
176 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
177 </script> |