mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 13:54:59 +00:00
Merge remote-tracking branch 'origin/master' into 20-update-telephone-type-new-approach
This commit is contained in:
@@ -34,33 +34,45 @@
|
||||
<slot name="record-actions"></slot>
|
||||
</div>
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-if="getProfession.length > 0">
|
||||
<i class="fa fa-li fa-id-card"></i>
|
||||
<p><span v-for="p in getProfession" :key="p" class="list-item">{{ p[0].toUpperCase() + p.slice(1).toLowerCase() }}</span></p>
|
||||
</li>
|
||||
<li v-if="hasParent">
|
||||
<i class="fa fa-li fa-hand-o-right"></i>
|
||||
<b class="me-2">{{ $t('child_of') }}</b>
|
||||
<span class="chill-entity badge-thirdparty">{{ thirdparty.parent.text }}</span>
|
||||
<on-the-fly
|
||||
:type="thirdparty.parent.type"
|
||||
:id="thirdparty.parent.id"
|
||||
:buttonText="thirdparty.parent.text"
|
||||
:displayBadge="'true' === 'true'"
|
||||
action="show">
|
||||
</on-the-fly>
|
||||
</li>
|
||||
<!-- TODO hasChildren
|
||||
NB: we cannot call on-the-fly from RenderBox. See error message in previous version of this file.
|
||||
-->
|
||||
</ul>
|
||||
<confidential v-if="thirdparty.contactDataAnonymous">
|
||||
<template v-slot:confidential-content>
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-if="thirdparty.address">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</li>
|
||||
<li v-if="thirdparty.phonenumber">
|
||||
<i class="fa fa-li fa-mobile"></i>
|
||||
<a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i class="fa fa-li fa-envelope-o"></i>
|
||||
<a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</confidential>
|
||||
<div v-if="thirdparty.contactDataAnonymous">
|
||||
<confidential>
|
||||
<template v-slot:confidential-content>
|
||||
<ul class="list-content fa-ul">
|
||||
<li v-if="thirdparty.address">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
<address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box>
|
||||
</li>
|
||||
<li v-if="thirdparty.phonenumber">
|
||||
<i class="fa fa-li fa-mobile"></i>
|
||||
<a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a>
|
||||
</li>
|
||||
<li v-if="thirdparty.email">
|
||||
<i class="fa fa-li fa-envelope-o"></i>
|
||||
<a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
</confidential>
|
||||
</div>
|
||||
<ul v-else class="list-content fa-ul">
|
||||
<li v-if="thirdparty.address">
|
||||
<i class="fa fa-li fa-map-marker"></i>
|
||||
@@ -88,10 +100,8 @@
|
||||
|
||||
<script>
|
||||
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
|
||||
import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
|
||||
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
|
||||
import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue';
|
||||
//import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
|
||||
export default {
|
||||
name: "ThirdPartyRenderBox",
|
||||
@@ -99,7 +109,10 @@ export default {
|
||||
AddressRenderBox,
|
||||
Confidential,
|
||||
BadgeEntity,
|
||||
//OnTheFly
|
||||
},
|
||||
// To avoid components recursively invoking eachother resolve OnTheFly component here
|
||||
beforeCreate() {
|
||||
this.$options.components.OnTheFly = require('ChillMainAssets/vuejs/OnTheFly/components/OnTheFly').default;
|
||||
},
|
||||
i18n: {
|
||||
messages: {
|
||||
@@ -120,6 +133,18 @@ export default {
|
||||
hasParent() {
|
||||
return !(this.thirdparty.parent === null || this.thirdparty.parent === undefined);
|
||||
},
|
||||
getProfession() {
|
||||
let profession = []
|
||||
if (this.hasParent && this.thirdparty.profession) {
|
||||
profession.push(this.thirdparty.profession.name.fr)
|
||||
return profession;
|
||||
}
|
||||
|
||||
if (!this.hasParent && this.thirdparty.category) {
|
||||
profession = this.thirdparty.category.map((category) => category.text);
|
||||
}
|
||||
return profession;
|
||||
}
|
||||
/* TODO need backend normalizer to serve children without circular reference
|
||||
hasChildren() {
|
||||
//console.log(this.thirdparty.activeChildren.length > 0)
|
||||
@@ -139,6 +164,15 @@ export default {
|
||||
font-variant: all-small-caps;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
&::after {
|
||||
content: " | ";
|
||||
}
|
||||
&:last-child::after {
|
||||
content: ""
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user