changeset 1144:5f98d0c9d738

linted code
author Markus Kottlaender <markus@intevation.de>
date Mon, 12 Nov 2018 15:12:04 +0100
parents 846e336d8ee5
children 2d34715dd52e 74e180ad3d6b
files client/src/application/Main.vue client/src/application/Userbar.vue client/src/bottlenecks/Bottlenecks.vue client/src/drawtool/Drawtool.vue client/src/imports/Imports.vue client/src/imports/Job.vue client/src/map/Maplayer.vue client/src/morphtool/Morphtool.vue client/src/store/map.js
diffstat 9 files changed, 40 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/application/Main.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/application/Main.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -40,7 +40,7 @@
 
 import Maplayer from "../map/Maplayer";
 import FairwayProfile from "../fairway/Fairwayprofile";
-import { mapGetters, mapState } from "vuex";
+import { mapState } from "vuex";
 import debounce from "debounce";
 
 export default {
--- a/client/src/application/Userbar.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/application/Userbar.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -59,7 +59,7 @@
  * Author(s):
  * Thomas Junk <thomas.junk@intevation.de>
  */
-import { mapGetters, mapState } from "vuex";
+import { mapState } from "vuex";
 export default {
   name: "user",
   data() {
--- a/client/src/bottlenecks/Bottlenecks.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/bottlenecks/Bottlenecks.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -65,7 +65,7 @@
  * Author(s):
  * Markus Kottländer <markus.kottlaender@intevation.de>
  */
-import { mapState, mapGetters } from "vuex";
+import { mapState } from "vuex";
 import { fromLonLat } from "ol/proj";
 import { HTTP } from "../application/lib/http";
 import { displayError } from "../application/lib/errors.js";
--- a/client/src/drawtool/Drawtool.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/drawtool/Drawtool.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -56,28 +56,40 @@
   name: "drawtool",
   computed: {
     ...mapGetters("map", ["getLayerByName"]),
-    ...mapState("map", ["drawMode", "drawTool", "cutMode", "cutTool", "openLayersMap"]),
+    ...mapState("map", [
+      "drawMode",
+      "drawTool",
+      "cutMode",
+      "cutTool",
+      "openLayersMap"
+    ]),
     ...mapState("bottlenecks", ["selectedSurvey"])
   },
   methods: {
     toggleLineMode() {
       this.disableDrawTool();
       this.disableCutTool();
-      this.$store.commit("map/drawMode", this.drawMode !== "LineString" ? "LineString" : null);
+      this.$store.commit(
+        "map/drawMode",
+        this.drawMode !== "LineString" ? "LineString" : null
+      );
       this.$store.commit("map/cutMode", null);
       if (this.drawMode) this.enableDrawTool();
     },
     togglePolygonMode() {
       this.disableDrawTool();
       this.disableCutTool();
-      this.$store.commit("map/drawMode", this.drawMode !== "Polygon" ? "Polygon" : null);
+      this.$store.commit(
+        "map/drawMode",
+        this.drawMode !== "Polygon" ? "Polygon" : null
+      );
       this.$store.commit("map/cutMode", null);
       if (this.drawMode) this.enableDrawTool();
     },
     toggleCutMode() {
       this.disableCutTool();
       this.disableDrawTool();
-      this.$store.commit('map/cutMode', !this.cutMode);
+      this.$store.commit("map/cutMode", !this.cutMode);
       this.$store.commit("map/drawMode", null);
       if (this.cutMode) this.enableCutTool();
     },
@@ -102,7 +114,9 @@
     },
     disableDrawTool() {
       this.$store.commit("map/setCurrentMeasurement", null);
-      this.getLayerByName("Draw Tool").data.getSource().clear();
+      this.getLayerByName("Draw Tool")
+        .data.getSource()
+        .clear();
       this.openLayersMap.removeInteraction(this.drawTool);
       this.$store.commit("map/drawTool", null);
     },
@@ -114,9 +128,10 @@
         this.$store.commit("map/setCurrentMeasurement", {
           quantity: "Area",
           unitSymbol: areaSize > 100000 ? "km²" : "m²",
-          value: areaSize > 100000
-            ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m²
-            : Math.round(areaSize)
+          value:
+            areaSize > 100000
+              ? Math.round(areaSize / 1000) / 1000 // convert into 1 km² == 1000*1000 m² and round to 1000 m²
+              : Math.round(areaSize)
         });
       }
       if (this.drawMode === "LineString") {
@@ -148,7 +163,9 @@
     },
     disableCutTool() {
       this.$store.commit("map/setCurrentMeasurement", null);
-      this.getLayerByName("Cut Tool").data.getSource().clear();
+      this.getLayerByName("Cut Tool")
+        .data.getSource()
+        .clear();
       this.openLayersMap.removeInteraction(this.cutTool);
       this.$store.commit("map/cutTool", null);
     },
@@ -220,7 +237,7 @@
         transformedLine,
         featureCallback
       );
-    },
+    }
   }
 };
 </script>
--- a/client/src/imports/Imports.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/imports/Imports.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -43,4 +43,3 @@
   margin-right: auto;
 }
 </style>
-
--- a/client/src/imports/Job.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/imports/Job.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -33,4 +33,3 @@
   text-align: left;
 }
 </style>
-
--- a/client/src/map/Maplayer.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/map/Maplayer.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -74,13 +74,16 @@
       var features = this.openLayersMap.getFeaturesAtPixel(pixel);
       if (features) {
         this.$store.commit("map/setIdentifiedFeatures", features);
-        
+
         // get selected bottleneck from identified features
         for (let feature of features) {
           let id = feature.getId();
           // RegExp.prototype.test() works with number, str and undefined
           if (/^bottlenecks\./.test(id)) {
-            this.$store.dispatch("bottlenecks/setSelectedBottleneck", feature.get("objnam"));
+            this.$store.dispatch(
+              "bottlenecks/setSelectedBottleneck",
+              feature.get("objnam")
+            );
           }
         }
       }
--- a/client/src/morphtool/Morphtool.vue	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/morphtool/Morphtool.vue	Mon Nov 12 15:12:04 2018 +0100
@@ -122,8 +122,10 @@
       this.$store.dispatch("bottlenecks/setSelectedBottleneck", null);
       this.$store.commit("application/showSplitscreen", false);
       this.$store.commit("map/cutMode", false);
-      this.getLayerByName("Cut Tool").data.getSource().clear();
-      this.openLayersMap.removeInteraction(this.cutTool)
+      this.getLayerByName("Cut Tool")
+        .data.getSource()
+        .clear();
+      this.openLayersMap.removeInteraction(this.cutTool);
     }
   }
 };
--- a/client/src/store/map.js	Mon Nov 12 15:00:45 2018 +0100
+++ b/client/src/store/map.js	Mon Nov 12 15:12:04 2018 +0100
@@ -366,6 +366,6 @@
     },
     cutTool: (state, cutTool) => {
       state.cutTool = cutTool;
-    },
+    }
   }
 };