From a556a9545b4836960f388915d2dab1ba5e5c56b6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 4 Jul 2025 12:50:32 +0200 Subject: [PATCH] No preference selection for notification type equals no email --- .../Form/DataMapper/NotificationFlagDataMapper.php | 5 +---- .../ChillMainBundle/Resources/views/User/profile.html.twig | 5 +---- src/Bundle/ChillMainBundle/translations/messages.fr.yml | 6 ++++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/NotificationFlagDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/NotificationFlagDataMapper.php index f8b718c78..57aa17d88 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/NotificationFlagDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/NotificationFlagDataMapper.php @@ -46,9 +46,6 @@ final readonly class NotificationFlagDataMapper implements DataMapperInterface if ($flagForm->has('daily_email')) { $flagForm->get('daily_email')->setData($dailyEmailChecked); } - if ($flagForm->has('no_email')) { - $flagForm->get('no_email')->setData($noEmailChecked); - } } } } @@ -73,7 +70,7 @@ final readonly class NotificationFlagDataMapper implements DataMapperInterface $viewData[$flag][] = 'daily-email'; } - if ($flagForm['no_email']->getData()) { + if (empty($viewData[$flag])) { $viewData[$flag][] = 'no-email'; } } diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig index 7a432332c..7850fc29a 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/profile.html.twig @@ -46,13 +46,13 @@ {{ form_row(form.phonenumber) }}

{{ 'user.profile.notification_preferences'|trans }}

+

{{ 'notification.flags.none selected message'|trans }}

- @@ -67,9 +67,6 @@ - {% endfor %} diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 929bcac0d..dcc11fd1b 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -724,9 +724,11 @@ notification: person-address-move: Notification lors que l'usager qui localise un parcours a déménagé person: Notification sur un usager workflow-trans: Notification sur une transition d'un workflow + none selected message: Si vous ne sélectionnez aucune option, vous ne recevrez pas d'email concernant ce type de notification. preferences: - immediate_email: Recevoir un email immédiatement - daily_email: Recevoir un récapitulatif quotidien + column_title: Préférences + immediate_email: Email immédiat + daily_email: Récapitulatif quotidien no_email: Ne pas recevoir un email
{{ 'notification.flags.type'|trans }} {{ 'notification.flags.preferences.immediate_email'|trans }} {{ 'notification.flags.preferences.daily_email'|trans }}{{ 'notification.flags.preferences.no_email'|trans }}
{{ form_widget(flag.daily_email) }} - {{ form_widget(flag.no_email) }} -