comparison client/src/morphtool/Morphtool.vue @ 1027:04a9e78dcc5f

refac: remove morphstore. not necessary
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 24 Oct 2018 14:17:51 +0200
parents ca628dce90dd
children 5a43d5602d14 7ec2133c6404
comparison
equal deleted inserted replaced
1026:3de54d7b7d30 1027:04a9e78dcc5f
3 <div v-if="selectedBottleneck"> 3 <div v-if="selectedBottleneck">
4 <div v-if="surveyList && !drawMode" class="ui-element card card-body shadow"> 4 <div v-if="surveyList && !drawMode" class="ui-element card card-body shadow">
5 <div class="headline"> 5 <div class="headline">
6 <h4>{{bottleneckName}}</h4> 6 <h4>{{bottleneckName}}</h4>
7 <hr> 7 <hr>
8 <div @click="clearSelection" class="float-left ui-element d-flex morphtoolminus"> 8 <div
9 @click="clearSelection"
10 class="float-left ui-element d-flex morphtoolminus"
11 >
9 <i class="fa fa-close morphtoolsminus"></i> 12 <i class="fa fa-close morphtoolsminus"></i>
10 </div> 13 </div>
11 </div> 14 </div>
12 <ul class="list-group surveylist"> 15 <ul class="list-group surveylist">
13 <li v-for="survey of surveyList.surveys" :key="survey.data_info" class="list-group-item" @click.prevent="selectSurvey(survey)"> 16 <li
14 <a href="#" @click.prevent="">{{survey.date_info}}</a> 17 v-for="survey of surveyList.surveys"
18 :key="survey.data_info"
19 class="list-group-item"
20 @click.prevent="selectSurvey(survey)"
21 >
22 <a href="#" @click.prevent>{{survey.date_info}}</a>
15 </li> 23 </li>
16 </ul> 24 </ul>
17 </div> 25 </div>
18 </div> 26 </div>
19 <div v-if="selectedMorph" @click="clearSelection" class="ui-element shadow morphtool"> 27 <div v-if="selectedMorph" @click="clearSelection" class="ui-element shadow morphtool">
20 <div class="d-flex flex-row justify-content-between"> 28 <div class="d-flex flex-row justify-content-between">
21 <i class="fa fa-close text-danger"></i> 29 <i class="fa fa-close text-danger"></i>
22 <small>Bottleneck:&nbsp;</small> 30 <small>Bottleneck:&nbsp;</small>
23 <h6>{{bottleneckName}} <small>( {{selectedMorph.date_info}} )</small></h6> 31 <h6>
32 {{bottleneckName}}
33 <small>( {{selectedMorph.date_info}} )</small>
34 </h6>
24 </div> 35 </div>
25 </div> 36 </div>
26 </div> 37 </div>
27 </template> 38 </template>
28 39
109 }; 120 };
110 }, 121 },
111 computed: { 122 computed: {
112 ...mapGetters("application", ["drawMode"]), 123 ...mapGetters("application", ["drawMode"]),
113 ...mapState("identifystore", ["identifiedFeatures"]), 124 ...mapState("identifystore", ["identifiedFeatures"]),
114 ...mapState("morphstore", ["selectedMorph"]), 125 ...mapState("fairwayprofile", ["selectedMorph"]),
115 selectedBottleneck: function() { 126 selectedBottleneck: function() {
116 if (this.identifiedFeatures && !this.drawMode) { 127 if (this.identifiedFeatures && !this.drawMode) {
117 for (let feature of this.identifiedFeatures) { 128 for (let feature of this.identifiedFeatures) {
118 let id = feature.getId(); 129 let id = feature.getId();
119 // RegExp.prototype.test() works with number, str and undefined 130 // RegExp.prototype.test() works with number, str and undefined
120 if (/^bottlenecks\./.test(id)) { 131 if (/^bottlenecks\./.test(id)) {
121 this.$store.commit("morphstore/setSelectedMorph", null); 132 this.$store.commit("fairwayprofile/setSelectedMorph", null);
122 return feature; 133 return feature;
123 } 134 }
124 } 135 }
125 } 136 }
126 return null; 137 return null;
161 message: `${status}: ${data.message || data}` 172 message: `${status}: ${data.message || data}`
162 }); 173 });
163 }); 174 });
164 }, 175 },
165 selectSurvey(survey) { 176 selectSurvey(survey) {
166 this.$store.commit("morphstore/setSelectedMorph", survey); 177 this.$store.commit("fairwayprofile/setSelectedMorph", survey);
167 this.surveyList = null; 178 this.surveyList = null;
168 }, 179 },
169 clearSelection() { 180 clearSelection() {
170 this.$store.commit("identifystore/setIdentifiedFeatures", []); 181 this.$store.commit("identifystore/setIdentifiedFeatures", []);
171 this.$store.commit("morphstore/setSelectedMorph", null); 182 this.$store.commit("fairwayprofile/setSelectedMorph", null);
172 this.surveyList = null; 183 this.surveyList = null;
173 if (this.drawMode) { 184 if (this.drawMode) {
174 this.$store.commit("application/toggleDrawModeLine"); 185 this.$store.commit("application/toggleDrawModeLine");
175 } 186 }
176 } 187 }