further implementation in vue elements

This commit is contained in:
Julie Lenaerts 2021-10-27 11:14:27 +02:00
parent 5cf94a5ed6
commit 3f869e9ca5
10 changed files with 97 additions and 18 deletions

View File

@ -1,9 +1,9 @@
.confidential{ .confidential{
display: flex; display: flex;
align-items: center;
} }
.toggle{ .toggle{
margin-left: 10px; margin-left: 30px;
margin-top: 5px;
cursor: pointer; cursor: pointer;
} }
.blur { .blur {

View File

@ -23,9 +23,10 @@ export default {
} }
</script> </script>
<style lang='scss'> <style scoped lang='scss'>
.confidential{ .confidential{
align-items: center; align-items: center;
display: flex;
} }
.toggle{ .toggle{
margin-top: 28px; margin-top: 28px;

View File

@ -12,6 +12,7 @@
{{ encore_entry_link_tags('mod_forkawesome') }} {{ encore_entry_link_tags('mod_forkawesome') }}
{{ encore_entry_link_tags('mod_ckeditor5') }} {{ encore_entry_link_tags('mod_ckeditor5') }}
{{ encore_entry_link_tags('chill') }} {{ encore_entry_link_tags('chill') }}
{{ encore_entry_link_tags('mod_blur') }}
{% block css %}<!-- nothing added to css -->{% endblock %} {% block css %}<!-- nothing added to css -->{% endblock %}
</head> </head>

View File

@ -8,7 +8,7 @@
<persons-associated></persons-associated> <persons-associated></persons-associated>
<course-location></course-location> <course-location></course-location>
<origin-demand></origin-demand> <origin-demand></origin-demand>
<requestor></requestor> <requestor v-bind:isAnonymous="accompanyingCourse.requestorAnonymous"></requestor>
<social-issue></social-issue> <social-issue></social-issue>
<scopes></scopes> <scopes></scopes>
<referrer></referrer> <referrer></referrer>

View File

@ -3,7 +3,7 @@
<h2><a id="section-40"></a>{{ $t('requestor.title') }}</h2> <h2><a id="section-40"></a>{{ $t('requestor.title') }}</h2>
<div v-if="accompanyingCourse.requestor" class="flex-table"> <div v-if="accompanyingCourse.requestor && isAnonymous" class="flex-table">
<label> <label>
<input type="checkbox" v-model="isAnonymous" class="me-2" /> <input type="checkbox" v-model="isAnonymous" class="me-2" />
@ -68,6 +68,57 @@
</li> </li>
</ul> </ul>
</div> </div>
<div v-else-if="accompanyingCourse.requestor && !isAnonymous" class="flex-table">
<label>
<input type="checkbox" v-model="isAnonymous" class="me-2" />
{{ $t('requestor.is_anonymous') }}
</label>
<third-party-render-box
v-if="accompanyingCourse.requestor.type === 'thirdparty'"
:thirdparty="accompanyingCourse.requestor"
:options="{
addLink: false,
addId: false,
addEntity: true,
addInfo: false,
hLevel: 3,
isMultiline: true,
isConfidential: true
}"
>
<template v-slot:record-actions>
<ul class="record_actions">
<li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="show"></on-the-fly></li>
<li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="edit" @saveFormOnTheFly="saveFormOnTheFly"></on-the-fly></li>
</ul>
</template>
</third-party-render-box>
<person-render-box render="bloc"
v-if="accompanyingCourse.requestor.type === 'person'"
:person="accompanyingCourse.requestor"
:options="{
addLink: false,
addId: false,
addAltNames: false,
addEntity: true,
addInfo: true,
hLevel: 3,
isMultiline: true,
isConfidential: false
}"
>
<template v-slot:record-actions>
<ul class="record_actions">
<li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="show"></on-the-fly></li>
<li><on-the-fly :type="accompanyingCourse.requestor.type" :id="accompanyingCourse.requestor.id" action="edit" @saveFormOnTheFly="saveFormOnTheFly"></on-the-fly></li>
</ul>
</template>
</person-render-box>
</div>
<div v-else> <div v-else>
<label class="chill-no-data-statement">{{ $t('requestor.counter') }}</label> <label class="chill-no-data-statement">{{ $t('requestor.counter') }}</label>
</div> </div>
@ -102,6 +153,7 @@ export default {
ThirdPartyRenderBox, ThirdPartyRenderBox,
Confidential Confidential
}, },
props: ['isAnonymous'],
data() { data() {
return { return {
addPersons: { addPersons: {
@ -160,4 +212,8 @@ div.flex-table {
margin-top: 1em; margin-top: 1em;
} }
} }
.confidential {
display: block;
}
</style> </style>

View File

@ -173,6 +173,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/** /**
* @var bool * @var bool
* @ORM\Column(name="contact_data_anonymous", type="boolean", options={"default":false}) * @ORM\Column(name="contact_data_anonymous", type="boolean", options={"default":false})
* @Groups({"read"})
*/ */
private bool $contactDataAnonymous = false; private bool $contactDataAnonymous = false;

View File

@ -5,7 +5,6 @@
<div class="item-col"> <div class="item-col">
<div class="entity-label"> <div class="entity-label">
<div :class="'denomination h' + options.hLevel"> <div :class="'denomination h' + options.hLevel">
<a v-if="this.options.addLink === true" href="#"> <a v-if="this.options.addLink === true" href="#">
@ -19,7 +18,7 @@
<span class="badge bg-thirdparty-company" v-else-if="thirdparty.kind == 'company'"> <span class="badge bg-thirdparty-company" v-else-if="thirdparty.kind == 'company'">
{{ $t('thirdparty.company')}} {{ $t('thirdparty.company')}}
</span> </span>
<span class="badge bg-thirdparty-contact" v-else="thirdparty.kind == 'contact'"> <span class="badge bg-thirdparty-contact" v-else>
{{ $t('thirdparty.contact')}} {{ $t('thirdparty.contact')}}
</span> </span>
@ -46,20 +45,38 @@
<div class="action"> <div class="action">
<slot name="record-actions"></slot> <slot name="record-actions"></slot>
</div> </div>
<ul class="list-content fa-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>
<ul v-else class="list-content fa-ul">
<li v-if="thirdparty.address"> <li v-if="thirdparty.address">
<i class="fa fa-li fa-map-marker"></i> <i class="fa fa-li fa-map-marker"></i>
<address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box> <address-render-box :address="thirdparty.address" :isMultiline="isMultiline"></address-render-box>
</li> </li>
<li v-if="thirdparty.phonenumber"> <li v-if="thirdparty.phonenumber">
<i class="fa fa-li fa-mobile"></i> <i class="fa fa-li fa-mobile"></i>
<a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a> <a :href="'tel: ' + thirdparty.phonenumber">{{ thirdparty.phonenumber }}</a>
</li> </li>
<li v-if="thirdparty.email"> <li v-if="thirdparty.email">
<i class="fa fa-li fa-envelope-o"></i> <i class="fa fa-li fa-envelope-o"></i>
<a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a> <a :href="'mailto: ' + thirdparty.email">{{ thirdparty.email }}</a>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
@ -73,6 +90,7 @@
<script> <script>
import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue'; import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRenderBox.vue';
import {dateToISO} from 'ChillMainAssets/chill/js/date.js'; import {dateToISO} from 'ChillMainAssets/chill/js/date.js';
import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue';
const i18n = { const i18n = {
messages: { messages: {
@ -88,7 +106,8 @@ const i18n = {
export default { export default {
name: "ThirdPartyRenderBox", name: "ThirdPartyRenderBox",
components: { components: {
AddressRenderBox AddressRenderBox,
Confidential
}, },
i18n, i18n,
props: ['thirdparty', 'options'], props: ['thirdparty', 'options'],

View File

@ -87,7 +87,7 @@
<div class="item-col"> <div class="item-col">
{% if options['isConfidential'] %} {% if options['isConfidential'] %}
<div class="confidential"> <div class="confidential">
<div class="confidential-content"> <div class="confidential-content blur">
<ul class="list-content fa-ul"> <ul class="list-content fa-ul">
<li> <li>
{{ thirdparty.getAddress|chill_entity_render_box({ {{ thirdparty.getAddress|chill_entity_render_box({

View File

@ -22,7 +22,7 @@
<div class="flex-table"> <div class="flex-table">
{% for tp in third_parties %} {% for tp in third_parties %}
<div class="item-bloc"> <div class="item-bloc">
{{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false, 'showContacts': true, 'isConfidential': true }) }} {{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false, 'showContacts': true, 'isConfidential': (tp.contactDataAnonymous ? true : false) }) }}
<div class="item-row separator"> <div class="item-row separator">
<ul class="record_actions"> <ul class="record_actions">
{% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %} {% if is_granted('CHILL_3PARTY_3PARTY_UPDATE', tp) %}

View File

@ -34,6 +34,7 @@ class ThirdPartyNormalizer implements NormalizerInterface, NormalizerAwareInterf
$data['isChild'] = $thirdParty->isChild(); $data['isChild'] = $thirdParty->isChild();
$data['parent'] = $this->normalizer->normalize($thirdParty->getParent(), $format, $context); $data['parent'] = $this->normalizer->normalize($thirdParty->getParent(), $format, $context);
$data['civility'] = $this->normalizer->normalize($thirdParty->getCivility(), $format, $context); $data['civility'] = $this->normalizer->normalize($thirdParty->getCivility(), $format, $context);
$data['contactDataAnonymous'] = $thirdParty->isContactDataAnonymous();
return $data; return $data;
} }