Tutor selection now persists between observation sessions.

This commit is contained in:
neviyn 2018-11-01 14:39:11 +00:00
parent 73a9592be7
commit 3211a5af50
2 changed files with 10 additions and 11 deletions

View File

@ -26,13 +26,6 @@ export default new Vuex.Store({
},
setWhom(state, newWhom) {
state.whom = newWhom;
},
resetStore(state) {
state.site = null;
state.tutors = [];
state.description = null;
state.type = null;
state.whom = null;
}
},
actions: {}

View File

@ -64,8 +64,7 @@
<b-form-group label="Tutor(s)">
<p v-if="site == null">Select a site first.</p>
<v-icon name="spinner" spin v-if="loadingTutors"/>
<b-form-checkbox-group :value="tutors" @input="setTutors"
:options="tutorOptions"></b-form-checkbox-group>
<b-form-checkbox-group v-model="iTutors" :options="tutorOptions"></b-form-checkbox-group>
</b-form-group>
</b-col>
</b-row>
@ -95,10 +94,12 @@ export default {
loadingTutors: false,
loaded: false,
errorMessage: null,
errorStatus: null
errorStatus: null,
iTutors: []
};
},
mounted() {
this.iTutors = this.tutors;
Vue.axios
.get("/site")
.then(response => {
@ -125,8 +126,13 @@ export default {
site: function() {
this.loadingTutors = true;
this.tutorOptions = [];
this.tutors = [];
this.getTutors();
this.iTutors = this.iTutors.filter(x => this.tutorOptions.indexOf(x) !== -1)
},
iTutors: function() {
if(this.tutors !== this.iTutors) {
this.setTutors(this.iTutors)
}
}
},
methods: {