From 5e56be3c8beaad4bb3ffd7bd81cf3b59f6e1286c Mon Sep 17 00:00:00 2001 From: mFlaifel Date: Tue, 9 Jun 2020 19:03:48 +0300 Subject: [PATCH 1/4] display a message when user enter less than 5 charcharters relates #189 --- client/src/components/pages/application/Signup/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/pages/application/Signup/index.js b/client/src/components/pages/application/Signup/index.js index 0478a79..8773ed5 100644 --- a/client/src/components/pages/application/Signup/index.js +++ b/client/src/components/pages/application/Signup/index.js @@ -138,6 +138,7 @@ class SignUp extends React.Component { message.includes('You must add only Letters') } message={ + (fullName.length > 0 && fullName.length < 5) || message.includes('Enter your First Name') ? 'You must enter at least 5 characters' : message.includes('You must add only Letters') From dd945ad87b0806ea52a6088fb14ade0143cc5b09 Mon Sep 17 00:00:00 2001 From: mFlaifel Date: Tue, 9 Jun 2020 19:20:51 +0300 Subject: [PATCH 2/4] fix typo GeneralInfo.js relates #189 --- .../application/NonlinearStepper/GeneralInfo.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/client/src/components/application/NonlinearStepper/GeneralInfo.js b/client/src/components/application/NonlinearStepper/GeneralInfo.js index fa5743d..e5f5a06 100644 --- a/client/src/components/application/NonlinearStepper/GeneralInfo.js +++ b/client/src/components/application/NonlinearStepper/GeneralInfo.js @@ -12,7 +12,7 @@ import Typography from '../../common/Typography'; import selectBoxQuestions from './questions'; import { GeneralInfoStyles } from './style'; -const GereralInfos = ({ handleFormInput, formValues, errorMsg }) => { +const GeneralInfos = ({ handleFormInput, formValues, errorMsg }) => { const classes = GeneralInfoStyles(); const { GazaAreas, @@ -60,7 +60,10 @@ const GereralInfos = ({ handleFormInput, formValues, errorMsg }) => { label="Full Name" name="fullName" onChange={handleFormInput} - isError={errorMsg.includes('Full Name is required')} + isError={ + (formValues.fullName.length > 0 && formValues.fullName.length < 5) || + errorMsg.includes('Full Name is required') + } message="ex:- Sam Smith" /> @@ -176,12 +179,12 @@ const GereralInfos = ({ handleFormInput, formValues, errorMsg }) => { ); }; -GereralInfos.defaultProps = { +GeneralInfos.defaultProps = { handleFormInput: () => {}, formValues: '', errorMsg: [], }; -GereralInfos.propTypes = { +GeneralInfos.propTypes = { handleFormInput: PropTypes.func, formValues: PropTypes.shape({ gender: PropTypes.string, @@ -201,4 +204,4 @@ GereralInfos.propTypes = { errorMsg: PropTypes.arrayOf(PropTypes.string), }; -export default GereralInfos; +export default GeneralInfos; From 6fcb42a541d9177b386067ce05b27dc5c93e95b5 Mon Sep 17 00:00:00 2001 From: mFlaifel Date: Tue, 9 Jun 2020 19:31:49 +0300 Subject: [PATCH 3/4] add fullname validation to avaialabilty page relates #189 --- client/src/utils/application/nLinearStepperValidation.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/utils/application/nLinearStepperValidation.js b/client/src/utils/application/nLinearStepperValidation.js index da6edcc..43fa5fb 100644 --- a/client/src/utils/application/nLinearStepperValidation.js +++ b/client/src/utils/application/nLinearStepperValidation.js @@ -2,7 +2,14 @@ import * as yup from 'yup'; const generalInfosSchema = yup.object().shape({ gender: yup.string().required('Gender is required'), - fullName: yup.string().required('Full Name is required').trim(), + fullName: yup + .string() + .matches( + /^[A-Za-z\s]{5,}$/, + 'You must add only letters, at least 5 characters' + ) + .trim() + .required('Enter your First Name'), mobileNumber: yup .string() .matches(/^(05)[0-9]{8}$/, 'Error Mobile Number') From 4ee3b1a4fa948f8d5693651d047cffb607d2f834 Mon Sep 17 00:00:00 2001 From: mFlaifel Date: Tue, 9 Jun 2020 19:33:58 +0300 Subject: [PATCH 4/4] remove unnecessary spaces from motivation field placeholder relates #189 --- .../components/application/NonlinearStepper/GeneralInfo.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/client/src/components/application/NonlinearStepper/GeneralInfo.js b/client/src/components/application/NonlinearStepper/GeneralInfo.js index e5f5a06..1f59094 100644 --- a/client/src/components/application/NonlinearStepper/GeneralInfo.js +++ b/client/src/components/application/NonlinearStepper/GeneralInfo.js @@ -71,12 +71,7 @@ const GeneralInfos = ({ handleFormInput, formValues, errorMsg }) => { className={` nonlinearSelect ${classes.textArea}`} label="Motivation" name="motivation" - placeholder="What is your motivation for joining the Code Academy? - - Tell us - - in your own words - - about your background and why you want to be considered for this program. - - This is your opportunity to tell your story and make your application unique. - - Please write at least 5 sentences" + placeholder="Tell us - in your own words - about your background and why you want to be considered for this program. This is your opportunity to tell your story and make your application unique. Please write at least 5 sentences." aria-label="minimum height" onChange={handleFormInput} rowsMin={11}