Mercurial > gemma
comparison client/src/components/importoverview/LogDetail.vue @ 2732:0ab7985ef008
import_review: fixed flakey display of logs
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 19 Mar 2019 14:50:56 +0100 |
parents | 0fe0b3f1720f |
children | 4ae3453fcf50 |
comparison
equal
deleted
inserted
replaced
2731:7e97337054b9 | 2732:0ab7985ef008 |
---|---|
30 <span class="text-left" v-if="isFairwayDimension" | 30 <span class="text-left" v-if="isFairwayDimension" |
31 >{{ details.summary["source-organization"] }} (LOS: | 31 >{{ details.summary["source-organization"] }} (LOS: |
32 {{ details.summary.los }})</span | 32 {{ details.summary.los }})</span |
33 > | 33 > |
34 </div> | 34 </div> |
35 <StretchDetail | 35 <StretchDetail v-if="isStretch" :entry="entry"></StretchDetail> |
36 v-if="isStretch" | |
37 :entry="entry" | |
38 :details="details" | |
39 ></StretchDetail> | |
40 <SoundingResultDetail | 36 <SoundingResultDetail |
41 :entry="entry" | 37 :entry="entry" |
42 :details="details" | |
43 v-if="isSoundingResult" | 38 v-if="isSoundingResult" |
44 ></SoundingResultDetail> | 39 ></SoundingResultDetail> |
45 </div> | 40 </div> |
46 <AdditionalDetail | 41 <AdditionalDetail |
47 v-if="entry.id === showAdditional" | 42 v-if="entry.id === showAdditional" |
48 class="ml-2 d-flex flex-row" | 43 class="ml-2 d-flex flex-row" |
49 :entry="entry" | 44 :entry="entry" |
50 :details="details" | |
51 ></AdditionalDetail> | 45 ></AdditionalDetail> |
52 <div class="d-flex fex-row" style="padding-left: 3px;"> | 46 <div class="d-flex fex-row" style="padding-left: 3px;"> |
53 <font-awesome-icon | 47 <font-awesome-icon |
54 v-if="entry.id === showLogs" | 48 v-if="entry.id === showLogs" |
55 @click="toggleAdditionalLogging" | 49 @click="toggleAdditionalLogging" |
67 <span class="text-info"><translate>Logs</translate></span> | 61 <span class="text-info"><translate>Logs</translate></span> |
68 </div> | 62 </div> |
69 <AdditionalLog | 63 <AdditionalLog |
70 v-if="entry.id === showLogs" | 64 v-if="entry.id === showLogs" |
71 class="mx-4 pb-1 d-flex flex-row small" | 65 class="mx-4 pb-1 d-flex flex-row small" |
72 :details="details" | |
73 ></AdditionalLog> | 66 ></AdditionalLog> |
74 </div> | 67 </div> |
75 </template> | 68 </template> |
76 | 69 |
77 <script> | 70 <script> |
88 * Author(s): | 81 * Author(s): |
89 * Thomas Junk <thomas.junk@intevation.de> | 82 * Thomas Junk <thomas.junk@intevation.de> |
90 */ | 83 */ |
91 | 84 |
92 import { mapState } from "vuex"; | 85 import { mapState } from "vuex"; |
86 import { displayError } from "@/lib/errors.js"; | |
87 import { HTTP } from "@/lib/http.js"; | |
93 | 88 |
94 export default { | 89 export default { |
95 name: "logdetail", | 90 name: "logdetail", |
96 props: ["entry", "details"], | 91 props: ["entry"], |
97 components: { | 92 components: { |
98 SoundingResultDetail: () => import("./SoundingResultDetail.vue"), | 93 SoundingResultDetail: () => import("./SoundingResultDetail.vue"), |
99 StretchDetail: () => import("./StretchDetails.vue"), | 94 StretchDetail: () => import("./StretchDetails.vue"), |
100 AdditionalDetail: () => import("./AdditionalDetail.vue"), | 95 AdditionalDetail: () => import("./AdditionalDetail.vue"), |
101 AdditionalLog: () => import("./AdditionalLog.vue") | 96 AdditionalLog: () => import("./AdditionalLog.vue") |
102 }, | 97 }, |
103 mounted() { | 98 mounted() { |
104 if (this.entry.state === "pending") { | 99 HTTP.get("/imports/" + this.entry.id, { |
105 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); | 100 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
106 } | 101 }) |
107 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); | 102 .then(response => { |
103 this.$store.commit("imports/setCurrentDetails", response.data); | |
104 if (this.entry.state === "pending") { | |
105 this.$store.commit("imports/showAdditionalInfoFor", this.entry.id); | |
106 } | |
107 this.$store.commit("imports/showAdditionalLogsFor", this.entry.id); | |
108 }) | |
109 .catch(error => { | |
110 const { status, data } = error.response; | |
111 displayError({ | |
112 title: this.$gettext("Backend Error"), | |
113 message: `${status}: ${data.message || data}` | |
114 }); | |
115 }); | |
108 }, | 116 }, |
109 methods: { | 117 methods: { |
110 toggleAdditionalInfo() { | 118 toggleAdditionalInfo() { |
111 if (this.entry.id === this.showAdditional) { | 119 if (this.entry.id === this.showAdditional) { |
112 this.$store.commit("imports/hideAdditionalInfo"); | 120 this.$store.commit("imports/hideAdditionalInfo"); |