CourseLocation: change add-address key, cleaning add-address options

This commit is contained in:
Mathieu Jaumotte 2021-09-27 11:17:13 +02:00
parent 349a0e69f1
commit 82db55cfec

View File

@ -37,9 +37,9 @@
<li>
<add-address
v-if="!isPersonLocation"
:key="key"
:context="context"
:key="addAddress.type"
:options="addAddress.options"
:options="options"
:addressChangedCallback="submitTemporaryAddress"
ref="addAddress">
</add-address>
@ -76,10 +76,7 @@ export default {
data() {
return {
addAddress: {
type: 'accompanying_course_location',
options: {
/// Options override default.
/// null value take default component value
button: {
text: {
create: 'courselocation.add_temporary_address',
@ -90,12 +87,6 @@ export default {
create: 'courselocation.add_temporary_address',
edit: 'courselocation.edit_temporary_address'
},
/// Display each step in page or Modal
openPanesInModal: true,
// Use Date fields
//useDate: {
// validFrom: true
//},
hideAddress: true
}
}
@ -109,6 +100,13 @@ export default {
...mapGetters([
'isLocationValid'
]),
options() {
return this.addAddress.options;
},
key() {
return (this.context.edit) ? 'address_' + this.context.addressId
: this.accompanyingCourse.type + '_' + this.accompanyingCourse.id ;
},
isTemporaryAddress() {
return this.accompanyingCourse.locationStatus === 'address';
},