Mercurial > gemma
annotate client/src/components/importoverview/LogDetail.vue @ 3678:8f58851927c0
client: make layer factory only return new layer config for individual maps
instead of each time it is invoked. The purpose of the factory was to support multiple maps with individual layers.
But returning a new config each time it is invoked leads to bugs that rely on the layer's state. Now this factory
reuses the same objects it created before, per map.
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 17 Jun 2019 17:31:35 +0200 |
parents | c0c880553cd5 |
children | 45307cf4931a |
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 |
2925
ce148a7fb896
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2919
diff
changeset
|
4 class="d-flex border-bottom" |
2727
0fe0b3f1720f
client: import overview: several style fixes
Markus Kottlaender <markus@intevation.de>
parents:
2718
diff
changeset
|
5 style="padding-left: 3px;" |
3358
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
6 v-if="hasAdditionalInfo || isST || isSEC || isSR" |
2727
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> |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
16 <span class="text-info" v-if="isAGM && details.summary"> |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
17 ({{ details.summary.length }}) |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
18 </span> |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
19 <span |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
20 v-if="isBN && details.summary && details.summary.bottlenecks" |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
21 class="text-info text-left" |
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
22 > |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
23 ({{ details.summary.bottlenecks.length }}) |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
24 </span> |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
25 <span class="text-left" v-if="isFD"> |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
26 {{ details.summary["source-organization"] }} |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
27 (LOS: {{ details.summary.los }}) |
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
28 </span> |
2601 | 29 </div> |
3358
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
30 <SectionDetails v-if="isSEC && isPending" :entry="entry" /> |
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
31 <StretchDetails v-if="isST && isPending" :entry="entry" /> |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
32 <SoundingResultDetail :entry="entry" v-if="isSR && isPending" /> |
2594 | 33 </div> |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
34 <div |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
35 v-if="entry.id === showAdditional && isPending && (isFD || isAGM || isBN)" |
2925
ce148a7fb896
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2919
diff
changeset
|
36 class="d-flex border-bottom" |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
37 > |
2944
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2927
diff
changeset
|
38 <FairwayDimensionDetail v-if="isFD" /> |
73f537379203
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2927
diff
changeset
|
39 <ApprovedGaugeMeasurementDetail v-if="isAGM" /> |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
40 <BottleneckDetail :entry="entry" v-if="isBN" /> |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
41 </div> |
2925
ce148a7fb896
client: importoverview: improved style
Markus Kottlaender <markus@intevation.de>
parents:
2919
diff
changeset
|
42 <div class="d-flex" style="padding-left: 3px;"> |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
43 <UISpinnerButton |
2594 | 44 @click="toggleAdditionalLogging" |
2902
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
45 :state="entry.id === showLogs" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
46 :icons="['angle-right', 'angle-down']" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
47 classes="text-info" |
399b03e59411
client: use UISpinnerButton in bottlenecks list and imports overview
Markus Kottlaender <markus@intevation.de>
parents:
2887
diff
changeset
|
48 /> |
2601 | 49 <span class="text-info"><translate>Logs</translate></span> |
2594 | 50 </div> |
2919
6c5364ff0abb
client: removed a lot of unnecessary closing tags
Markus Kottlaender <markus@intevation.de>
parents:
2917
diff
changeset
|
51 <AdditionalLog v-if="entry.id === showLogs" class="d-flex flex-row" /> |
2592 | 52 </div> |
53 </template> | |
54 | |
55 <script> | |
56 /* This is Free Software under GNU Affero General Public License v >= 3.0 | |
57 * without warranty, see README.md and license for details. | |
58 * | |
59 * SPDX-License-Identifier: AGPL-3.0-or-later | |
60 * License-Filename: LICENSES/AGPL-3.0.txt | |
61 * | |
62 * Copyright (C) 2018 by via donau | |
63 * – Österreichische Wasserstraßen-Gesellschaft mbH | |
64 * Software engineering by Intevation GmbH | |
65 * | |
66 * Author(s): | |
67 * Thomas Junk <thomas.junk@intevation.de> | |
68 */ | |
2594 | 69 |
70 import { mapState } from "vuex"; | |
71 | |
2592 | 72 export default { |
2594 | 73 components: { |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2944
diff
changeset
|
74 SoundingResultDetail: () => import("./SoundingResultDetail"), |
3358
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
75 StretchDetails: () => import("./StretchDetails"), |
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
76 SectionDetails: () => import("./SectionDetails"), |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2944
diff
changeset
|
77 FairwayDimensionDetail: () => import("./FairwayDimensionDetail"), |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
78 ApprovedGaugeMeasurementDetail: () => |
2985
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2944
diff
changeset
|
79 import("./ApprovedGaugeMeasurementDetail"), |
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2944
diff
changeset
|
80 BottleneckDetail: () => import("./BottleneckDetail"), |
1b8bb4f89227
client: removed .js and .vue extention from imports
Markus Kottlaender <markus@intevation.de>
parents:
2944
diff
changeset
|
81 AdditionalLog: () => import("./AdditionalLog") |
2594 | 82 }, |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
83 props: ["entry"], |
2594 | 84 computed: { |
2733
4ae3453fcf50
import_review: fixed minor state bugs
Thomas Junk <thomas.junk@intevation.de>
parents:
2732
diff
changeset
|
85 ...mapState("imports", ["showAdditional", "showLogs", "details"]), |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
86 kind() { |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
87 return this.entry.kind.toUpperCase(); |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
88 }, |
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
|
89 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
|
90 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
|
91 }, |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
92 hasAdditionalInfo() { |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
93 return this.isPending && (this.isAGM || this.isBN); |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
94 }, |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
95 isFD() { |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
96 return this.kind === "FD"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
97 }, |
2917
edc2633c3cc6
client: importsoverview: cleaned up html, removed unnecessary component
Markus Kottlaender <markus@intevation.de>
parents:
2902
diff
changeset
|
98 isAGM() { |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
99 return this.kind === "AGM"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
100 }, |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
101 isBN() { |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
102 return this.kind === "BN" || this.kind === "UBN"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
103 }, |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
104 isST() { |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
105 return this.kind === "ST"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
106 }, |
3358
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
107 isSEC() { |
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
108 return this.kind === "SEC"; |
c0c880553cd5
client: import review: added section details (actually just the link to move the map to the feature)
Markus Kottlaender <markus@intevation.de>
parents:
2985
diff
changeset
|
109 }, |
2927
80815b0a665c
client: importoverview: further improved styles and shortened variable names
Markus Kottlaender <markus@intevation.de>
parents:
2925
diff
changeset
|
110 isSR() { |
2605
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
111 return this.kind === "SR"; |
11fd7ee37f10
overview2: added stretch zoom functionality
Thomas Junk <thomas.junk@intevation.de>
parents:
2601
diff
changeset
|
112 } |
2875
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
113 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
114 methods: { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
115 toggleAdditionalInfo() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
116 if (this.entry.id === this.showAdditional) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
117 this.$store.commit("imports/hideAdditionalInfo"); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
118 } else { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
119 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
120 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
121 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
122 toggleAdditionalLogging() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
123 if (this.entry.id === this.showLogs) { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
124 this.$store.commit("imports/hideAdditionalLogs"); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
125 } else { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
126 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
127 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
128 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
129 }, |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
130 mounted() { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
131 if (this.entry.state === "pending") { |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
132 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
133 } |
84effca50751
client: importoverview: cleaned up code
Markus Kottlaender <markus@intevation.de>
parents:
2799
diff
changeset
|
134 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); |
2594 | 135 } |
2592 | 136 }; |
137 </script> |