Mercurial > gemma
annotate client/src/components/importoverview/ImportOverview.vue @ 3416:b65c2530c680
client: import review: added button to go back to latest date
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Thu, 23 May 2019 15:31:05 +0200 |
parents | c0f5f62343c9 |
children | e2ed741545e1 |
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" |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
5 :title="importReviewLabel" |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
6 :closeCallback="$parent.close" |
3014
5a3ac4d3dbbb
client: replaced refresh icon in import overview and zoom controls with a more appropriate one
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
7 :actions="[{ callback: loadUpdatedLogs, icon: 'sync' }]" |
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"> |
2894
95e40c87a943
client: applied component name change where it is used
Markus Kottlaender <markus@intevation.de>
parents:
2885
diff
changeset
|
10 <UISpinnerOverlay v-if="loading" /> |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
11 <div class="border-bottom p-2 d-flex 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
|
12 <Filters></Filters> |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
13 <button |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
14 class="btn btn-xs btn-info" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
15 :disabled="!reviewed.length" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
16 @click="save" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
17 > |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
18 <translate>Commit</translate> {{ reviewed.length }} |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
19 </button> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
20 </div> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
21 <div |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
22 class="p-2 d-flex align-items-center justify-content-between border-bottom" |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
23 > |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
24 <button |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
25 :disabled="!this.prev" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
26 @click="earlier" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
27 class="btn btn-xs btn-outline-secondary" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
28 > |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
29 <font-awesome-icon icon="angle-left" fixed-width /> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
30 <translate>Earlier</translate> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
31 </button> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
32 <div class="d-flex align-items-center small"> |
2945
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
33 {{ interval[0] | dateTime(selectedInterval !== $options.LAST_HOUR) }} |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
34 <template v-if="selectedInterval !== $options.TODAY"> |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
35 <span class="mx-2">–</span> |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
36 {{ |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
37 interval[1] | dateTime(selectedInterval !== $options.LAST_HOUR) |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
38 }} |
ab771ea5e4fe
client: importoverview: improved display of date interval
Markus Kottlaender <markus@intevation.de>
parents:
2934
diff
changeset
|
39 </template> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
40 <select |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
41 style="width: 75px; height: 24px" |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
42 class="form-control form-control-sm small ml-2" |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
43 v-model="selectedInterval" |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
44 > |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
45 <option :value="$options.LAST_HOUR"> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
46 <translate>Hour</translate> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
47 </option> |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
48 <option :value="$options.TODAY"><translate>Day</translate></option> |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
49 <option :value="$options.LAST_7_DAYS"> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
50 <translate>7 days</translate> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
51 </option> |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
52 <option :value="$options.LAST_30_DAYS"> |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
53 <translate>30 Days</translate> |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
54 </option> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
55 </select> |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
56 </div> |
3416
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
57 <div class="btn-group"> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
58 <button |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
59 :disabled="!this.next" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
60 @click="later" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
61 class="btn btn-xs btn-outline-secondary" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
62 > |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
63 <translate>Later</translate> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
64 <font-awesome-icon icon="angle-right" fixed-width /> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
65 </button> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
66 <button |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
67 :disabled="!this.next" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
68 @click="now" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
69 class="btn btn-xs btn-outline-secondary" |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
70 > |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
71 <font-awesome-icon icon="angle-double-right" fixed-width /> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
72 </button> |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
73 </div> |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
74 </div> |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
75 <UITableHeader |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
76 :columns="[ |
2779
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
77 { id: 'id', title: `${idLabel}`, width: '79px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
78 { id: 'kind', title: `${kindLabel}`, width: '53px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
79 { id: 'enqueued', title: `${enqueuedLabel}`, width: '138px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
80 { id: 'user', title: `${userLabel}`, width: '105px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
81 { id: 'signer', title: `${signerLabel}`, width: '105px' }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
82 { id: 'state', title: `${statusLabel}`, width: '72px' }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
83 { id: 'warnings', icon: 'exclamation-triangle', width: '44px' } |
2699
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
84 ]" |
ef10f1cd6cb8
import_overview: testwise including header component
Thomas Junk <thomas.junk@intevation.de>
parents:
2666
diff
changeset
|
85 /> |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
86 <!-- |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
87 For server-side sorting, etc simply don't use the sortTable filter. |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
88 Instead you could just pass a function that loads the imports, like: |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
89 :data="loadImports(sortColumn, sortDirection)" |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
90 --> |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
91 <UITableBody |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
92 :data="filteredImports() | sortTable(sortColumn, sortDirection)" |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
93 :isActive="item => item.id === this.show" |
2934
cfa0adbfce63
import_overview: adjust layout height
Thomas Junk <thomas.junk@intevation.de>
parents:
2894
diff
changeset
|
94 maxHeight="70vh" |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
95 > |
2874
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
96 <template v-slot:row="{ item: entry }"> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
97 <LogEntry :entry="entry"></LogEntry> |
b9a6abef9f1c
client: more unified table layout
Markus Kottlaender <markus@intevation.de>
parents:
2847
diff
changeset
|
98 </template> |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
99 <template v-slot:expand="{ item: entry }"> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
100 <LogDetail :entry="entry"></LogDetail> |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
101 </template> |
2725
9465749410ba
client: import overview: use table body component
Markus Kottlaender <markus@intevation.de>
parents:
2720
diff
changeset
|
102 </UITableBody> |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
103 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
104 </div> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
105 </template> |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
106 |
2885
190c84c712e8
client: importoverview: positioned spinner overlay so that it does not cover the controls in the top but only the table
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
107 <style lang="sass" scoped> |
190c84c712e8
client: importoverview: positioned spinner overlay so that it does not cover the controls in the top but only the table
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
108 .spinner-overlay |
190c84c712e8
client: importoverview: positioned spinner overlay so that it does not cover the controls in the top but only the table
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
109 top: 110px |
190c84c712e8
client: importoverview: positioned spinner overlay so that it does not cover the controls in the top but only the table
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
110 </style> |
190c84c712e8
client: importoverview: positioned spinner overlay so that it does not cover the controls in the top but only the table
Markus Kottlaender <markus@intevation.de>
parents:
2880
diff
changeset
|
111 |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
112 <script> |
2578 | 113 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
114 * without warranty, see README.md and license for details. | |
115 * | |
116 * SPDX-License-Identifier: AGPL-3.0-or-later | |
117 * License-Filename: LICENSES/AGPL-3.0.txt | |
118 * | |
119 * Copyright (C) 2018 by via donau | |
120 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
121 * Software engineering by Intevation GmbH | |
122 * | |
123 * Author(s): | |
124 * Thomas Junk <thomas.junk@intevation.de> | |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
125 * Markus Kottländer <markus.kottlaender@intevation.de> |
2578 | 126 */ |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
127 |
2654
3c04c8e46bd4
importoverview: reload reloads current selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2651
diff
changeset
|
128 import { mapState, mapGetters } from "vuex"; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
129 import { displayError, displayInfo } from "@/lib/errors"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
130 import { STATES } from "@/store/imports"; |
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
131 import { sortTable } from "@/lib/mixins"; |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2950
diff
changeset
|
132 import { HTTP } from "@/lib/http"; |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
133 import { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
134 startOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
135 startOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
136 endOfHour, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
137 endOfDay, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
138 addDays, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
139 subDays, |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
140 format |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
141 } from "date-fns"; |
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 export default { |
2578 | 144 components: { |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2950
diff
changeset
|
145 Filters: () => import("./Filters"), |
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2950
diff
changeset
|
146 LogEntry: () => import("./LogEntry"), |
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2950
diff
changeset
|
147 LogDetail: () => import("./LogDetail") |
2578 | 148 }, |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
149 mixins: [sortTable], |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
150 LAST_HOUR: "lasthour", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
151 TODAY: "today", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
152 LAST_7_DAYS: "lastsevendays", |
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
153 LAST_30_DAYS: "lastthirtydays", |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
154 data() { |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
155 return { |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
156 loading: false, |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
157 selectedInterval: this.$options.LAST_HOUR |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
158 }; |
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
159 }, |
2578 | 160 computed: { |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
161 ...mapState("application", ["searchQuery"]), |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
162 ...mapState("imports", [ |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
163 "show", |
2759
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
164 "imports", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
165 "reviewed", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
166 "startDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
167 "endDate", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
168 "prev", |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
169 "next" |
7badd99c9315
import_overview: sprinkled fairydust into the app to make magical timewarp possible for log_overview
Thomas Junk <thomas.junk@intevation.de>
parents:
2753
diff
changeset
|
170 ]), |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
171 ...mapGetters("imports", ["filters"]), |
2760
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
172 importReviewLabel() { |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
173 return this.$gettext("Import review"); |
c6fba10926cc
client:correct a set of strings marking
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2759
diff
changeset
|
174 }, |
2779
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
175 idLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
176 return this.$gettext("Id"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
177 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
178 kindLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
179 return this.$gettext("Kind"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
180 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
181 enqueuedLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
182 return this.$gettext("Enqueued"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
183 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
184 userLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
185 return this.$gettext("User"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
186 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
187 signerLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
188 return this.$gettext("Signer"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
189 }, |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
190 statusLabel() { |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
191 return this.$gettext("Status"); |
21eb85cdfe45
Client: improve a set of strings marking for translations
Fadi Abbud <fadi.abbud@intevation.de>
parents:
2771
diff
changeset
|
192 }, |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
193 interval() { |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
194 return [this.startDate, this.endDate]; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
195 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
196 }, |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
197 watch: { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
198 $route() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
199 const { id } = this.$route.params; |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
200 if (id) this.showSingleRessource(id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
201 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
202 selectedInterval() { |
2950
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
203 this.loadUpdatedLogs(); |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
204 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
205 imports() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
206 if (this.imports.length == 0) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
207 if (this.next) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
208 const [start, end] = this.determineInterval(this.next); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
209 this.$store.commit("imports/setStartDate", start); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
210 this.$store.commit("imports/setEndDate", end); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
211 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
212 } else if (this.prev) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
213 const [start, end] = this.determineInterval(this.prev); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
214 this.$store.commit("imports/setStartDate", start); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
215 this.$store.commit("imports/setEndDate", end); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
216 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
217 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
218 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
219 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
220 filters() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
221 this.loadLogs(); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
222 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2874
diff
changeset
|
223 }, |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
224 methods: { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
225 showSingleRessource(id) { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
226 id = id * 1; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
227 this.loadDetails(id) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
228 .then(response => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
229 this.$store.commit("imports/setCurrentDetails", response.data); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
230 const { enqueued } = response.data; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
231 this.$store.commit("imports/setStartDate", startOfHour(enqueued)); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
232 this.$store.commit("imports/setEndDate", endOfHour(enqueued)); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
233 this.$store.commit("imports/showDetailsFor", id); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
234 this.loadLogs(); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
235 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
236 .catch(error => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
237 this.loading = false; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
238 this.$store.commit("imports/setCurrentDetails", {}); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
239 const { status, data } = error.response; |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
240 displayError({ |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
241 title: this.$gettext("Backend Error"), |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
242 message: `${status}: ${data.message || data}` |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
243 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
244 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
245 }, |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
246 loadDetails(id) { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
247 return new Promise((resolve, reject) => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
248 HTTP.get("/imports/" + id, { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
249 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
250 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
251 .then(response => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
252 resolve(response); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
253 }) |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
254 .catch(error => { |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
255 reject(error); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
256 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
257 }); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
258 }, |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
259 determineInterval(pointInTime) { |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
260 let start, end; |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
261 switch (this.selectedInterval) { |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
262 case this.$options.LAST_HOUR: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
263 start = startOfHour(pointInTime); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
264 end = endOfHour(pointInTime); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
265 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
266 case this.$options.TODAY: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
267 start = startOfDay(pointInTime); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
268 end = endOfDay(pointInTime); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
269 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
270 case this.$options.LAST_7_DAYS: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
271 start = startOfDay(pointInTime); |
2847
4da07a11e6e1
import_overview: fix date calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2840
diff
changeset
|
272 end = endOfDay(addDays(start, 7)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
273 break; |
2877
55a9c7965e25
client: importoverview: fixed interval select fix
Markus Kottlaender <markus@intevation.de>
parents:
2876
diff
changeset
|
274 case this.$options.LAST_30_DAYS: |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
275 start = startOfDay(pointInTime); |
2847
4da07a11e6e1
import_overview: fix date calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2840
diff
changeset
|
276 end = endOfDay(addDays(start, 30)); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
277 break; |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
278 } |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
279 return [start, end]; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
280 }, |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
281 earlier() { |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
282 if (!this.prev) return; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
283 const [start, end] = this.determineInterval(this.prev); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
284 this.$store.commit("imports/setStartDate", start); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
285 this.$store.commit("imports/setEndDate", end); |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
286 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
287 }, |
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
288 later() { |
2769
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
289 if (!this.next) return; |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
290 const [start, end] = this.determineInterval(this.next); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
291 this.$store.commit("imports/setStartDate", start); |
c2a2515c7a72
import_overview: hopefully fixed dancing bug
Thomas Junk <thomas.junk@intevation.de>
parents:
2768
diff
changeset
|
292 this.$store.commit("imports/setEndDate", end); |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
293 this.loadLogs(); |
2745
d2896bb852e7
import_overview: paging interval selection
Thomas Junk <thomas.junk@intevation.de>
parents:
2740
diff
changeset
|
294 }, |
3416
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
295 now() { |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
296 if (!this.next) return; |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
297 const [start, end] = this.determineInterval(new Date()); |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
298 this.$store.commit("imports/setStartDate", start); |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
299 this.$store.commit("imports/setEndDate", end); |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
300 this.loadLogs(); |
b65c2530c680
client: import review: added button to go back to latest date
Markus Kottlaender <markus@intevation.de>
parents:
3409
diff
changeset
|
301 }, |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
302 filteredImports() { |
2749
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
303 return this.imports; |
2738
add2d47c2567
client: tables: implemented simple default sorting
Markus Kottlaender <markus@intevation.de>
parents:
2734
diff
changeset
|
304 }, |
2789
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
305 loadUpdatedLogs() { |
2950
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
306 const now = new Date(); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
307 switch (this.selectedInterval) { |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
308 case this.$options.LAST_HOUR: |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
309 this.$store.commit("imports/setStartDate", startOfHour(now)); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
310 this.$store.commit("imports/setEndDate", now); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
311 break; |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
312 case this.$options.TODAY: |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
313 this.$store.commit("imports/setStartDate", startOfDay(now)); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
314 this.$store.commit("imports/setEndDate", now); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
315 break; |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
316 case this.$options.LAST_7_DAYS: |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
317 this.$store.commit( |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
318 "imports/setStartDate", |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
319 subDays(startOfDay(now), 7) |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
320 ); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
321 this.$store.commit("imports/setEndDate", now); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
322 break; |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
323 case this.$options.LAST_30_DAYS: |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
324 this.$store.commit( |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
325 "imports/setStartDate", |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
326 subDays(startOfDay(now), 30) |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
327 ); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
328 this.$store.commit("imports/setEndDate", now); |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
329 break; |
1775ffa65504
import_overview: fix time calculation
Thomas Junk <thomas.junk@intevation.de>
parents:
2945
diff
changeset
|
330 } |
2789
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
331 this.loadLogs(); |
c1e832f77726
import_overview: setting a sane default window in case of reload
Thomas Junk <thomas.junk@intevation.de>
parents:
2785
diff
changeset
|
332 }, |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
333 loadLogs() { |
2619
eb1ec926ff97
client: importoverview2: added refresh button
Markus Kottlaender <markus@intevation.de>
parents:
2618
diff
changeset
|
334 this.loading = true; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
335 this.$store |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
336 .dispatch("imports/getImports", { |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
337 filter: this.filters, |
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
338 from: format(this.startDate, "YYYY-MM-DDTHH:mm:ss.SSS"), |
2749
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
339 to: format(this.endDate, "YYYY-MM-DDTHH:mm:ss.SSS"), |
cd789302b3e2
import_overview: start is initially always beginning of current hour
Thomas Junk <thomas.junk@intevation.de>
parents:
2748
diff
changeset
|
340 query: this.searchQuery |
2748
c6695d6e9334
import_overview: filtering date interval via backend
Thomas Junk <thomas.junk@intevation.de>
parents:
2745
diff
changeset
|
341 }) |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
342 .then(() => { |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
343 if (this.show) { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
344 this.loadDetails(this.show) |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
345 .then(response => { |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
346 this.$store.commit("imports/setCurrentDetails", response.data); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
347 this.loading = false; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
348 }) |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
349 .catch(error => { |
2796
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
350 this.loading = false; |
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
351 this.$store.commit("imports/setCurrentDetails", {}); |
2771
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
352 const { status, data } = error.response; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
353 displayError({ |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
354 title: this.$gettext("Backend Error"), |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
355 message: `${status}: ${data.message || data}` |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
356 }); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
357 }); |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
358 } else { |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
359 this.loading = false; |
838cf903538f
import_overview: on refresh reload current details
Thomas Junk <thomas.junk@intevation.de>
parents:
2769
diff
changeset
|
360 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
361 }) |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
362 .catch(error => { |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
363 const { status, data } = error.response; |
2796
718ec88fbeed
import_overview: disable loading spinner in case of errors
Thomas Junk <thomas.junk@intevation.de>
parents:
2789
diff
changeset
|
364 this.loading = false; |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
365 displayError({ |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
366 title: this.$gettext("Backend Error"), |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
367 message: `${status}: ${data.message || data}` |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
368 }); |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
369 }); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
370 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
371 save() { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
372 if (!this.reviewed.length) return; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
373 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
374 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
|
375 this.reviewed.forEach(r => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
376 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
|
377 let approved = STATES.APPROVED === r.status; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
378 popupContent += `<tr> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
379 <td>${imp.id}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
380 <td>${imp.kind.toUpperCase()}</td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
381 <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
|
382 <td class="text-${approved ? "success" : "danger"}"> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
383 ${this.$gettext(approved ? "approved" : "declined")} |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
384 </td> |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
385 </tr>`; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
386 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
387 popupContent += "</table>"; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
388 |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
389 this.$store.commit("application/popup", { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
390 icon: "clipboard-check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
391 title: this.$gettext("Finish Review"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
392 padding: false, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
393 big: true, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
394 content: popupContent, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
395 confirm: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
396 icon: "check", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
397 callback: () => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
398 let data = this.reviewed.map(r => ({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
399 id: r.id, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
400 state: r.status |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
401 })); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
402 this.$store |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
403 .dispatch("imports/confirmReview", data) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
404 .then(response => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
405 this.loadLogs(); |
2638
6c1730fc3dc1
client: importsoverview2: clear reviewed array after finishing review
Markus Kottlaender <markus@intevation.de>
parents:
2632
diff
changeset
|
406 this.$store.commit("imports/setReviewed", []); |
3409
c0f5f62343c9
client: import review: refresh map layers after accepting/declining imports
Markus Kottlaender <markus@intevation.de>
parents:
3014
diff
changeset
|
407 this.$store.dispatch("map/refreshLayers"); |
2626
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
408 const messages = response.data |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
409 .map(x => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
410 if (x.message) return x.message; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
411 if (x.error) return x.error; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
412 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
413 .join("\n\n"); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
414 displayInfo({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
415 title: "Staging Area", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
416 message: messages, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
417 options: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
418 timeout: 0, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
419 buttons: [{ text: "Ok", action: null, bold: true }] |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
420 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
421 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
422 }) |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
423 .catch(error => { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
424 const { status, data } = error.response; |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
425 displayError({ |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
426 title: "Backend Error", |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
427 message: `${status}: ${data.message || data}` |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
428 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
429 }); |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
430 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
431 }, |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
432 cancel: { |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
433 label: this.$gettext("Cancel"), |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
434 icon: "times" |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
435 } |
50cc5bffd787
client: importoverview2: implemented Finish Review (confirm) dialog
Markus Kottlaender <markus@intevation.de>
parents:
2619
diff
changeset
|
436 }); |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
437 } |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
438 }, |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
439 mounted() { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
440 const { id } = this.$route.params; |
2880
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
441 if (id) { |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
442 this.showSingleRessource(id); |
c40540889b53
client: code cleanup, slight style improvements
Markus Kottlaender <markus@intevation.de>
parents:
2877
diff
changeset
|
443 } else { |
2799
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
444 this.$store.commit("application/searchQuery", ""); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
445 this.loadLogs(); |
e19fac818aab
import_overview: specifying single imports via URL should open the overview with all logentries of the according hour and open the details for the specified import
Thomas Junk <thomas.junk@intevation.de>
parents:
2796
diff
changeset
|
446 } |
2578 | 447 } |
2559
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
448 }; |
d9e1db955d49
Backed out changeset 91c68153e7b6
Thomas Junk <thomas.junk@intevation.de>
parents:
diff
changeset
|
449 </script> |