mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
renaming store state dict name
This commit is contained in:
parent
b4274264a7
commit
6f5d457122
@ -19,7 +19,7 @@ export default {
|
||||
Requestor
|
||||
},
|
||||
computed: mapState([
|
||||
'accompanying_course'
|
||||
'accompanyingCourse'
|
||||
])
|
||||
};
|
||||
</script>
|
||||
|
@ -3,15 +3,15 @@
|
||||
<h3>{{ $t('course.title') }}</h3>
|
||||
<dl>
|
||||
<dt>{{ $t('course.id') }}</dt>
|
||||
<dd>{{ accompanying_course.id }}</dd>
|
||||
<dd>{{ accompanyingCourse.id }}</dd>
|
||||
<dt>{{ $t('course.opening_date') }}</dt>
|
||||
<dd>{{ $d(accompanying_course.openingDate.datetime, 'short') }}</dd>
|
||||
<dd>{{ $d(accompanyingCourse.openingDate.datetime, 'short') }}</dd>
|
||||
<dt>{{ $t('course.closing_date') }}</dt>
|
||||
<dd>{{ $d(accompanying_course.closingDate.datetime, 'short') }}</dd>
|
||||
<dd>{{ $d(accompanyingCourse.closingDate.datetime, 'short') }}</dd>
|
||||
<dt>{{ $t('course.remark') }}</dt>
|
||||
<dd>{{ accompanying_course.remark }}</dd>
|
||||
<dd>{{ accompanyingCourse.remark }}</dd>
|
||||
<dt>{{ $t('course.closing_motive') }}</dt>
|
||||
<dd>{{ accompanying_course.closing_motive }}</dd>
|
||||
<dd>{{ accompanyingCourse.closing_motive }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</template>
|
||||
@ -20,8 +20,8 @@
|
||||
export default {
|
||||
name: 'AccompanyingCourse',
|
||||
computed: {
|
||||
accompanying_course() {
|
||||
return this.$store.state.accompanying_course
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ export default {
|
||||
AddPersons
|
||||
},
|
||||
computed: mapState({
|
||||
participations: state => state.accompanying_course.participations,
|
||||
counter: state => state.accompanying_course.participations.length
|
||||
participations: state => state.accompanyingCourse.participations,
|
||||
counter: state => state.accompanyingCourse.participations.length
|
||||
}),
|
||||
methods: {
|
||||
removeParticipation(item) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="vue-component">
|
||||
<h3>{{ $t('requestor.title') }}</h3>
|
||||
{{ accompanying_course.id }}
|
||||
{{ accompanying_course.remark }}<br><br>
|
||||
{{ accompanyingCourse.id }}
|
||||
{{ accompanyingCourse.remark }}<br><br>
|
||||
|
||||
<!-- TESTS AREA -->
|
||||
<ul class="record_actions">
|
||||
@ -78,8 +78,8 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
accompanying_course() {
|
||||
return this.$store.state.accompanying_course
|
||||
accompanyingCourse() {
|
||||
return this.$store.state.accompanyingCourse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import App from './App.vue';
|
||||
initPromise.then(store => {
|
||||
|
||||
//console.log('store in create_store', store);
|
||||
//console.log('store accompanyingCourse', store.state.accompanying_course);
|
||||
//console.log('store accompanyingCourse', store.state.accompanyingCourse);
|
||||
|
||||
const i18n = _createI18n(appMessages);
|
||||
|
||||
|
@ -13,10 +13,10 @@ let initPromise = getAccompanyingCourse(id)
|
||||
const store = createStore({
|
||||
strict: debug,
|
||||
modules: {
|
||||
addPersons: addPersons
|
||||
addPersons
|
||||
},
|
||||
state: {
|
||||
accompanying_course: accompanying_course,
|
||||
accompanyingCourse: accompanying_course,
|
||||
errorMsg: []
|
||||
},
|
||||
getters: {
|
||||
@ -24,20 +24,20 @@ let initPromise = getAccompanyingCourse(id)
|
||||
mutations: {
|
||||
removeParticipation(state, item) {
|
||||
//console.log('mutation: remove item', item.id);
|
||||
state.accompanying_course.participations = state.accompanying_course.participations.filter(participation => participation !== item);
|
||||
state.accompanyingCourse.participations = state.accompanyingCourse.participations.filter(participation => participation !== item);
|
||||
},
|
||||
closeParticipation(state, { participation, payload }) {
|
||||
console.log('### mutation: close item', { participation, payload });
|
||||
// temporaire, le temps que le backend ajoute la enddate
|
||||
participation.endDate = { datetime: "2021-05-06T10:49:00+0200" };
|
||||
// trouve dans le state le payload et le supprime du state
|
||||
state.accompanying_course.participations = state.accompanying_course.participations.filter(participation => participation !== payload);
|
||||
state.accompanyingCourse.participations = state.accompanyingCourse.participations.filter(participation => participation !== payload);
|
||||
// pousse la participation
|
||||
state.accompanying_course.participations.push(participation);
|
||||
state.accompanyingCourse.participations.push(participation);
|
||||
},
|
||||
addParticipation(state, participation) {
|
||||
//console.log('### mutation: add participation', participation);
|
||||
state.accompanying_course.participations.push(participation);
|
||||
state.accompanyingCourse.participations.push(participation);
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
@ -71,7 +71,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
}
|
||||
});
|
||||
//console.log('store object', store.state.accompanying_course.id);
|
||||
//console.log('store object', store.state.accompanyingCourse.id);
|
||||
resolve(store);
|
||||
}));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user