fix(SW-360): set default validate behaviour to onBlur on signup page

This commit is contained in:
Chuma McPhoy
2024-11-20 17:54:57 +01:00
parent 70000afe1f
commit 0865a553cd
6 changed files with 9 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
const email = intl.formatMessage({ id: "Email address" }) const email = intl.formatMessage({ id: "Email address" })
const phoneNumber = intl.formatMessage({ id: "Phone number" }) const phoneNumber = intl.formatMessage({ id: "Phone number" })
const zipCode = intl.formatMessage({ id: "Zip code" }) const zipCode = intl.formatMessage({ id: "Zip code" })
const acceptTermsText = intl.formatMessage({ id: "signupPage.terms" })
const signupButtonText = intl.formatMessage({ const signupButtonText = intl.formatMessage({
id: "Sign up to Scandic Friends", id: "Sign up to Scandic Friends",
}) })
@@ -66,8 +67,9 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
zipCode: "", zipCode: "",
}, },
password: "", password: "",
termsAccepted: false,
}, },
mode: "all", mode: "onBlur",
criteriaMode: "all", criteriaMode: "all",
resolver: zodResolver(signUpSchema), resolver: zodResolver(signUpSchema),
reValidateMode: "onChange", reValidateMode: "onChange",
@@ -157,9 +159,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
</header> </header>
<Checkbox name="termsAccepted" registerOptions={{ required: true }}> <Checkbox name="termsAccepted" registerOptions={{ required: true }}>
<Body> <Body>
{intl.formatMessage({ {acceptTermsText}{" "}
id: "Yes, I accept the Terms and conditions for Scandic Friends and understand that Scandic will process my personal data in accordance with",
})}{" "}
<Link <Link
variant="underscored" variant="underscored"
color="peach80" color="peach80"

View File

@@ -465,6 +465,7 @@
"points": "Point", "points": "Point",
"room type": "værelsestype", "room type": "værelsestype",
"room types": "værelsestyper", "room types": "værelsestyper",
"signupPage.terms": "Ja, jeg accepterer vilkårene og betingelserne for Scandic Friends og forstår, at Scandic vil behandle mine personlige data i overensstemmelse med",
"special character": "speciel karakter", "special character": "speciel karakter",
"spendable points expiring by": "{points} Brugbare point udløber den {date}", "spendable points expiring by": "{points} Brugbare point udløber den {date}",
"to": "til", "to": "til",

View File

@@ -464,6 +464,7 @@
"points": "Punkte", "points": "Punkte",
"room type": "zimmerart", "room type": "zimmerart",
"room types": "zimmerarten", "room types": "zimmerarten",
"signupPage.terms": "Ja, ich akzeptiere die Allgemeinen Geschäftsbedingungen für Scandic Friends und verstehe, dass Scandic meine persönlichen Daten gemäß",
"special character": "sonderzeichen", "special character": "sonderzeichen",
"spendable points expiring by": "{points} Einlösbare punkte verfallen bis zum {date}", "spendable points expiring by": "{points} Einlösbare punkte verfallen bis zum {date}",
"to": "zu", "to": "zu",

View File

@@ -504,6 +504,7 @@
"room type": "room type", "room type": "room type",
"room types": "room types", "room types": "room types",
"signup.terms": "By signing up you accept the Scandic Friends <termsLink>Terms and Conditions</termsLink>. Your membership is valid until further notice, and you can terminate your membership at any time by sending an email to Scandics customer service", "signup.terms": "By signing up you accept the Scandic Friends <termsLink>Terms and Conditions</termsLink>. Your membership is valid until further notice, and you can terminate your membership at any time by sending an email to Scandics customer service",
"signupPage.terms": "Yes, I accept the Terms and conditions for Scandic Friends and understand that Scandic will process my personal data in accordance with",
"special character": "special character", "special character": "special character",
"spendable points expiring by": "{points} spendable points expiring by {date}", "spendable points expiring by": "{points} spendable points expiring by {date}",
"to": "to", "to": "to",

View File

@@ -461,6 +461,7 @@
"points": "poeng", "points": "poeng",
"room type": "romtype", "room type": "romtype",
"room types": "romtyper", "room types": "romtyper",
"signupPage.terms": "Ja, jeg godtar vilkårene og betingelsene for Scandic Friends og forstår at Scandic vil behandle mine personopplysninger i henhold til",
"special character": "spesiell karakter", "special character": "spesiell karakter",
"spendable points expiring by": "{points} Brukbare poeng utløper innen {date}", "spendable points expiring by": "{points} Brukbare poeng utløper innen {date}",
"to": "til", "to": "til",

View File

@@ -462,6 +462,7 @@
"points": "poäng", "points": "poäng",
"room type": "rumtyp", "room type": "rumtyp",
"room types": "rumstyper", "room types": "rumstyper",
"signupPage.terms": "Ja, jag accepterar villkoren för Scandic Friends och förstår att Scandic kommer att behandla mina personuppgifter i enlighet med",
"special character": "speciell karaktär", "special character": "speciell karaktär",
"spendable points expiring by": "{points} poäng förfaller {date}", "spendable points expiring by": "{points} poäng förfaller {date}",
"to": "till", "to": "till",