mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Address datePane: convert selectedAddress to pass and view it with addressRenderBox
This commit is contained in:
parent
1c568a75ec
commit
0808f5a6f3
@ -98,6 +98,9 @@ section.chill-entity {
|
|||||||
&.date-since {}
|
&.date-since {}
|
||||||
&.date-until {}
|
&.date-until {}
|
||||||
}
|
}
|
||||||
|
.address-more {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// used for comment-embeddable
|
// used for comment-embeddable
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
{{ errorMsg }}
|
{{ errorMsg }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<address-render-box :address="entity.selected.address"></address-render-box>
|
<address-render-box :address="selectedAddress"></address-render-box>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div v-if="showDateFrom" class='col-lg-6 address-valid date-since'>
|
<div v-if="showDateFrom" class='col-lg-6 address-valid date-since'>
|
||||||
@ -104,6 +104,35 @@ export default {
|
|||||||
},
|
},
|
||||||
showDateTo() {
|
showDateTo() {
|
||||||
return !this.context.edit && this.options.useDate.validTo;
|
return !this.context.edit && this.options.useDate.validTo;
|
||||||
|
},
|
||||||
|
selectedAddress() {
|
||||||
|
let address = {};
|
||||||
|
|
||||||
|
address['country'] = (this.entity.selected.country) ? this.entity.selected.country : null;
|
||||||
|
address['postcode'] = (this.entity.selected.postcode) ? this.entity.selected.postcode : null;
|
||||||
|
|
||||||
|
if (this.entity.selected.address) {
|
||||||
|
let number = (this.entity.selected.address.streetNumber) ? this.entity.selected.address.streetNumber : null;
|
||||||
|
let street = (this.entity.selected.address.street) ? this.entity.selected.address.street : null;
|
||||||
|
address['text'] = number + ', ' + street;
|
||||||
|
|
||||||
|
address['street'] = (this.entity.selected.address.street) ? this.entity.selected.address.street : null;
|
||||||
|
address['streetNumber'] = (this.entity.selected.address.streetNumber) ? this.entity.selected.address.streetNumber : null;
|
||||||
|
address['floor'] = (this.entity.selected.address.floor) ? this.entity.selected.address.floor : null;
|
||||||
|
address['corridor'] = (this.entity.selected.address.corridor) ? this.entity.selected.address.corridor : null;
|
||||||
|
address['steps'] = (this.entity.selected.address.steps) ? this.entity.selected.address.steps : null;
|
||||||
|
address['flat'] = (this.entity.selected.address.flat) ? this.entity.selected.address.flat : null;
|
||||||
|
address['buildingName'] = (this.entity.selected.address.buildingName) ? this.entity.selected.address.buildingName : null;
|
||||||
|
address['distribution'] = (this.entity.selected.address.distribution) ? this.entity.selected.address.distribution : null;
|
||||||
|
address['extra'] = (this.entity.selected.address.extra) ? this.entity.selected.address.extra : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.entity.selected.valid) {
|
||||||
|
address['validFrom'] = (this.entity.selected.valid.from) ? dateToISO(this.entity.selected.valid.from) : null;
|
||||||
|
address['validTo'] = (this.entity.selected.valid.to) ? dateToISO(this.entity.selected.valid.to) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return address;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user