|
|
@@ -80,7 +80,10 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(), |
|
|
addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(), |
|
|
emailAddress: yup.string().email(intl.formatMessage({ id: 'validEmailFormat' })).max(255).required(intl.formatMessage({ id: 'requireEmail' })), |
|
|
emailAddress: yup.string().email(intl.formatMessage({ id: 'validEmailFormat' })).max(255).required(intl.formatMessage({ id: 'requireEmail' })), |
|
|
idDocType: yup.string().max(255, getMaxErrStr(255)).required(intl.formatMessage({ id: 'requireIdDocType' })), |
|
|
idDocType: yup.string().max(255, getMaxErrStr(255)).required(intl.formatMessage({ id: 'requireIdDocType' })), |
|
|
identification: yup.string().required(getRequiredErrStr('number')) |
|
|
|
|
|
|
|
|
identification: yup.string().when('verifiedBy', { |
|
|
|
|
|
is: (verifiedBy) => verifiedBy != null, |
|
|
|
|
|
then: (schema) => schema.notRequired(), |
|
|
|
|
|
otherwise: (schema) => schema.required(getRequiredErrStr('number')) |
|
|
.matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) }) |
|
|
.matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) }) |
|
|
.matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) }) |
|
|
.matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) }) |
|
|
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredValid' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`), function (value) { |
|
|
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredValid' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`), function (value) { |
|
|
@@ -132,8 +135,12 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}) |
|
|
}), |
|
|
}), |
|
|
checkDigit: yup.string().max(1, getMaxErrStr(1)).nullable() |
|
|
|
|
|
|
|
|
checkDigit: yup.string().when('verifiedBy', { |
|
|
|
|
|
is: (verifiedBy) => verifiedBy != null, |
|
|
|
|
|
then: (schema) => schema.notRequired(), |
|
|
|
|
|
otherwise: (schema) => schema.max(1, getMaxErrStr(1)).nullable() |
|
|
.matches(/^[A-Z0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) }) |
|
|
.matches(/^[A-Z0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) }) |
|
|
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredNumberInQuote' })}`), function (value) { |
|
|
.test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredNumberInQuote' })}`), function (value) { |
|
|
// console.log(selectedIdDocInputType) |
|
|
// console.log(selectedIdDocInputType) |
|
|
@@ -161,7 +168,8 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}), |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}), |
|
|
tel_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })).required(intl.formatMessage({ id: 'requireDialingCode' })), |
|
|
tel_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })).required(intl.formatMessage({ id: 'requireDialingCode' })), |
|
|
fax_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })), |
|
|
fax_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })), |
|
|
phoneNumber: yup.string().min(8, intl.formatMessage({ id: 'require8Number' })).required(intl.formatMessage({ id: 'requireContactNumber' })), |
|
|
phoneNumber: yup.string().min(8, intl.formatMessage({ id: 'require8Number' })).required(intl.formatMessage({ id: 'requireContactNumber' })), |
|
|
@@ -185,8 +193,10 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
countryCode: values.tel_countryCode, |
|
|
countryCode: values.tel_countryCode, |
|
|
phoneNumber: values.phoneNumber |
|
|
phoneNumber: values.phoneNumber |
|
|
}, |
|
|
}, |
|
|
identification: values.identification, |
|
|
|
|
|
checkDigit: values.checkDigit, |
|
|
|
|
|
|
|
|
...(values.verifiedBy == null ? { |
|
|
|
|
|
identification: values.identification, |
|
|
|
|
|
checkDigit: values.checkDigit, |
|
|
|
|
|
} : {}), |
|
|
faxNo: { |
|
|
faxNo: { |
|
|
countryCode: values.fax_countryCode, |
|
|
countryCode: values.fax_countryCode, |
|
|
faxNumber: values.faxNumber |
|
|
faxNumber: values.faxNumber |
|
|
@@ -470,6 +480,11 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<Grid item xs={12} sm={12} md={9} lg={6}> |
|
|
<Grid item xs={12} sm={12} md={9} lg={6}> |
|
|
|
|
|
{currentUserData.verifiedBy ? |
|
|
|
|
|
<Typography variant="h5" mt={1}> |
|
|
|
|
|
Hidden for security purpose |
|
|
|
|
|
</Typography> |
|
|
|
|
|
: |
|
|
<Grid container> |
|
|
<Grid container> |
|
|
{formik.values.idDocType === "HKID" ? |
|
|
{formik.values.idDocType === "HKID" ? |
|
|
editMode ? |
|
|
editMode ? |
|
|
@@ -548,6 +563,7 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { |
|
|
</Stack> |
|
|
</Stack> |
|
|
} |
|
|
} |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
} |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|