fix(loyalty-admin): require at least one terms field on program form
Some checks failed
Some checks failed
If a merchant saves a loyalty program with both terms_text and terms_cms_page_slug empty, the storefront enrollment page renders the "Terms & Conditions" link as a non-clickable <span> (see enroll.html template branch) — customers can't read what they're agreeing to. Two changes to the shared program-form to make this impossible to ship by accident: 1. Yellow warning banner inside the Terms section, visible only when both fields are empty. Tells the admin what the storefront will look like and what to fix. 2. Save button is disabled until at least one of the two terms fields is filled. The button gets a localised :title tooltip explaining why it's disabled, and disabled:cursor-not-allowed so the disabled state is obvious on hover. Added three i18n keys (terms_required_warning, terms_text_hint, terms_required_tooltip) in en/fr/de/lb, plus a small "either this or the slug above is required" hint under the textarea so each field is self-explanatory in isolation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -415,6 +415,9 @@
|
||||
"terms_cms_page_hint": "Enter a CMS page slug (e.g. terms-and-conditions) to display full T&C from the CMS module",
|
||||
"terms_conditions": "Terms & Conditions (fallback)",
|
||||
"terms_fallback_hint": "Used when no CMS page slug is set",
|
||||
"terms_text_hint": "Plain-text fallback. Either this field OR the CMS page slug above is required so customers can read the terms on the enrollment page.",
|
||||
"terms_required_warning": "Customers must be able to read your terms before accepting them. Fill in either the CMS page slug above or the plain-text fallback below — until you do, the 'Terms & Conditions' link on the storefront enrollment page is not clickable.",
|
||||
"terms_required_tooltip": "Fill in either the CMS page slug or the plain-text terms before saving.",
|
||||
"privacy_policy_url": "Privacy Policy URL",
|
||||
"program_status": "Program Status",
|
||||
"program_active": "Program Active",
|
||||
|
||||
Reference in New Issue
Block a user