fix(loyalty): conditional subtitle on enrollment success page
Some checks failed
CI / ruff (push) Successful in 18s
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled
CI / pytest (push) Has been cancelled

When re-enrolling (already a member), the success page showed two
contradicting messages stacked:
  Title:    "Vous êtes déjà membre !"          (correct, conditional)
  Subtitle: "Vous êtes maintenant membre..."   (wrong — static)

The title was already x-text-conditional based on
enrollContext.already_enrolled, but the subtitle was a server-side
{{ _('success.message') }} so it always rendered the "you're now a
member" copy regardless of branch.

Make the subtitle conditional the same way:
- new i18n key already_enrolled_message in en/fr/de/lb
  ("Welcome back — your card is ready whenever you are." and
  locale-appropriate equivalents)
- expose success_message + already_enrolled_message in i18nStrings
- subtitle becomes x-text="already_enrolled ? msg2 : msg1"

Found during Test 2 round 2 — cross-store re-enrollment at
FASHIONOUTLET with the email from Test 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 22:15:15 +02:00
parent f68a30a820
commit dee2eab266
5 changed files with 10 additions and 1 deletions

View File

@@ -21,7 +21,10 @@
x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_title : i18nStrings.success_title">
{{ _('loyalty.enrollment.success.title') }}
</h1>
<p class="text-gray-600 dark:text-gray-400 mb-8">{{ _('loyalty.enrollment.success.message') }}</p>
<p class="text-gray-600 dark:text-gray-400 mb-8"
x-text="enrollContext.already_enrolled ? i18nStrings.already_enrolled_message : i18nStrings.success_message">
{{ _('loyalty.enrollment.success.message') }}
</p>
<!-- Card Number Display -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 mb-8">
@@ -137,7 +140,9 @@ function customerLoyaltyEnrollSuccess() {
},
i18nStrings: {
success_title: {{ _('loyalty.enrollment.success.title')|tojson }},
success_message: {{ _('loyalty.enrollment.success.message')|tojson }},
already_enrolled_title: {{ _('loyalty.enrollment.already_enrolled_title')|tojson }},
already_enrolled_message: {{ _('loyalty.enrollment.already_enrolled_message')|tojson }},
cross_location_message: {{ _('loyalty.enrollment.cross_location_message')|tojson }},
single_location_message: {{ _('loyalty.enrollment.single_location_message')|tojson }},
available_locations: {{ _('loyalty.enrollment.available_locations')|tojson }},