activity: create new vue subcomponent socialIssuesAcc

This commit is contained in:
Mathieu Jaumotte 2021-06-25 14:26:42 +02:00
parent e55a2691b7
commit fe22e6c7dc
5 changed files with 45 additions and 22 deletions

View File

@ -105,7 +105,11 @@ class ActivityType extends AbstractType
}
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
$builder->add('socialIssues', EntityType::class, [
$builder->add('socialIssues',
/*
HiddenType::class
*/
EntityType::class, [
'label' => $activityType->getLabel('socialIssues'),
'required' => $activityType->isRequired('socialIssues'),
'class' => SocialIssue::class,
@ -115,11 +119,16 @@ class ActivityType extends AbstractType
'multiple' => true,
'choices' => $accompanyingPeriod->getRecursiveSocialIssues(),
'expanded' => true,
]);
]
);
}
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
$builder->add('socialActions', EntityType::class, [
$builder->add('socialActions',
/*
HiddenType::class
*/
EntityType::class, [
'label' => $activityType->getLabel('socialActions'),
'required' => $activityType->isRequired('socialActions'),
'class' => SocialAction::class,
@ -129,7 +138,8 @@ class ActivityType extends AbstractType
'multiple' => true,
'choices' => $accompanyingPeriod->getRecursiveSocialActions(),
'expanded' => true,
]);
]
);
}
if ($activityType->isVisible('date')) {
@ -203,9 +213,7 @@ class ActivityType extends AbstractType
}
if ($activityType->isVisible('persons')) {
$builder->add('persons', HiddenType::class, [
//'data_class' => Person::class,
]);
$builder->add('persons', HiddenType::class);
$builder->get('persons')
->addModelTransformer(new CallbackTransformer(
function (iterable $personsAsIterable): string {
@ -226,9 +234,7 @@ class ActivityType extends AbstractType
}
if ($activityType->isVisible('thirdParties')) {
$builder->add('thirdParties', HiddenType::class, [
//'data_class' => ThirdParty::class,
]);
$builder->add('thirdParties', HiddenType::class);
$builder->get('thirdParties')
->addModelTransformer(new CallbackTransformer(
function (iterable $thirdpartyAsIterable): string {
@ -260,9 +266,7 @@ class ActivityType extends AbstractType
}
if ($activityType->isVisible('users')) {
$builder->add('users', HiddenType::class, [
//'data_class' => User::class,
]);
$builder->add('users', HiddenType::class);
$builder->get('users')
->addModelTransformer(new CallbackTransformer(
function (iterable $usersAsIterable): string {

View File

@ -1,15 +1,17 @@
<template>
<concerned-groups></concerned-groups>
<social-issues-acc></social-issues-acc>
</template>
<script>
import ConcernedGroups from './components/ConcernedGroups.vue';
import SocialIssuesAcc from './components/SocialIssuesAcc.vue';
export default {
name: "App",
components: {
ConcernedGroups
ConcernedGroups,
SocialIssuesAcc
}
}
</script>

View File

@ -0,0 +1,14 @@
<template>
<teleport to="#social-issues-acc">
boum
</teleport>
</template>
<script>
export default {
name: "SocialIssuesAcc"
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -19,13 +19,15 @@
{{ form_row(edit_form.scope) }}
{% endif %}
{%- if edit_form.socialIssues is defined -%}
{{ form_row(edit_form.socialIssues) }}
{% endif %}
{%- if edit_form.socialActions is defined -%}
{{ form_row(edit_form.socialActions) }}
{% endif %}
{%- if edit_form.socialIssues is defined -%}
{{ form_row(edit_form.socialIssues) }}
{% endif %}
<div id="social-issues-acc"></div>
{%- if edit_form.reasons is defined -%}
{{ form_row(edit_form.reasons) }}

View File

@ -24,14 +24,15 @@
{{ form_row(form.scope) }}
{% endif %}
{%- if form.socialActions is defined -%}
{{ form_row(form.socialActions) }}
{% endif %}
{%- if form.socialIssues is defined -%}
{{ form_row(form.socialIssues) }}
{% endif %}
{%- if form.socialActions is defined -%}
{{ form_row(form.socialActions) }}
{% endif %}
<div id="social-issues-acc"></div>
{%- if form.reasons is defined -%}
{{ form_row(form.reasons) }}