diff client/src/components/fairway/Fairwayprofile.vue @ 5572:3b842e951317 surveysperbottleneckid

change use from name of bottleneck to its id.
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 20 Jul 2021 17:07:51 +0200
parents de86a96d55c3
children f54932eec5c0
line wrap: on
line diff
--- a/client/src/components/fairway/Fairwayprofile.vue	Tue Jul 20 11:50:17 2021 +0200
+++ b/client/src/components/fairway/Fairwayprofile.vue	Tue Jul 20 17:07:51 2021 +0200
@@ -239,9 +239,9 @@
         this.waterlevelValid && this.refWaterlevelValid
           ? `${this.$options.filters.waterlevel(this.waterlevel)} m`
           : this.$gettext("No valid value available");
-      return `${this.$gettext("Fairwayprofile")}: ${
-        this.selectedBottleneck
-      } (${dates.join(
+      return `${this.$gettext("Fairwayprofile")}: ${this.bottleneck.get(
+        "objnam"
+      )} (${dates.join(
         ", "
       )}) WL: ${waterlevelLabel} ( ${waterlevelMeasurement} )`;
     },
@@ -266,7 +266,7 @@
         .getLayer("BOTTLENECKS")
         .getSource()
         .getFeatures()
-        .find(f => f.get("objnam") === this.selectedBottleneck);
+        .find(f => f.get("bottleneck_id") === this.selectedBottleneck);
     },
     waterlevel() {
       return this.selectedWaterLevel === "ref"
@@ -286,7 +286,7 @@
     fileName() {
       return this.downloadFilename(
         this.$gettext("Fairwayprofile"),
-        this.selectedBottleneck
+        this.bottleneck.get("objnam")
       );
     }
   },
@@ -446,7 +446,10 @@
     },
     downloadPDF() {
       let fairwayInfo =
-        this.selectedBottleneck + " (" + this.selectedSurvey.date_info + ")";
+        this.bottleneck.get("objnam") +
+        " (" +
+        this.selectedSurvey.date_info +
+        ")";
       this.generatePDF({
         templateData: this.templateData,
         diagramTitle: fairwayInfo