From 8cc6030bce62a7f30064b2c576e0c2cce0ac085a Mon Sep 17 00:00:00 2001 From: Maciej Dobosz Date: Fri, 23 Feb 2024 14:39:42 +0100 Subject: [PATCH] Require name and surname --- src/languages/en.ts | 4 ++++ src/pages/OnboardingPersonalDetails.tsx | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index 91b957272594..684dc167c3bd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1213,6 +1213,10 @@ export default { onboarding: { welcome: 'Welcome!', whatsYourName: "What's your name?", + error: { + requiredFirstName: 'Please input your first name to continue', + requiredLasttName: 'Please input your last name to continue', + }, }, personalDetails: { error: { diff --git a/src/pages/OnboardingPersonalDetails.tsx b/src/pages/OnboardingPersonalDetails.tsx index fd11c939b900..adf1d31d6d74 100644 --- a/src/pages/OnboardingPersonalDetails.tsx +++ b/src/pages/OnboardingPersonalDetails.tsx @@ -42,6 +42,9 @@ function OnboardingPersonalDetails({currentUserPersonalDetails}: OnboardingPerso const errors = {}; // First we validate the first name field + if (!ValidationUtils.isRequiredFulfilled(values.firstName)) { + ErrorUtils.addErrorMessage(errors, 'firstName', 'onboarding.error.requiredFirstName'); + } if (!ValidationUtils.isValidDisplayName(values.firstName)) { ErrorUtils.addErrorMessage(errors, 'firstName', 'personalDetails.error.hasInvalidCharacter'); } @@ -50,6 +53,9 @@ function OnboardingPersonalDetails({currentUserPersonalDetails}: OnboardingPerso } // Then we validate the last name field + if (!ValidationUtils.isRequiredFulfilled(values.lastName)) { + ErrorUtils.addErrorMessage(errors, 'lastName', 'onboarding.error.requiredLasttName'); + } if (!ValidationUtils.isValidDisplayName(values.lastName)) { ErrorUtils.addErrorMessage(errors, 'lastName', 'personalDetails.error.hasInvalidCharacter'); }