Mercurial > gemma
annotate client/src/components/importoverview/LogDetail.vue @ 2914:84a40983bb9f
client: importsoverview: improved opening mechanism for additional details
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 03 Apr 2019 12:55:32 +0200 |
parents | 399b03e59411 |
children | edc2633c3cc6 |
rev | line source |
---|---|
2592 | 1 <template> |
2882
6538ee93df72
client: moved style blocks below template blocks
Markus Kottlaender <markus@intevation.de>
parents:
2875
diff
changeset
|
2 <div> |
2727
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
3 <div |
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
4 class="d-flex fex-row" |
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
5 style="padding-left: 3px;" |
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
6 v-if="hasAdditionalInfo || isStretch || isSoundingResult" |
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
7 > |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
8 <div v-if="hasAdditionalInfo"> |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
9 <UISpinnerButton |
2601 | 10 @click="toggleAdditionalInfo" |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
11 :state="entry.id === showAdditional" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
12 :icons="['angle-right', 'angle-down']" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
13 class="text-info d-inline-block" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
14 /> |
2601 | 15 <span class="text-info"><translate>Additional Info</translate></span> |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
16 <span |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
17 class="text-info" |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
18 v-if="isApprovedGaugeMeasurement && details.summary" |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
19 > |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2647
diff
changeset
|
20 ({{ details.summary.length }})</span |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
21 > |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
22 <span |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
23 v-if="isBottleneck && details.summary && details.summary.bottlenecks" |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
24 class="text-info text-left" |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
25 > |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2647
diff
changeset
|
26 ({{ details.summary.bottlenecks.length }})</span |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2608
diff
changeset
|
27 > |
2608
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
28 <span class="text-left" v-if="isFairwayDimension" |
2685
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2647
diff
changeset
|
29 >{{ details.summary["source-organization"] }} (LOS: |
39a05f8c34e6
import_overview: Refactoring of detailed information.
Thomas Junk <thomas.junk@intevation.de>
parents:
2647
diff
changeset
|
30 {{ details.summary.los }})</span |
2608
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
31 > |
2601 | 32 </div> |
2776
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
33 <StretchDetail |
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
34 v-if="isStretch && isPending" |
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
35 :entry="entry" |
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
36 ></StretchDetail> |
2608
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
37 <SoundingResultDetail |
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
38 :entry="entry" |
2776
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
39 v-if="isSoundingResult && isPending" |
2608
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
40 ></SoundingResultDetail> |
2594 | 41 </div> |
42 <AdditionalDetail | |
2777
c4821579cfaf
import_overview: show additional info only when pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2776
diff
changeset
|
43 v-if="entry.id === showAdditional && isPending" |
2594 | 44 class="ml-2 d-flex flex-row" |
2597 | 45 :entry="entry" |
2594 | 46 ></AdditionalDetail> |
2727
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
47 <div class="d-flex fex-row" style="padding-left: 3px;"> |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
48 <UISpinnerButton |
2594 | 49 @click="toggleAdditionalLogging" |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
50 :state="entry.id === showLogs" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
51 :icons="['angle-right', 'angle-down']" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
52 classes="text-info" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
53 /> |
2601 | 54 <span class="text-info"><translate>Logs</translate></span> |
2594 | 55 </div> |
56 <AdditionalLog | |
57 v-if="entry.id === showLogs" | |
2887
83acca8937de
client: importoverview: improved log style
Markus Kottlaender <markus@intevation.de>
parents:
2882
diff
changeset
|
58 class="d-flex flex-row" |
2594 | 59 ></AdditionalLog> |
2592 | 60 </div> |
61 </template> | |
62 | |
63 <script> | |
64 /* This is Free Software under GNU Affero General Public License v >= 3.0 | |
65 * without warranty, see README.md and license for details. | |
66 * | |
67 * SPDX-License-Identifier: AGPL-3.0-or-later | |
68 * License-Filename: LICENSES/AGPL-3.0.txt | |
69 * | |
70 * Copyright (C) 2018 by via donau | |
71 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
72 * Software engineering by Intevation GmbH | |
73 * | |
74 * Author(s): | |
75 * Thomas Junk <thomas.junk@intevation.de> | |
76 */ | |
2594 | 77 |
78 import { mapState } from "vuex"; | |
79 | |
2592 | 80 export default { |
2594 | 81 components: { |
2608
13377f2a5c42
overview2: agm details prototype implemented
Thomas Junk <thomas.junk@intevation.de>
parents:
2605
diff
changeset
|
82 SoundingResultDetail: () => import("./SoundingResultDetail.vue"), |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
83 StretchDetail: () => import("./StretchDetails.vue"), |
2594 | 84 AdditionalDetail: () => import("./AdditionalDetail.vue"), |
85 AdditionalLog: () => import("./AdditionalLog.vue") | |
86 }, | |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
87 props: ["entry"], |
2594 | 88 computed: { |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
89 ...mapState("imports", ["showAdditional", "showLogs", "details"]), |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
90 kind() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
91 return this.entry.kind.toUpperCase(); |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
92 }, |
2776
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
93 isPending() { |
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
94 return this.entry.state == "pending"; |
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
95 }, |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
96 hasAdditionalInfo() { |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2608
diff
changeset
|
97 return ( |
2776
a0b63e2fca99
import_overview: only display additional info when state of current entry is pending
Thomas Junk <thomas.junk@intevation.de>
parents:
2736
diff
changeset
|
98 this.isPending && (this.isApprovedGaugeMeasurement || this.isBottleneck) |
2647
c52bf6f994c0
overview2: bottleneckview added
Thomas Junk <thomas.junk@intevation.de>
parents:
2608
diff
changeset
|
99 ); |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
100 }, |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
101 isFairwayDimension() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
102 return this.kind === "FD"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
103 }, |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
104 isApprovedGaugeMeasurement() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
105 return this.kind === "AGM"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
106 }, |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
107 isBottleneck() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
108 return this.kind === "BN" || this.kind === "UBN"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
109 }, |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
110 isStretch() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
111 return this.kind === "ST"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
112 }, |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
113 isSoundingResult() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
114 return this.kind === "SR"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
115 } |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
116 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
117 methods: { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
118 toggleAdditionalInfo() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
119 if (this.entry.id === this.showAdditional) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
120 this.$store.commit("imports/hideAdditionalInfo"); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
121 } else { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
122 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
123 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
124 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
125 toggleAdditionalLogging() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
126 if (this.entry.id === this.showLogs) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
127 this.$store.commit("imports/hideAdditionalLogs"); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
128 } else { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
129 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
130 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
131 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
132 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
133 mounted() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
134 if (this.entry.state === "pending") { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
135 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
136 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
137 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); |
2594 | 138 } |
2592 | 139 }; |
140 </script> |