changeset 1391:801ae5f4bc5b

fixed bug when changing additional survey in profile dialog
author Markus Kottlaender <markus@intevation.de>
date Wed, 28 Nov 2018 08:11:23 +0100
parents 69e0b75c0cc8
children 0e1d89241cda
files client/src/components/map/fairway/Fairwayprofile.vue client/src/components/map/fairway/Profiles.vue client/src/store/fairway.js
diffstat 3 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/map/fairway/Fairwayprofile.vue	Tue Nov 27 17:24:48 2018 +0100
+++ b/client/src/components/map/fairway/Fairwayprofile.vue	Wed Nov 28 08:11:23 2018 +0100
@@ -133,7 +133,7 @@
         return this.$store.getters["fairwayprofile/additionalSurvey"];
       },
       set(value) {
-        this.$store.commit("fairwayprofile/setAdditionalSurvey", value);
+        this.$store.commit("fairwayprofile/additionalSurvey", value);
         this.selectAdditionalSurveyData();
       }
     },
--- a/client/src/components/map/fairway/Profiles.vue	Tue Nov 27 17:24:48 2018 +0100
+++ b/client/src/components/map/fairway/Profiles.vue	Wed Nov 28 08:11:23 2018 +0100
@@ -202,7 +202,7 @@
         return this.$store.state.fairwayprofile.additionalSurvey;
       },
       set(survey) {
-        this.$store.commit("fairwayprofile/setAdditionalSurvey", survey);
+        this.$store.commit("fairwayprofile/additionalSurvey", survey);
       }
     },
     additionalSurveys() {
@@ -234,7 +234,10 @@
         this.selectedBottleneck + " (" + new Date().toISOString() + ")";
     },
     selectedSurvey(survey) {
-      if (survey) this.$store.dispatch("fairwayprofile/loadProfile", survey);
+      this.$store.commit("fairwayprofile/additionalSurvey", null);
+      if (survey) {
+        this.$store.dispatch("fairwayprofile/loadProfile", survey);
+      }
     },
     additionalSurvey(survey) {
       if (survey) this.$store.dispatch("fairwayprofile/loadProfile", survey);
--- a/client/src/store/fairway.js	Tue Nov 27 17:24:48 2018 +0100
+++ b/client/src/store/fairway.js	Wed Nov 28 08:11:23 2018 +0100
@@ -27,7 +27,7 @@
 // initial state
 const init = () => {
   return {
-    additionalSurvey: "",
+    additionalSurvey: null,
     totalLength: 0,
     minAlt: 0,
     maxAlt: 0,
@@ -55,7 +55,7 @@
     }
   },
   mutations: {
-    setAdditionalSurvey: (state, additionalSurvey) => {
+    additionalSurvey: (state, additionalSurvey) => {
       state.additionalSurvey = additionalSurvey;
     },
     setSelectedWaterLevel: (state, level) => {
@@ -93,7 +93,7 @@
       state.fairwayCoordinates = coordinates;
     },
     clearCurrentProfile: state => {
-      state.additionalSurvey = "";
+      state.additionalSurvey = null;
       state.currentProfile = {};
       state.minAlt = null;
       state.maxAlt = null;