diff client/src/morphtool/Morphtool.vue @ 975:3da707172772

refac: removed technical debt Cleaned up mapstore to adhere more to Single Repsonsibility Principle (SRP)
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 18 Oct 2018 16:47:17 +0200
parents d7f34791b18d
children d9cc1e906469
line wrap: on
line diff
--- a/client/src/morphtool/Morphtool.vue	Thu Oct 18 15:11:49 2018 +0200
+++ b/client/src/morphtool/Morphtool.vue	Thu Oct 18 16:47:17 2018 +0200
@@ -93,14 +93,15 @@
   },
   computed: {
     ...mapGetters("application", ["drawMode"]),
-    ...mapState("mapstore", ["identifiedFeatures", "selectedMorph"]),
+    ...mapState("identifystore", ["identifiedFeatures"]),
+    ...mapState("morphstore", ["selectedMorph"]),
     selectedBottleneck: function() {
       if (this.identifiedFeatures && !this.drawMode) {
         for (let feature of this.identifiedFeatures) {
           let id = feature.getId();
           // RegExp.prototype.test() works with number, str and undefined
           if (/^bottlenecks\./.test(id)) {
-            this.$store.commit("mapstore/setSelectedMorph", null);
+            this.$store.commit("morphstore/setSelectedMorph", null);
             return feature;
           }
         }
@@ -140,12 +141,12 @@
         });
     },
     selectSurvey(survey) {
-      this.$store.commit("mapstore/setSelectedMorph", survey);
+      this.$store.commit("morphstore/setSelectedMorph", survey);
       this.surveyList = null;
     },
     clearSelection() {
-      this.$store.commit("mapstore/setIdentifiedFeatures", []);
-      this.$store.commit("mapstore/setSelectedMorph", null);
+      this.$store.commit("identifystore/setIdentifiedFeatures", []);
+      this.$store.commit("morphstore/setSelectedMorph", null);
       this.surveyList = null;
       if (this.drawMode) {
         this.$store.commit("application/toggleDrawModeLine");