mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add removeAddress button; buttonType different with edit context
This commit is contained in:
parent
1b3904f8e3
commit
9d1166d8fc
@ -24,14 +24,20 @@
|
||||
<li>
|
||||
<add-address
|
||||
v-if="hasTemporaryAddressButton"
|
||||
v-bind:context="context"
|
||||
v-bind:key="addAddress.type"
|
||||
v-bind:options="addAddress.options"
|
||||
v-bind:result="addAddress.result"
|
||||
:context="context"
|
||||
:key="addAddress.type"
|
||||
:options="addAddress.options"
|
||||
:result="addAddress.result"
|
||||
@submitAddress="submitAddress"
|
||||
ref="addAddress">
|
||||
</add-address>
|
||||
</li>
|
||||
<li>
|
||||
<button v-if="isContextEdit"
|
||||
class="btn btn-remove"
|
||||
@click="removeAddress"
|
||||
:title="$t('courselocation.remove_button')"></button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@ -60,7 +66,7 @@ export default {
|
||||
text: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
edit: 'courselocation.edit_temporary_address'
|
||||
},
|
||||
}
|
||||
},
|
||||
title: {
|
||||
create: 'courselocation.add_temporary_address',
|
||||
@ -84,6 +90,9 @@ export default {
|
||||
},
|
||||
isTemporaryAddress() {
|
||||
return this.accompanyingCourse.locationStatus === 'address';
|
||||
},
|
||||
isContextEdit() {
|
||||
return this.context.edit;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -102,6 +111,13 @@ export default {
|
||||
}
|
||||
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() {
|
||||
return this.$refs.addAddress.errorMsg;
|
||||
},
|
||||
@ -117,6 +133,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.initAddressContext();
|
||||
this.initAddressOptions();
|
||||
|
||||
console.log('ac.locationStatus', this.accompanyingCourse.locationStatus);
|
||||
console.log('ac.location (temporary location)', this.accompanyingCourse.location);
|
||||
|
@ -69,7 +69,8 @@ const appMessages = {
|
||||
add_temporary_address: "Ajouter une adresse temporaire",
|
||||
edit_temporary_address: "Modifier l'adresse temporaire",
|
||||
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: {
|
||||
title: "Référent du parcours",
|
||||
|
Loading…
x
Reference in New Issue
Block a user