changeset 5475:791a372553a0

Client:FWA: Fix setting request parameters and legend * Set default limit-width values (80m, 150m) for bottlenecks that limited by width * Fix condition of generating the legend * Fix setting the boundaries of the legend * Convert limit-width values to "cm" for the request.
author Fadi Abbud <fadi.abbud@intevation.de>
date Mon, 16 Aug 2021 15:55:57 +0200
parents d71ebe576c76
children a3d46cee9f69
files client/src/components/fairway/AvailableFairwayDepth.vue client/src/components/fairway/AvailableFairwayDepthDialogue.vue client/src/store/fairwayavailability.js
diffstat 3 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Mon Aug 09 22:08:01 2021 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Mon Aug 16 15:55:57 2021 +0200
@@ -197,12 +197,15 @@
       "widthlimit2"
     ]),
     legend() {
-      const d = [this.depthlimit1D, this.depthlimit2D].sort();
-      const w = [this.widthlimit1D, this.widthlimit2D].sort();
+      const d = [this.depthlimit1D, this.depthlimit2D].sort((a, b) => a - b);
+      const w = [this.widthlimit1D, this.widthlimit2D].sort((a, b) => a - b);
       const lowerBound = [d[0] / 100, w[0]].filter(x => x).join(", ");
       const upperBound = [d[1] / 100, w[1]].filter(x => x).join(", ");
       let result;
-      if (this.depthlimit1D !== this.depthlimit2D) {
+      if (
+        this.depthlimit1D !== this.depthlimit2D ||
+        this.widthlimit1 !== this.widthlimit2
+      ) {
         result = [
           `> LDC`,
           `>= ${upperBound} [m]`,
--- a/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Mon Aug 09 22:08:01 2021 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthDialogue.vue	Mon Aug 16 15:55:57 2021 +0200
@@ -623,6 +623,12 @@
         this.depthLimit2 = 2.5;
       }
     },
+    widthLimitVisible() {
+      if (this.widthLimitVisible) {
+        this.widthLimit1 = 80;
+        this.widthLimit2 = 150;
+      }
+    },
     selectedBottleneck() {
       this.type = this.$options.BOTTLENECK;
       this.setSelectedBottleneck();
@@ -757,8 +763,8 @@
           type: this.type,
           depthLimit1: this.depthlimit1,
           depthLimit2: this.depthlimit2,
-          widthLimit1: this.widthLimit1,
-          widthLimit2: this.widthLimit2,
+          widthLimit1: Math.round(this.widthLimit1 * 100),
+          widthLimit2: Math.round(this.widthLimit2 * 100),
           limitingFactor: this.limitingFactor
         })
         .then(() => {
@@ -805,8 +811,8 @@
           type: this.type,
           depthLimit1: this.depthlimit1,
           depthLimit2: this.depthlimit2,
-          widthLimit1: this.widthLimit1,
-          widthLimit2: this.widthLimit2,
+          widthLimit1: Math.round(this.widthLimit1 * 100),
+          widthLimit2: Math.round(this.widthLimit2 * 100),
           limitingFactor: this.limitingFactor
         })
         .then(() => {
--- a/client/src/store/fairwayavailability.js	Mon Aug 09 22:08:01 2021 +0200
+++ b/client/src/store/fairwayavailability.js	Mon Aug 16 15:55:57 2021 +0200
@@ -70,8 +70,8 @@
     limitingFactor: null,
     depthlimit1: 230,
     depthlimit2: 250,
-    widthlimit1: null,
-    widthlimit2: null,
+    widthlimit1: 80,
+    widthlimit2: 150,
     csv: null,
     fwData: null,
     fwLNWLData: null,