mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
add removeAddress button; buttonType different with edit context
This commit is contained in:
parent
1b3904f8e3
commit
9d1166d8fc
@ -24,14 +24,20 @@
|
|||||||
<li>
|
<li>
|
||||||
<add-address
|
<add-address
|
||||||
v-if="hasTemporaryAddressButton"
|
v-if="hasTemporaryAddressButton"
|
||||||
v-bind:context="context"
|
:context="context"
|
||||||
v-bind:key="addAddress.type"
|
:key="addAddress.type"
|
||||||
v-bind:options="addAddress.options"
|
:options="addAddress.options"
|
||||||
v-bind:result="addAddress.result"
|
:result="addAddress.result"
|
||||||
@submitAddress="submitAddress"
|
@submitAddress="submitAddress"
|
||||||
ref="addAddress">
|
ref="addAddress">
|
||||||
</add-address>
|
</add-address>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<button v-if="isContextEdit"
|
||||||
|
class="btn btn-remove"
|
||||||
|
@click="removeAddress"
|
||||||
|
:title="$t('courselocation.remove_button')"></button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +66,7 @@ export default {
|
|||||||
text: {
|
text: {
|
||||||
create: 'courselocation.add_temporary_address',
|
create: 'courselocation.add_temporary_address',
|
||||||
edit: 'courselocation.edit_temporary_address'
|
edit: 'courselocation.edit_temporary_address'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
create: 'courselocation.add_temporary_address',
|
create: 'courselocation.add_temporary_address',
|
||||||
@ -84,6 +90,9 @@ export default {
|
|||||||
},
|
},
|
||||||
isTemporaryAddress() {
|
isTemporaryAddress() {
|
||||||
return this.accompanyingCourse.locationStatus === 'address';
|
return this.accompanyingCourse.locationStatus === 'address';
|
||||||
|
},
|
||||||
|
isContextEdit() {
|
||||||
|
return this.context.edit;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -102,6 +111,13 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$store.commit('setAddressContext', context);
|
this.$store.commit('setAddressContext', context);
|
||||||
},
|
},
|
||||||
|
initAddressOptions() {
|
||||||
|
// here button.type is a contextual option
|
||||||
|
this.$refs.addAddress.$data.default.button.type = this.isContextEdit ? 'btn-update' : '';
|
||||||
|
},
|
||||||
|
removeAddress() {
|
||||||
|
console.log('remove address');
|
||||||
|
},
|
||||||
displayErrors() {
|
displayErrors() {
|
||||||
return this.$refs.addAddress.errorMsg;
|
return this.$refs.addAddress.errorMsg;
|
||||||
},
|
},
|
||||||
@ -117,6 +133,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initAddressContext();
|
this.initAddressContext();
|
||||||
|
this.initAddressOptions();
|
||||||
|
|
||||||
console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||||
console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||||
|
@ -69,7 +69,8 @@ const appMessages = {
|
|||||||
add_temporary_address: "Ajouter une adresse temporaire",
|
add_temporary_address: "Ajouter une adresse temporaire",
|
||||||
edit_temporary_address: "Modifier l'adresse temporaire",
|
edit_temporary_address: "Modifier l'adresse temporaire",
|
||||||
assign_course_address: "Désigner comme l'adresse du parcours",
|
assign_course_address: "Désigner comme l'adresse du parcours",
|
||||||
temporary_address_must_be_changed: "Cette addresse est temporaire et doit être remplacée rapidement par celle d'un usager de référence.",
|
remove_button: "Enlever l'adresse",
|
||||||
|
temporary_address_must_be_changed: "Cette addresse est temporaire et doit être remplacée par celle d'un usager de référence.",
|
||||||
},
|
},
|
||||||
referrer: {
|
referrer: {
|
||||||
title: "Référent du parcours",
|
title: "Référent du parcours",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user