Mercurial > gemma
changeset 1013:15c3cc6f29a4
refac: fairwayprofile store cleanup
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 23 Oct 2018 12:08:49 +0200 |
parents | 875b0a9a3c92 |
children | 77202406b1a7 |
files | client/src/application/Main.vue client/src/fairway/store.js |
diffstat | 2 files changed, 6 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/application/Main.vue Tue Oct 23 11:32:47 2018 +0200 +++ b/client/src/application/Main.vue Tue Oct 23 12:08:49 2018 +0200 @@ -17,7 +17,7 @@ <script> import Maplayer from "../map/Maplayer"; import FairwayProfile from "../fairway/Fairwayprofile"; -import { mapGetters } from "vuex"; +import { mapGetters, mapState } from "vuex"; import debounce from "debounce"; export default { @@ -40,7 +40,7 @@ }, computed: { ...mapGetters("application", ["isSplitscreen", "drawMode"]), - ...mapGetters("fairwayprofile", [ + ...mapState("fairwayprofile", [ "currentProfile", "minAlt", "maxAlt",
--- a/client/src/fairway/store.js Tue Oct 23 11:32:47 2018 +0200 +++ b/client/src/fairway/store.js Tue Oct 23 12:08:49 2018 +0200 @@ -6,6 +6,7 @@ const FairwayProfile = { namespaced: true, state: { + availableSurveys: null, totalLength: 0, minAlt: 0, maxAlt: 0, @@ -17,38 +18,14 @@ endPoint: null }, getters: { - selectedWaterLevel: state => { - return state.selectedWaterLevel; - }, - fairwayCoordinates: state => { - return state.fairwayCoordinates; - }, - waterLevels: state => { - return state.waterLevels; - }, - currentProfile: state => { - return state.currentProfile; - }, - startPoint: state => { - return state.startPoint; - }, - endPoint: state => { - return state.endPoint; - }, length: state => { return state.totalLength; - }, - minAlt: state => { - return state.minAlt; - }, - maxAlt: state => { - return state.maxAlt; - }, - totalLength: state => { - return state.totalLength; } }, mutations: { + setAvailableSurveys: (state, surveys) => { + state.availableSurveys = surveys; + }, setSelectedWaterLevel: (state, level) => { state.selectedWaterLevel = level; },