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
|
Requestor
|
||||||
},
|
},
|
||||||
computed: mapState([
|
computed: mapState([
|
||||||
'accompanying_course'
|
'accompanyingCourse'
|
||||||
])
|
])
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
<h3>{{ $t('course.title') }}</h3>
|
<h3>{{ $t('course.title') }}</h3>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>{{ $t('course.id') }}</dt>
|
<dt>{{ $t('course.id') }}</dt>
|
||||||
<dd>{{ accompanying_course.id }}</dd>
|
<dd>{{ accompanyingCourse.id }}</dd>
|
||||||
<dt>{{ $t('course.opening_date') }}</dt>
|
<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>
|
<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>
|
<dt>{{ $t('course.remark') }}</dt>
|
||||||
<dd>{{ accompanying_course.remark }}</dd>
|
<dd>{{ accompanyingCourse.remark }}</dd>
|
||||||
<dt>{{ $t('course.closing_motive') }}</dt>
|
<dt>{{ $t('course.closing_motive') }}</dt>
|
||||||
<dd>{{ accompanying_course.closing_motive }}</dd>
|
<dd>{{ accompanyingCourse.closing_motive }}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -20,8 +20,8 @@
|
|||||||
export default {
|
export default {
|
||||||
name: 'AccompanyingCourse',
|
name: 'AccompanyingCourse',
|
||||||
computed: {
|
computed: {
|
||||||
accompanying_course() {
|
accompanyingCourse() {
|
||||||
return this.$store.state.accompanying_course
|
return this.$store.state.accompanyingCourse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ export default {
|
|||||||
AddPersons
|
AddPersons
|
||||||
},
|
},
|
||||||
computed: mapState({
|
computed: mapState({
|
||||||
participations: state => state.accompanying_course.participations,
|
participations: state => state.accompanyingCourse.participations,
|
||||||
counter: state => state.accompanying_course.participations.length
|
counter: state => state.accompanyingCourse.participations.length
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
removeParticipation(item) {
|
removeParticipation(item) {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="vue-component">
|
<div class="vue-component">
|
||||||
<h3>{{ $t('requestor.title') }}</h3>
|
<h3>{{ $t('requestor.title') }}</h3>
|
||||||
{{ accompanying_course.id }}
|
{{ accompanyingCourse.id }}
|
||||||
{{ accompanying_course.remark }}<br><br>
|
{{ accompanyingCourse.remark }}<br><br>
|
||||||
|
|
||||||
<!-- TESTS AREA -->
|
<!-- TESTS AREA -->
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
@ -78,8 +78,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
accompanying_course() {
|
accompanyingCourse() {
|
||||||
return this.$store.state.accompanying_course
|
return this.$store.state.accompanyingCourse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import App from './App.vue';
|
|||||||
initPromise.then(store => {
|
initPromise.then(store => {
|
||||||
|
|
||||||
//console.log('store in create_store', 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);
|
const i18n = _createI18n(appMessages);
|
||||||
|
|
||||||
|
@ -13,10 +13,10 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
const store = createStore({
|
const store = createStore({
|
||||||
strict: debug,
|
strict: debug,
|
||||||
modules: {
|
modules: {
|
||||||
addPersons: addPersons
|
addPersons
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
accompanying_course: accompanying_course,
|
accompanyingCourse: accompanying_course,
|
||||||
errorMsg: []
|
errorMsg: []
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -24,20 +24,20 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
mutations: {
|
mutations: {
|
||||||
removeParticipation(state, item) {
|
removeParticipation(state, item) {
|
||||||
//console.log('mutation: remove item', item.id);
|
//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 }) {
|
closeParticipation(state, { participation, payload }) {
|
||||||
console.log('### mutation: close item', { participation, payload });
|
console.log('### mutation: close item', { participation, payload });
|
||||||
// temporaire, le temps que le backend ajoute la enddate
|
// temporaire, le temps que le backend ajoute la enddate
|
||||||
participation.endDate = { datetime: "2021-05-06T10:49:00+0200" };
|
participation.endDate = { datetime: "2021-05-06T10:49:00+0200" };
|
||||||
// trouve dans le state le payload et le supprime du state
|
// 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
|
// pousse la participation
|
||||||
state.accompanying_course.participations.push(participation);
|
state.accompanyingCourse.participations.push(participation);
|
||||||
},
|
},
|
||||||
addParticipation(state, participation) {
|
addParticipation(state, participation) {
|
||||||
//console.log('### mutation: add participation', participation);
|
//console.log('### mutation: add participation', participation);
|
||||||
state.accompanying_course.participations.push(participation);
|
state.accompanyingCourse.participations.push(participation);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
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);
|
resolve(store);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user