changeset 1101:67e9355e7a58

fix lint errors
author Markus Kottlaender <markus@intevation.de>
date Fri, 02 Nov 2018 08:32:58 +0100
parents 2f8596a0d254
children 87eba533fa2f dfe3966bb308
files client/src/bottlenecks/Bottlenecks.vue
diffstat 1 files changed, 44 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/bottlenecks/Bottlenecks.vue	Fri Nov 02 08:24:01 2018 +0100
+++ b/client/src/bottlenecks/Bottlenecks.vue	Fri Nov 02 08:32:58 2018 +0100
@@ -107,45 +107,50 @@
   },
   methods: {
     filteredAndSortedBottlenecks() {
-      return this.bottlenecks.filter(bn => {
-        return bn.properties.name
-          .toLowerCase()
-          .includes(this.search.toLowerCase());
-      }).sort((bnA, bnB) => {
-        switch (this.sortColumn) {
-          case "name":
-            if (
-              bnA.properties.name.toLowerCase() <
-              bnB.properties.name.toLowerCase()
-            )
-              return this.sortDirection === "ASC" ? -1 : 1;
-            if (
-              bnA.properties.name.toLowerCase() >
-              bnB.properties.name.toLowerCase()
-            )
-              return this.sortDirection === "ASC" ? 1 : -1;
-            return 0;
+      return this.bottlenecks
+        .filter(bn => {
+          return bn.properties.name
+            .toLowerCase()
+            .includes(this.search.toLowerCase());
+        })
+        .sort((bnA, bnB) => {
+          switch (this.sortColumn) {
+            case "name":
+              if (
+                bnA.properties.name.toLowerCase() <
+                bnB.properties.name.toLowerCase()
+              )
+                return this.sortDirection === "ASC" ? -1 : 1;
+              if (
+                bnA.properties.name.toLowerCase() >
+                bnB.properties.name.toLowerCase()
+              )
+                return this.sortDirection === "ASC" ? 1 : -1;
+              return 0;
 
-          case "latestMeasurement":
-            const currentA = bnA.properties.current || '';
-            const currentB = bnB.properties.current || '';
-            if (currentA < currentB)
-              return this.sortDirection === "ASC" ? -1 : 1;
-            if (currentA > currentB)
-              return this.sortDirection === "ASC" ? 1 : -1;
-            return 0;
+            case "latestMeasurement": {
+              if (
+                (bnA.properties.current || "") < (bnB.properties.current || "")
+              )
+                return this.sortDirection === "ASC" ? -1 : 1;
+              if (
+                (bnA.properties.current || "") > (bnB.properties.current || "")
+              )
+                return this.sortDirection === "ASC" ? 1 : -1;
+              return 0;
+            }
 
-          case "chainage":
-            if (bnA.properties.from < bnB.properties.from)
-              return this.sortDirection === "ASC" ? -1 : 1;
-            if (bnA.properties.from > bnB.properties.from)
-              return this.sortDirection === "ASC" ? 1 : -1;
-            return 0;
+            case "chainage":
+              if (bnA.properties.from < bnB.properties.from)
+                return this.sortDirection === "ASC" ? -1 : 1;
+              if (bnA.properties.from > bnB.properties.from)
+                return this.sortDirection === "ASC" ? 1 : -1;
+              return 0;
 
-          default:
-            return 0;
-        }
-      });
+            default:
+              return 0;
+          }
+        });
     },
     selectSurvey(survey, bottleneck) {
       this.$store.commit("fairwayprofile/setSelectedMorph", survey);
@@ -202,7 +207,9 @@
       return current ? current.substr(0, current.length - 1) : "";
     },
     displayCurrentChainage(bottleneck) {
-      return (bottleneck.properties.from / 10) + " - " + (bottleneck.properties.to / 10);
+      return (
+        bottleneck.properties.from / 10 + " - " + bottleneck.properties.to / 10
+      );
     }
   },
   mounted() {