Mercurial > gemma
comparison client/src/components/staging/StagingDetail.vue @ 2333:eb82b273c615
staging: adapt to new routing concept. fix of problems with opening bottlenecks
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 19 Feb 2019 16:44:38 +0100 |
parents | 256f98e1d954 |
children | 0f3b0937e7c1 |
comparison
equal
deleted
inserted
replaced
2332:e38d3f1d625c | 2333:eb82b273c615 |
---|---|
93 v-if="loading" | 93 v-if="loading" |
94 icon="spinner" | 94 icon="spinner" |
95 fixed-width | 95 fixed-width |
96 ></font-awesome-icon> | 96 ></font-awesome-icon> |
97 <font-awesome-icon | 97 <font-awesome-icon |
98 @click="showDetails()" | |
98 class="pointer" | 99 class="pointer" |
99 v-if="!show && !loading" | 100 v-if="!show && !loading" |
100 icon="angle-down" | 101 icon="angle-down" |
101 fixed-width | 102 fixed-width |
102 ></font-awesome-icon> | 103 ></font-awesome-icon> |
315 bottlenecks: [] | 316 bottlenecks: [] |
316 }; | 317 }; |
317 }, | 318 }, |
318 mounted() { | 319 mounted() { |
319 this.bottlenecks = []; | 320 this.bottlenecks = []; |
321 const { id } = this.$route.params; | |
322 this.$store.commit("imports/setImportToReview", id); | |
320 if (this.open) this.showDetails(); | 323 if (this.open) this.showDetails(); |
321 }, | 324 }, |
322 computed: { | 325 computed: { |
323 ...mapState("imports", ["importToReview"]), | 326 ...mapState("imports", ["importToReview"]), |
324 open() { | 327 open() { |
340 watch: { | 343 watch: { |
341 showAGMDetails() { | 344 showAGMDetails() { |
342 if (!this.showAGMDetails) this.showDiff = NO_DIFF; | 345 if (!this.showAGMDetails) this.showDiff = NO_DIFF; |
343 }, | 346 }, |
344 open() { | 347 open() { |
345 const { review } = this.$route.query; | 348 this.show = this.open; |
346 if (review) { | 349 }, |
347 this.showDetails(); | 350 $route() { |
348 } | 351 const { id } = this.$route.params; |
352 this.$store.commit("imports/setImportToReview", id); | |
353 if (this.open) this.showDetails(); | |
349 } | 354 } |
350 }, | 355 }, |
351 methods: { | 356 methods: { |
352 toggleDiff(number) { | 357 toggleDiff(number) { |
353 if (this.showDiff !== number || this.showDiff == -1) { | 358 if (this.showDiff !== number || this.showDiff == -1) { |
388 const generateFilter = () => { | 393 const generateFilter = () => { |
389 const { bottlenecks } = this.data.summary; | 394 const { bottlenecks } = this.data.summary; |
390 if (bottlenecks.length === 1) | 395 if (bottlenecks.length === 1) |
391 return equalToFilter("bottleneck_id", bottlenecks[0]); | 396 return equalToFilter("bottleneck_id", bottlenecks[0]); |
392 const orExpressions = bottlenecks.map(x => { | 397 const orExpressions = bottlenecks.map(x => { |
393 equalToFilter("bottleneck_id", x); | 398 return equalToFilter("bottleneck_id", x); |
394 }); | 399 }); |
395 return orFilter(...orExpressions); | 400 return orFilter(...orExpressions); |
396 }; | 401 }; |
397 const filterExpression = generateFilter(); | 402 const filterExpression = generateFilter(); |
398 const bottleneckFeatureCollectionRequest = new WFS().writeGetFeature({ | 403 const bottleneckFeatureCollectionRequest = new WFS().writeGetFeature({ |
399 srsName: "EPSG:4326", | 404 srsName: "EPSG:4326", |
400 featureNS: "gemma", | 405 featureNS: "gemma", |
401 featurePrefix: "gemma", | 406 featurePrefix: "gemma", |
402 featureTypes: ["bottlenecks"], | 407 featureTypes: ["bottlenecks_geoserver"], |
403 outputFormat: "application/json", | 408 outputFormat: "application/json", |
404 filter: filterExpression | 409 filter: filterExpression |
405 }); | 410 }); |
406 HTTP.post( | 411 HTTP.post( |
407 "/internal/wfs", | 412 "/internal/wfs", |