Mercurial > gemma
comparison client/src/components/identify/Identify.vue @ 5396:064ac1014713 extented-report
Make DQL-Downloads a bit more dynamic
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Fri, 02 Jul 2021 17:14:04 +0200 |
parents | dbae10503ee6 |
children | 84d01a536bec |
comparison
equal
deleted
inserted
replaced
5389:661e8a2deed9 | 5396:064ac1014713 |
---|---|
191 v-if="loadingDQL" | 191 v-if="loadingDQL" |
192 icon="spinner" | 192 icon="spinner" |
193 :spin="true" | 193 :spin="true" |
194 fixed-width | 194 fixed-width |
195 /> | 195 /> |
196 <a | 196 <template v-if="DQLDownloadAllowed"> |
197 v-if="DQLDownloadAllowed" | 197 <a |
198 href="#" | 198 v-for="(reportName, index) in availableReports" |
199 @click="downloadDataQualityReport" | 199 :key="index" |
200 > | 200 href="#" |
201 <translate>Data quality report</translate> | 201 @click="downloadDataQualityReport(reportName)" |
202 </a> | 202 > |
203 {{ | |
204 reportName | |
205 .split("-") | |
206 .map(s => (s && s[0].toUpperCase() + s.slice(1)) || "") | |
207 .join(" ") | |
208 }} | |
209 </a> | |
210 </template> | |
203 <a | 211 <a |
204 v-if="userManualUrl" | 212 v-if="userManualUrl" |
205 :href="userManualUrl ? userManualUrl : '#'" | 213 :href="userManualUrl ? userManualUrl : '#'" |
206 :download="usermanualFilename" | 214 :download="usermanualFilename" |
207 ><translate> User Manual</translate></a | 215 ><translate> User Manual</translate></a |
315 ...mapState("application", ["showIdentify", "userManualUrl", "config"]), | 323 ...mapState("application", ["showIdentify", "userManualUrl", "config"]), |
316 ...mapGetters("map", ["filteredIdentifiedFeatures"]), | 324 ...mapGetters("map", ["filteredIdentifiedFeatures"]), |
317 ...mapState("map", ["currentMeasurement"]), | 325 ...mapState("map", ["currentMeasurement"]), |
318 ...mapState("gauges", ["gauges"]), | 326 ...mapState("gauges", ["gauges"]), |
319 ...mapGetters("user", ["isWaterwayAdmin", "isSysAdmin"]), | 327 ...mapGetters("user", ["isWaterwayAdmin", "isSysAdmin"]), |
328 ...mapState("importschedule", ["availableReports"]), | |
320 DQLDownloadAllowed() { | 329 DQLDownloadAllowed() { |
321 if (this.loadingDQL) return false; | 330 if (this.loadingDQL) return false; |
322 return this.isWaterwayAdmin || this.isSysAdmin; | 331 return this.isWaterwayAdmin || this.isSysAdmin; |
323 }, | 332 }, |
324 identifiedLabel() { | 333 identifiedLabel() { |
427 }); | 436 }); |
428 } | 437 } |
429 } | 438 } |
430 }, | 439 }, |
431 methods: { | 440 methods: { |
432 downloadDataQualityReport() { | 441 downloadDataQualityReport(reportName) { |
433 this.loadingDQL = true; | 442 this.loadingDQL = true; |
434 HTTP.get(`/data/report/data-quality-report`, { | 443 HTTP.get(`/data/report/${reportName}`, { |
435 responseType: "blob", | 444 responseType: "blob", |
436 headers: { | 445 headers: { |
437 "X-Gemma-Auth": localStorage.getItem("token") | 446 "X-Gemma-Auth": localStorage.getItem("token") |
438 } | 447 } |
439 }) | 448 }) |