annotate client/src/components/importoverview/ImportOverview.vue @ 2720:305af1e2975d

client: table headers: improved component to accept specific widths for columns
author Markus Kottlaender <markus@intevation.de>
date Tue, 19 Mar 2019 12:26:52 +0100
parents 5b990f612420
children 9465749410ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
2717
5b990f612420 import_review: rename overview to review. More space for logs
Thomas Junk <thomas.junk@intevation.de>
parents: 2709
diff changeset
5 title="Import review"
2559
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>
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
18 <div class="p-2 mb-1 d-flex flex-row flex-fill justify-content-between">
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
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>
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
30 <UITableHeader
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
31 :columns="[
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
32 { id: 'id', title: 'Id', width: '79px' },
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
33 {
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
34 id: 'kind',
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
35 title: 'Kind',
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
36 width: '53px'
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
37 },
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
38 {
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
39 id: 'enqueued',
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
40 title: 'Enqueued',
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
41 width: '138px'
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
42 },
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
43 {
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
44 id: 'user',
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
45 title: 'User',
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
46 width: '105px'
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
47 },
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
48 {
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
49 id: 'signer',
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
50 title: 'Signer',
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
51 width: '105px'
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
52 },
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
53 {
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
54 id: 'state',
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
55 title: 'Status',
2720
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
56 width: '72px'
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
57 },
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
58 {
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
59 id: 'warning',
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
60 icon: 'exclamation-triangle',
305af1e2975d client: table headers: improved component to accept specific widths for columns
Markus Kottlaender <markus@intevation.de>
parents: 2717
diff changeset
61 width: '44px'
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
62 }
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
63 ]"
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
64 @sortingChanged="sortBy"
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
65 />
2709
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
66 <div class="debugm logentries">
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
67 <LogEntry
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
68 class="border-top d-flex-flex-column w-100"
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
69 :entry="entry"
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
70 v-for="entry in imports"
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
71 :key="entry.id"
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
72 ></LogEntry>
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
73 </div>
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
74 </div>
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
75 </div>
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
76 </template>
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77
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
78 <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
79 .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
80 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
81 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
82 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
83 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
84 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
85 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
86 left: 0
2699
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
87 .id
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
88 width: 5%
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
89
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
90 .kind
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
91 width: 8%
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
92
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
93 .state
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
94 width: 12%
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
95
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
96 .enqueued
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
97 width: 25
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
98
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
99 .user
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
100 width: 16%
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
101 .signer
ef10f1cd6cb8 import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents: 2666
diff changeset
102 width: 16%
2709
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
103
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
104 .logentries
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
105 overflow-y: auto
fdc392299ff1 import_overview: scrollable and renaming to 'import events'
Thomas Junk <thomas.junk@intevation.de>
parents: 2700
diff changeset
106 max-height: 80vh
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
107 </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
108
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
109 <script>
2578
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
110 /* This is Free Software under GNU Affero General Public License v >= 3.0
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
111 * without warranty, see README.md and license for details.
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
112 *
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
113 * SPDX-License-Identifier: AGPL-3.0-or-later
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
114 * License-Filename: LICENSES/AGPL-3.0.txt
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
115 *
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
116 * Copyright (C) 2018 by via donau
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
117 * – Österreichische Wasserstraßen-Gesellschaft mbH
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
118 * Software engineering by Intevation GmbH
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
119 *
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
120 * Author(s):
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
121 * Thomas Junk <thomas.junk@intevation.de>
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
122 */
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
123
2654
3c04c8e46bd4 importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
124 import { mapState, mapGetters } from "vuex";
2626
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
125 import { displayError, displayInfo } from "@/lib/errors.js";
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
126 import { STATES } from "@/store/imports.js";
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
127
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
128 export default {
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
129 name: "importoverviewalt",
2578
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
130 components: {
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
131 Filters: () => import("./Filters.vue"),
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
132 LogEntry: () => import("./LogEntry.vue")
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
133 },
2619
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
134 data() {
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
135 return {
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
136 loading: false
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
137 };
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
138 },
2578
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
139 computed: {
2654
3c04c8e46bd4 importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
140 ...mapState("imports", ["imports", "reviewed"]),
3c04c8e46bd4 importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
141 ...mapGetters("imports", ["filters"])
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
142 },
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
143 methods: {
2700
58e2d95757ac import_overview: sortBy Dummy added to prevent errors
Thomas Junk <thomas.junk@intevation.de>
parents: 2699
diff changeset
144 sortBy() {},
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
145 loadLogs() {
2619
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
146 this.loading = true;
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
147 this.$store
2654
3c04c8e46bd4 importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents: 2651
diff changeset
148 .dispatch("imports/getImports", this.filters)
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
149 .then(() => {
2619
eb1ec926ff97 client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents: 2618
diff changeset
150 this.loading = false;
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
151 })
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
152 .catch(error => {
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
153 const { status, data } = error.response;
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
154 displayError({
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
155 title: this.$gettext("Backend Error"),
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
156 message: `${status}: ${data.message || data}`
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
157 });
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
158 });
2626
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 save() {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
161 if (!this.reviewed.length) return;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
162
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
163 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
164 this.reviewed.forEach(r => {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
165 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
166 let approved = STATES.APPROVED === r.status;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
167 popupContent += `<tr>
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
168 <td>${imp.id}</td>
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
169 <td>${imp.kind.toUpperCase()}</td>
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
170 <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
171 <td class="text-${approved ? "success" : "danger"}">
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
172 ${this.$gettext(approved ? "approved" : "declined")}
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
173 </td>
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
174 </tr>`;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
175 });
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
176 popupContent += "</table>";
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
177
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
178 this.$store.commit("application/popup", {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
179 icon: "clipboard-check",
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
180 title: this.$gettext("Finish Review"),
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
181 padding: false,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
182 big: true,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
183 content: popupContent,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
184 confirm: {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
185 icon: "check",
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
186 callback: () => {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
187 let data = this.reviewed.map(r => ({
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
188 id: r.id,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
189 state: r.status
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
190 }));
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
191 this.$store
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
192 .dispatch("imports/confirmReview", data)
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
193 .then(response => {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
194 this.loadLogs();
2638
6c1730fc3dc1 client: importsoverview2: clear reviewed array after finishing review
Markus Kottlaender <markus@intevation.de>
parents: 2632
diff changeset
195 this.$store.commit("imports/setReviewed", []);
2626
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
196 const messages = response.data
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
197 .map(x => {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
198 if (x.message) return x.message;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
199 if (x.error) return x.error;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
200 })
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
201 .join("\n\n");
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
202 displayInfo({
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
203 title: "Staging Area",
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
204 message: messages,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
205 options: {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
206 timeout: 0,
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
207 buttons: [{ text: "Ok", action: null, bold: true }]
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
208 }
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
209 });
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
210 })
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
211 .catch(error => {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
212 const { status, data } = error.response;
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
213 displayError({
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
214 title: "Backend Error",
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
215 message: `${status}: ${data.message || data}`
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
216 });
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
217 });
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
218 }
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
219 },
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
220 cancel: {
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
221 label: this.$gettext("Cancel"),
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
222 icon: "times"
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
223 }
50cc5bffd787 client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents: 2619
diff changeset
224 });
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
225 }
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
226 },
2593
956b230c6062 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2592
diff changeset
227 watch: {
956b230c6062 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2592
diff changeset
228 filters() {
956b230c6062 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2592
diff changeset
229 this.$store.dispatch("imports/getImports", this.filters);
956b230c6062 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2592
diff changeset
230 }
956b230c6062 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2592
diff changeset
231 },
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
232 mounted() {
2578
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
233 this.loadLogs();
3ad81357a57c overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2559
diff changeset
234 }
2559
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
235 };
d9e1db955d49 Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
236 </script>