diff client/src/components/ImportStretches.vue @ 2563:dc4fae4bdb8f

Expose axis snapping tolerance to users
author Tom Gottfried <tom@intevation.de>
date Fri, 08 Mar 2019 19:15:47 +0100
parents 468c8dc796cf
children 1cac2e58ef7d
line wrap: on
line diff
--- a/client/src/components/ImportStretches.vue	Fri Mar 08 18:57:58 2019 +0100
+++ b/client/src/components/ImportStretches.vue	Fri Mar 08 19:15:47 2019 +0100
@@ -154,6 +154,27 @@
         <div class="d-flex flex-row justify-content-between">
           <div class="mt-2  mr-2 w-50  text-left">
             <small class="text-muted">
+              <translate>Tolerance for snapping of waterway axis</translate>
+            </small>
+            <input
+              class="form-control"
+              v-model.number="tolerance"
+              placeholder=""
+              type="number"
+              step="any"
+              aria-label="tolerance"
+              id="tolerance"
+            />
+            <span class="text-left text-danger">
+              <small v-if="toleranceError && !tolerance">
+                <translate>Please enter a tolerance value</translate>
+              </small>
+            </span>
+          </div>
+        </div>
+        <div class="d-flex flex-row justify-content-between">
+          <div class="mt-2  mr-2 w-50  text-left">
+            <small class="text-muted">
               <translate>Object name</translate>
             </small>
             <input
@@ -245,12 +266,13 @@
  * SPDX-License-Identifier: AGPL-3.0-or-later
  * License-Filename: LICENSES/AGPL-3.0.txt
  *
- * Copyright (C) 2018 by via donau
+ * Copyright (C) 2018, 2019 by via donau
  *   – Österreichische Wasserstraßen-Gesellschaft mbH
  * Software engineering by Intevation GmbH
  *
  * Author(s):
  * Thomas Junk <thomas.junk@intevation.de>
+ * Tom Gottfried <tom.gottfried@intevation.de>
  */
 import { mapState, mapGetters } from "vuex";
 import { displayError, displayInfo } from "@/lib/errors.js";
@@ -266,6 +288,7 @@
       funktion: "",
       startrhm: "",
       endrhm: "",
+      tolerance: "",
       objbn: "",
       nobjbn: "",
       countryCode: "",
@@ -277,6 +300,7 @@
       funktionError: false,
       startrhmError: false,
       endrhmError: false,
+      toleranceError: false,
       objbnError: false,
       nobjbnError: false,
       date_infoError: false,
@@ -339,6 +363,7 @@
       this.edit = true;
       this.startrhm = properties.lower;
       this.endrhm = properties.upper;
+      this.tolerance = properties.tolerance;
       this.idEditable = false;
     },
     deleteStretch(stretch) {
@@ -393,6 +418,7 @@
       this.idEditable = true;
       this.funktion = "";
       this.startrhm = "";
+      this.tolerance = "";
       this.endrhm = "";
       this.objbn = "";
       this.nobjbn = "";
@@ -405,6 +431,7 @@
       this.funktionError = false;
       this.startrhmError = false;
       this.endrhmError = false;
+      this.toleranceError = false;
       this.objbnError = false;
       this.nobjbnError = false;
       this.date_infoError = false;
@@ -430,6 +457,7 @@
         "id",
         "funktion",
         "startrhm",
+        "tolerance",
         "endrhm",
         "objbn",
         "nobjbn",
@@ -452,6 +480,7 @@
         !this.id ||
         !this.startrhm ||
         !this.endrhm ||
+        !this.tolerance ||
         !this.source ||
         !this.date_info ||
         !this.objbn ||
@@ -462,6 +491,7 @@
         name: this.id,
         from: this.startrhm,
         to: this.endrhm,
+        tolerance: this.tolerance,
         "source-organization": this.source,
         "date-info": this.date_info,
         objnam: this.objbn,