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) { setWhom(state, newWhom) {
state.whom = newWhom; state.whom = newWhom;
},
resetStore(state) {
state.site = null;
state.tutors = [];
state.description = null;
state.type = null;
state.whom = null;
} }
}, },
actions: {} actions: {}

View File

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