annotate client/src/components/importoverview/LogEntry.vue @ 2647:c52bf6f994c0

overview2: bottleneckview added
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 14 Mar 2019 14:07:25 +0100
parents 359f5f0037f5
children 8299cce986a2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
1 <template>
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
2 <div class="logentry">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
3 <div class="row no-gutters text-left">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
4 <div style="width: 4%;" class="text-center">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
5 <font-awesome-icon
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
6 @click="toggleDetails"
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
7 class="my-auto mr-1 text-info pointer"
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
8 :icon="entry.id === show ? 'angle-down' : 'angle-right'"
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
9 fixed-width
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
10 ></font-awesome-icon>
2605
11fd7ee37f10 overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents: 2601
diff changeset
11 </div>
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
12 <div style="width: 7%; padding-right: 10px;" class="text-right">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
13 {{ entry.id }}
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
14 </div>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
15 <div style="width: 8%;">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
16 {{ entry.kind.toUpperCase() }}
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
17 </div>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
18 <div style="width: 22%;">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
19 {{ entry.enqueued | dateTime }}
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
20 </div>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
21 <div style="width: 23%;" class="truncate">{{ entry.user }}</div>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
22 <div style="width: 23%;" class="truncate">{{ entry.signer }}</div>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
23 <div style="width: 6%;" class="text-center">
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
24 <font-awesome-icon
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
25 v-if="entry.warnings"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
26 class="ml-1 text-warning"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
27 icon="exclamation-triangle"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
28 fixed-width
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
29 ></font-awesome-icon>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
30 </div>
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
31 <div style="width: 7%" class="text-right">
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
32 <div v-if="entry.state === 'pending'">
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
33 <button
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
34 :class="['actions approved', { active: isApproved }]"
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
35 @click="toggleApproval($options.STATES.APPROVED)"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
36 >
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
37 <font-awesome-icon
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
38 class="small pointer"
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
39 icon="check"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
40 ></font-awesome-icon>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
41 </button>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
42 <button
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
43 :class="['actions rejected', { active: isRejected }]"
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
44 @click="toggleApproval($options.STATES.REJECTED)"
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
45 >
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
46 <font-awesome-icon
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
47 icon="times"
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
48 class="small pointer"
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
49 ></font-awesome-icon>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
50 </button>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
51 </div>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
52 </div>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
53 </div>
2594
ecec6d5aae00 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2593
diff changeset
54 <div class="ml-1 d-flex flex-row">
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
55 <LogDetail :entry="entry" v-if="show === entry.id"></LogDetail>
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
56 </div>
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
57 </div>
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
58 </template>
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
59
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
60 <script>
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
61 /* This is Free Software under GNU Affero General Public License v >= 3.0
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
62 * without warranty, see README.md and license for details.
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
63 *
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
64 * SPDX-License-Identifier: AGPL-3.0-or-later
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
65 * License-Filename: LICENSES/AGPL-3.0.txt
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
66 *
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
67 * Copyright (C) 2018 by via donau
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
68 * – Österreichische Wasserstraßen-Gesellschaft mbH
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
69 * Software engineering by Intevation GmbH
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
70 *
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
71 * Author(s):
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
72 * Thomas Junk <thomas.junk@intevation.de>
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
73 */
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
74 import { mapState } from "vuex";
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
75 import { STATES } from "@/store/imports.js";
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
76
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
77 export default {
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
78 name: "importlogentry",
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
79 props: ["entry"],
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
80 components: {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
81 LogDetail: () => import("./LogDetail.vue")
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
82 },
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
83 methods: {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
84 toggleApproval(state) {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
85 this.$store.commit("imports/toggleApprove", {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
86 id: this.entry.id,
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
87 newStatus: state
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
88 });
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
89 },
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
90 toggleDetails() {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
91 const { id } = this.entry;
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
92 if (id === this.show) {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
93 this.$store.commit("imports/hideDetails");
2597
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
94 this.$store.commit("imports/hideAdditionalInfo");
02d5de05291f overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2594
diff changeset
95 this.$store.commit("imports/hideAdditionalLogs");
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
96 } else {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
97 this.$store.commit("imports/showDetailsFor", id);
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
98 }
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
99 }
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
100 },
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
101 computed: {
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
102 ...mapState("imports", ["show"]),
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
103 needsApproval() {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
104 return this.entry.status === STATES.NEEDSAPPROVAL;
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
105 },
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
106 isRejected() {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
107 return this.entry.status === STATES.REJECTED;
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
108 },
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
109 isApproved() {
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
110 return this.entry.status === STATES.APPROVED;
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
111 }
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
112 },
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
113 STATES: STATES
2579
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
114 };
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
115 </script>
5295a182b4a4 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents:
diff changeset
116
2617
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
117 <style lang="sass" scoped>
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
118 .logentry
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
119 font-size: 80%
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
120 &:hover
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
121 background: #fafafa
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
122 .actions
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
123 height: 100%
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
124 width: 22px
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
125 border: 0
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
126 background: transparent
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
127 border-left: 1px solid #dee2e6
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
128 outline: none
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
129 &.approved
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
130 color: green
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
131 &.active,
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
132 &:hover
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
133 color: white
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
134 background: green
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
135 &.rejected
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
136 color: red
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
137 &.active,
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
138 &:hover
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
139 color: white
359f5f0037f5 client: importoverview2: improved table layout to save more space
Markus Kottlaender <markus@intevation.de>
parents: 2616
diff changeset
140 background: red
2592
5472a5be09c2 overview2 WIP
Thomas Junk <thomas.junk@intevation.de>
parents: 2579
diff changeset
141 </style>