mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-30 22:16:14 +00:00
Improve UX with better labeling in person resource form
This commit is contained in:
parent
10e4c7da23
commit
c2842148c6
6
.changes/unreleased/UX-20250617-192650.yaml
Normal file
6
.changes/unreleased/UX-20250617-192650.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
kind: UX
|
||||
body: Improve labeling of fields in person resource creation form
|
||||
time: 2025-06-17T19:26:50.599703116+02:00
|
||||
custom:
|
||||
Issue: ""
|
||||
SchemaChange: No schema change
|
@ -16,10 +16,8 @@ use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\PersonBundle\Entity\Person\PersonResource;
|
||||
use Chill\PersonBundle\Entity\Person\PersonResourceKind;
|
||||
use Chill\PersonBundle\Form\Type\PickPersonDynamicType;
|
||||
use Chill\PersonBundle\Templating\Entity\PersonRenderInterface;
|
||||
use Chill\PersonBundle\Templating\Entity\ResourceKindRender;
|
||||
use Chill\ThirdPartyBundle\Form\Type\PickThirdpartyDynamicType;
|
||||
use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@ -29,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class PersonResourceType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {}
|
||||
public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly TranslatorInterface $translator) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
@ -52,13 +50,13 @@ final class PersonResourceType extends AbstractType
|
||||
},
|
||||
])
|
||||
->add('person', PickPersonDynamicType::class, [
|
||||
'label' => 'Usager',
|
||||
'label' => $this->translator->trans('person_resource.person_non_prof'),
|
||||
])
|
||||
->add('thirdparty', PickThirdpartyDynamicType::class, [
|
||||
'label' => 'Tiers',
|
||||
'label' => $this->translator->trans('person_resource.thirdparty_prof'),
|
||||
])
|
||||
->add('freetext', ChillTextareaType::class, [
|
||||
'label' => 'Description libre',
|
||||
'label' => $this->translator->trans('person_resource.freetext'),
|
||||
'required' => false,
|
||||
])
|
||||
->add('comment', CommentType::class, [
|
||||
|
@ -10,28 +10,28 @@
|
||||
<div class="form-check">
|
||||
{% if resource is defined and resource.person is not null %}
|
||||
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'person' %}checked{% endif %}/>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">Usager</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">{{ 'person_resource.person_non_prof'|trans }}</label>
|
||||
{% else %}
|
||||
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_0" name="linked-entity" class="form-check-input" value="person" />
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">Usager</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_0">{{ 'person_resource.person_non_prof'|trans }}</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="form-check">
|
||||
{% if resource is defined and resource.thirdparty is not null %}
|
||||
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'thirdparty' %}checked{% endif %}/>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">Tiers</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">{{ 'person_resource.thirdparty_prof'|trans }}</label>
|
||||
{% else %}
|
||||
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_1" name="linked-entity" class="form-check-input" value="thirdparty" />
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">Tiers</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_1">{{ 'person_resource.thirdparty_prof'|trans }}</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="form-check">
|
||||
{% if resource is defined and resource.freeText is not null %}
|
||||
<input checked type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" {% if form.vars.submitted and app.request.request.get('linked-entity', null) == 'thirdparty' %}checked{% endif %}/>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">Description libre</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">{{ 'person_resource.freetext'|trans }}</label>
|
||||
{% else %}
|
||||
<input type="radio" id="chill_personbundle_person_resource_linkedEntity_2" name="linked-entity" class="form-check-input" value="freetext" />
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">Description libre</label>
|
||||
<label class="form-check-label" for="chill_personbundle_person_resource_linkedEntity_2">{{ 'person_resource.freetext'|trans }}</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -265,6 +265,10 @@ no comment found: "Aucun commentaire"
|
||||
Select a type: "Choisissez un type"
|
||||
Select a person: "Choisissez un usager"
|
||||
Kind: "Type"
|
||||
person_resource:
|
||||
person_non_prof: "Usager/ Tiers non-professionnel"
|
||||
thirdparty_prof: "Tiers professionnel"
|
||||
freetext: "Description libre"
|
||||
|
||||
|
||||
# pickAPersonType
|
||||
|
Loading…
x
Reference in New Issue
Block a user