diff --git a/src/pages/_Test/Mail/index.js b/src/pages/_Test/Mail/index.js index c3f4e2c..d91727d 100644 --- a/src/pages/_Test/Mail/index.js +++ b/src/pages/_Test/Mail/index.js @@ -28,7 +28,7 @@ const Mail = () => { enableReinitialize:true, initialValues:{email:""}, validationSchema:yup.object().shape({ - email: yup.string().max(255).required('請輸入e-Mail') + email: yup.string().max(255).required(intl.formatMessage({id: 'require'}) + 'e-Mail') }), onSubmit:values=>{ console.log(values); diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 61916b2..99fabad 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -570,10 +570,10 @@ const CustomFormWizard = (props) => { address3: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine3'}))), email: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))), emailConfirm: yup.string().email(displayErrorMsg(intl.formatMessage({id: 'validEmailFormat'}))).max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))).oneOf([yup.ref('email'), null], displayErrorMsg(intl.formatMessage({id: 'validSameEmail'}))), - idNo: yup.string().required(displayErrorMsg(`請輸入${selectedIdDocInputType}號碼`)) - .matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}號碼不包含特殊字符`) }) - .matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}號碼不包含空格`) }) - .test('checkIDCardFormat', displayErrorMsg(`請輸入有效的${selectedIdDocInputType}號碼`), function (value) { + idNo: yup.string().required(displayErrorMsg(`${intl.formatMessage({id: 'require'})}${selectedIdDocInputType}${intl.formatMessage({id: 'number'})}`)) + .matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({id: 'noSpecialCharacter'})}`) }) + .matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({id: 'noSpace'})}`) }) + .test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({id: 'requiredValid'})}${selectedIdDocInputType}${intl.formatMessage({id: 'number'})}`), function (value) { const idDocType = selectedIdDocType.type; var pattern_HKIDv1 = /^[A-Z]{1}[0-9]{6}$/; var pattern_HKIDv2 = /^[A-Z]{2}[0-9]{6}$/; @@ -891,10 +891,10 @@ const CustomFormWizard = (props) => { //value={selectedIdDocType} size="small" options={idDocTypeComboList} - getOptionLabel={(option) => intl.formatMessage({ id: option.label })} onBlur={formik.handleBlur} filterOptions={(options) => options} inputValue={selectedIdDocInputType} + getOptionLabel={(option) => option.label? intl.formatMessage({ id: option.label }) : ""} onChange={(event, newValue) => { if (newValue != null ) { setSelectedIdDocInputType(intl.formatMessage({ id: newValue.label })); diff --git a/src/translations/en.json b/src/translations/en.json index 0f9c792..f1062f1 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -142,6 +142,11 @@ "rejectTerms": "I do not accept", "verify": "Verify", "validVerify": "Please enter valid verification", + "requiredValid": "Please enter valid ", + "require": "Please enter ", + "number": " number", + "noSpecialCharacter": " number cannot contain special characters", + "noSpace": " number cannot contain spaces", "autoLogout": "Login verification has expired, please log in again.", "pleaseFillInBusinessRegCertNumber": "Please fill in Business Registration Certificate Number", "pleaseFillInValidBusinessRegCertNumber": "Please fill in valid Business Registration Certificate Number", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index f3d67d6..ef3976d 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -142,6 +142,11 @@ "rejectTerms": "我不接受", "verify": "验证", "validVerify": "请输入有效验证", + "requiredValid": "请输入有效的", + "require": "请输入", + "number": "号码", + "noSpecialCharacter": "号码不包含特殊字符", + "noSpace": "号码不包含空格", "autoLogout": "登入验证已过期,请重新登入。", "pleaseFillInBusinessRegCertNumber": "请输入商业登记证号码", "pleaseFillInValidBusinessRegCertNumber": "请输入有效商业登记证号码", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 2b15764..1a7698d 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -142,6 +142,11 @@ "rejectTerms": "我不接受", "verify": "驗證", "validVerify": "請輸入有效驗證", + "requiredValid": "請輸入有效的", + "require": "請輸入", + "number": "號碼", + "noSpecialCharacter": "號碼不包含特殊字符", + "noSpace": "號碼不包含空格", "autoLogout": "登入驗證已過期,請重新登入。", "pleaseFillInBusinessRegCertNumber": "請輸入商業登記證號碼", "pleaseFillInValidBusinessRegCertNumber": "請輸入有效商業登記證號碼",