Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Procuration] Allow custom vote place for FR #10244

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Procuration/V2/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Misd\PhoneNumberBundle\Validator\Constraints\PhoneNumber as AssertPhoneNumber;
use Symfony\Component\Validator\Constraints as Assert;

/**
* @Assert\Expression("!this.voteZone || !this.voteZone.isInFrance() || this.votePlace || this.customVotePlace", message="procuration.vote_place.not_blank")
*/
abstract class AbstractCommand
{
/**
Expand Down Expand Up @@ -81,9 +84,6 @@ abstract class AbstractCommand
*/
public ?Zone $voteZone = null;

/**
* @Assert\Expression("!this.voteZone || !this.voteZone.isInFrance() || this.votePlace", message="procuration.vote_place.not_blank")
*/
public ?Zone $votePlace = null;

/**
Expand Down
14 changes: 7 additions & 7 deletions templates/procuration_v2/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@
<template x-if="showManualBDV || (votePlaceUuid && isNotInFrance)">
<twig:Atoms:ReLabel x-text="`Mon bureau de vote ${isNotInFrance ? '(optionnel)' : ''}`"></twig:Atoms:ReLabel>
<p class="text-[#555555] opacity-50 pb-4" x-show="isNotInFrance">
Si vous connaissez votre bureau de vote, il aidera notre équipe à vous trouver le meilleur mandataire. Si vous ne l’avez pas, nous utiliserons votre adresse postale.
</p>
Si vous connaissez votre bureau de vote, il aidera notre équipe à vous trouver le meilleur mandataire. Si vous ne l’avez pas, nous utiliserons votre adresse postale.
</p>
</template>
<template x-if="votePlaceLoading">
<div class="opacity-20 pointer-events-none cursor-not-allowed">
<twig:Molecules:ReSelect id="fake_vote_place" name="fake_vote_place" placeholder="Recherche de bureau de vote..." status="loading"/>
</div>
</template>
<template x-if="votePlaceLoading">
<div class="opacity-20 pointer-events-none cursor-not-allowed">
<twig:Molecules:ReSelect id="fake_vote_place" name="fake_vote_place" placeholder="Recherche de bureau de vote..." status="loading"/>
</div>
</template>
<div class="gap-5 flex flex-col" x-show="!votePlaceLoading">
<template x-if="votePlaceUuid && !isNotInFrance && !showManualBDV && !isVotePlacesEmpty">
{{ form_row(form.votePlace, { attr: { placeholder: 'Saisir mon bureau de vote (saisie automatique)'}}) }}
Expand Down