changeset 4386:bad093433899

AFD: frequency decoupled
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 12 Sep 2019 15:49:31 +0200
parents 610773d34e4f
children 65d575505480
files client/src/components/fairway/AvailableFairwayDepth.vue
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Thu Sep 12 15:06:53 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Thu Sep 12 15:49:31 2019 +0200
@@ -100,6 +100,7 @@
   },
   data() {
     return {
+      frequencyD: null,
       selectedFairwayAvailabilityFeatureD: null,
       fromDate: null,
       toDate: null,
@@ -204,29 +205,32 @@
       return `data:text/csv;charset=utf-8, ${encodeURIComponent(this.csv)}`;
     },
     csvFileName() {
+      if (!this.frequencyD) return;
       return `${this.$gettext("fairwayavailability")}-${
         this.featureName
       }-${filters.surveyDate(this.fromDate)}-${filters.surveyDate(
         this.toDate
-      )}-${this.$gettext(this.frequency)}-.csv`;
+      )}-${this.$gettext(this.frequencyD)}-.csv`;
     },
     frequencyToRange() {
+      if (!this.frequencyD) return;
       const frequencies = {
         [FREQUENCIES.MONTHLY]: [-33, 33],
         [FREQUENCIES.QUARTERLY]: [-93, 93],
         [FREQUENCIES.YEARLY]: [-370, 370]
       };
-      return frequencies[this.frequency];
+      return frequencies[this.frequencyD];
     },
     availability() {
       return this.plainAvailability;
     },
     title() {
+      if (!this.frequencyD) return;
       return `Available Fairway Depth: ${
         this.featureName
       } (${filters.surveyDate(this.fromDate)} - ${filters.surveyDate(
         this.toDate
-      )}) ${this.$gettext(this.frequency)}`;
+      )}) ${this.$gettext(this.frequencyD)}`;
     },
     featureName() {
       if (this.selectedFairwayAvailabilityFeatureD == null) return "";
@@ -242,6 +246,7 @@
       this.depthlimit2D = this.depthlimit2;
       this.widthlimit1D = this.widthlimit1;
       this.widthlimit2D = this.widthlimit2;
+      this.frequencyD = this.frequency;
     },
     applyChange() {
       if (this.form.template.hasOwnProperty("properties")) {