diff client/src/components/fairway/AvailableFairwayDepthDialogue.vue @ 3296:fa7dc3f31ef3

available_fairwaydepth_vs_lnwl: POC etd.
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 16 May 2019 16:23:19 +0200
parents 5f0c6e931e7f
children 80037790032d 9dc7d803e51f
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Thu May 16 15:36:11 2019 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Thu May 16 16:23:19 2019 +0200
@@ -128,7 +128,16 @@
             :disabled="isComplete"
             class="btn btn-info btn-sm w-100"
           >
-            <translate>Available Fairway Depth</translate>
+            <translate>Available fairway depth</translate>
+          </button>
+        </div>
+        <div class="mt-3">
+          <button
+            @click="openFairwaydepthLNWL"
+            :disabled="isComplete"
+            class="btn btn-info btn-sm w-100"
+          >
+            <translate>Available fairway depth vs LNWL</translate>
           </button>
         </div>
       </div>
@@ -170,6 +179,34 @@
     };
   },
   methods: {
+    openFairwaydepthLNWL() {
+      this.loading = true;
+      this.$store
+        .dispatch("fairwayavailability/loadAvailableFairwayDepth", {
+          feature: this.selectedFairwayAvailabilityFeature,
+          from: this.from,
+          to: this.to,
+          frequency: this.frequency,
+          LOS: this.los
+        })
+        .then(() => {
+          this.$store.commit(
+            "application/paneSetup",
+            "AVAILABLEFAIRWAYDEPTHLNWL"
+          );
+        })
+        .catch(error => {
+          console.log(error);
+          const { status, data } = error.response;
+          displayError({
+            title: this.$gettext("Backend Error"),
+            message: `${status}: ${data.message || data}`
+          });
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
     openFairwaydepth() {
       this.loading = true;
       this.$store
@@ -197,6 +234,7 @@
     },
     close() {
       this.$store.commit("application/showFairwayDepth", false);
+      this.$store.commit("application/showFairwayDepthLNWL", false);
     },
     entrySelected() {
       if (this.type === this.$options.BOTTLENECKS) {