From 414e5da6753161472586d42b9cf7020b343e9841 Mon Sep 17 00:00:00 2001 From: Alex Cheung Date: Thu, 4 Jul 2024 12:30:42 +0800 Subject: [PATCH] update check pasword special character and update org btn auth and application Id i18n --- .../DetailPage/OrganizationCard.js | 24 ++++++++++--------- src/pages/User/ChangePasswordPage/index.js | 4 ++-- .../ForgotPassword/AuthCallback/index.js | 2 +- .../ForgotUsername/AuthCallback/index.js | 2 +- .../auth-forms/AuthLoginCustom.js | 4 ++-- .../auth-forms/BusCustomFormWizard.js | 17 +++++++------ .../auth-forms/CustomFormWizard.js | 17 +++++++------ .../auth-forms/IAmSmartFormWizard.js | 7 +++--- src/translations/en.json | 2 +- src/translations/zh-CN.json | 8 +++---- 10 files changed, 47 insertions(+), 40 deletions(-) diff --git a/src/pages/Organization/DetailPage/OrganizationCard.js b/src/pages/Organization/DetailPage/OrganizationCard.js index 427b1b4..607943d 100644 --- a/src/pages/Organization/DetailPage/OrganizationCard.js +++ b/src/pages/Organization/DetailPage/OrganizationCard.js @@ -336,17 +336,19 @@ const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => { - - - - - + { isGrantedAny("MAINTAIN_DEMANDNOTE")? + + + + + : null + } } diff --git a/src/pages/User/ChangePasswordPage/index.js b/src/pages/User/ChangePasswordPage/index.js index 5479011..0868bd0 100644 --- a/src/pages/User/ChangePasswordPage/index.js +++ b/src/pages/User/ChangePasswordPage/index.js @@ -136,14 +136,14 @@ const Index = () => { .matches(/^(?=.*[a-z])/, { message: intl.formatMessage({id: 'atLeastOneSmallLetter'})}) .matches(/^(?=.*[A-Z])/, { message: intl.formatMessage({id: 'atLeastOneCapLetter'})}) .matches(/^(?=.*[0-9])/, { message: intl.formatMessage({id: 'atLeast1Number'})}) - .matches(/^(?=.*[!@#%&])/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), + .matches(/^(?=.*\W)/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), newPassword: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) .required(intl.formatMessage({id: 'requirePassword'})) .matches(/^\S*$/, { message: (intl.formatMessage({id: 'noSpacePassword'}))}) .matches(/^(?=.*[a-z])/, { message: intl.formatMessage({id: 'atLeastOneSmallLetter'})}) .matches(/^(?=.*[A-Z])/, { message: intl.formatMessage({id: 'atLeastOneCapLetter'})}) .matches(/^(?=.*[0-9])/, { message: intl.formatMessage({id: 'atLeast1Number'})}) - .matches(/^(?=.*[!@#%&])/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), + .matches(/^(?=.*\W)/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), confirmPassword: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) .required(intl.formatMessage({id: 'pleaseConfirmPassword'})) .oneOf([yup.ref('newPassword'), null], intl.formatMessage({id: 'samePassword'})), diff --git a/src/pages/authentication/ForgotPassword/AuthCallback/index.js b/src/pages/authentication/ForgotPassword/AuthCallback/index.js index 354abd5..8d290cc 100644 --- a/src/pages/authentication/ForgotPassword/AuthCallback/index.js +++ b/src/pages/authentication/ForgotPassword/AuthCallback/index.js @@ -175,7 +175,7 @@ const Index = () => { .matches(/^(?=.*[a-z])/, { message: intl.formatMessage({id: 'atLeastOneSmallLetter'})}) .matches(/^(?=.*[A-Z])/, { message: intl.formatMessage({id: 'atLeastOneCapLetter'})}) .matches(/^(?=.*[0-9])/, { message: intl.formatMessage({id: 'atLeast1Number'})}) - .matches(/^(?=.*[!@#%&])/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), + .matches(/^(?=.*\W)/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), confirmPassword: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) .required(intl.formatMessage({id: 'pleaseConfirmPassword'})) .oneOf([yup.ref('password'), null], intl.formatMessage({id: 'samePassword'})), diff --git a/src/pages/authentication/ForgotUsername/AuthCallback/index.js b/src/pages/authentication/ForgotUsername/AuthCallback/index.js index b56a1bc..02bbcce 100644 --- a/src/pages/authentication/ForgotUsername/AuthCallback/index.js +++ b/src/pages/authentication/ForgotUsername/AuthCallback/index.js @@ -181,7 +181,7 @@ const Index = () => { .matches(/^(?=.*[a-z])/, { message: intl.formatMessage({id: 'atLeastOneSmallLetter'})}) .matches(/^(?=.*[A-Z])/, { message: intl.formatMessage({id: 'atLeastOneCapLetter'})}) .matches(/^(?=.*[0-9])/, { message: intl.formatMessage({id: 'atLeast1Number'})}) - .matches(/^(?=.*[!@#%&])/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), + .matches(/^(?=.*\W)/, { message: intl.formatMessage({id: 'atLeast1SpecialChar'})}), confirmPassword: yup.string().min(8, intl.formatMessage({id: 'atLeast8CharPassword'})) .max(60, getMaxErrStr(60)) .required(intl.formatMessage({id: 'pleaseConfirmPassword'})) diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 4b97874..a903fe0 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -151,7 +151,7 @@ const AuthLoginCustom = () => { .matches(/^(?=.*[a-z])/, intl.formatMessage({ id: 'atLeastOneSmallLetter' })) .matches(/^(?=.*[A-Z])/, intl.formatMessage({ id: 'atLeastOneCapLetter' })) .matches(/^(?=.*[0-9])/, intl.formatMessage({ id: 'atLeast1Number' })) - .matches(/^(?=.*[!@#%&])/, intl.formatMessage({ id: 'atLeast1SpecialChar' })), + .matches(/^(?=.*\W)/, intl.formatMessage({ id: 'atLeast1SpecialChar' })), }), }); @@ -177,7 +177,7 @@ const AuthLoginCustom = () => { var lowerCase = /[a-z]/g; var upperCase = /[A-Z]/g; var numbers = /[0-9]/g; - var symbol = /^(?=.*[!@#%&])/; + var symbol = /^(?=.*\W)/; if (!new_pass.match(lowerCase)) { return false; } else if (!new_pass.match(upperCase)) { diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 707c8a9..c696c4f 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -434,7 +434,7 @@ const BusCustomFormWizard = (props) => { } function handleUserName(username) { - var symbol = /^(?=.*[!@#%&])/; + var symbol = /^(?=.*\W)/; var space = /\s/; if (username.length < 6) { return false; @@ -461,7 +461,7 @@ const BusCustomFormWizard = (props) => { var lowerCase = /[a-z]/g; var upperCase = /[A-Z]/g; var numbers = /[0-9]/g; - var symbol = /^(?=.*[!@#%&])/; + var symbol = /^(?=.*\W)/; var space = /\s/; if (!new_pass.match(lowerCase)) { return false; @@ -527,7 +527,7 @@ const BusCustomFormWizard = (props) => { .matches(/^(?=.*[a-z])/, { message: displayErrorMsg(intl.formatMessage({id: 'atLeastOneSmallLetter'})) }) .matches(/^(?=.*[A-Z])/, { message: displayErrorMsg(intl.formatMessage({id: 'atLeastOneCapLetter'})) }) .matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({id: 'atLeast1Number'})) }) - .matches(/^(?=.*[!@#%&])/, { message: displayErrorMsg(intl.formatMessage({id: 'atLeast1SpecialChar'})) }), + .matches(/^(?=.*\W)/, { message: displayErrorMsg(intl.formatMessage({id: 'atLeast1SpecialChar'})) }), confirmPassword: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'atLeast8CharPassword'}))).required(displayErrorMsg(intl.formatMessage({id: 'pleaseConfirmPassword'}))).oneOf([yup.ref('password'), null], displayErrorMsg(intl.formatMessage({id: 'samePassword'}))), enName: yup.string().max(40,getMaxErrStr(40)).required(displayErrorMsg(intl.formatMessage({id: 'userRequireEnglishName'}))), enCompanyName: yup.string().matches(/^[^$^*()]+$/, { message: displayErrorMsg('No special characters $/^/*/(/)') }).when('chCompanyName', { @@ -743,6 +743,9 @@ const BusCustomFormWizard = (props) => { value={formik.values.confirmPassword.trim()} name="confirmPassword" onBlur={formik.handleBlur} + onCut={handleCCPChange} + onCopy={handleCCPChange} + onPaste={handleCCPChange} onChange={(e) => { formik.handleChange(e); // changePassword(e.target.value); @@ -1004,7 +1007,7 @@ const BusCustomFormWizard = (props) => { value={selectedAddress4} options={address4ComboList} disabled={checkCountry} - error={Boolean(districtErrStr!="")} + // error={Boolean(districtErrStr!="")} onBlur={formik.handleBlur} getOptionLabel={(option) => option.type? intl.formatMessage({ id: option.type }) : ""} onChange={(event, newValue) => { @@ -1013,7 +1016,7 @@ const BusCustomFormWizard = (props) => { sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address4-combo": { padding: "0px 0px 0px 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} - renderInput={(params) => } /> { {formik.errors.address3} )} - {/* {districtErrStr!= "" && ( + {districtErrStr!= "" && ( {districtErrStr} - )} */} + )} diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 449f6e4..6fc258e 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -434,7 +434,7 @@ const CustomFormWizard = (props) => { } function handleUsername(username) { - var symbol = /^(?=.*[!@#%&])/; + var symbol = /^(?=.*\W)/; var space = /\s/; if (username.length < 6) { return false; @@ -538,7 +538,7 @@ const CustomFormWizard = (props) => { var lowerCase = /[a-z]/g; var upperCase = /[A-Z]/g; var numbers = /[0-9]/g; - var symbol = /^(?=.*[!@#%&])/; + var symbol = /^(?=.*\W)/; var space = /\s/; if (!new_pass.match(lowerCase)) { return false; @@ -610,7 +610,7 @@ const CustomFormWizard = (props) => { .matches(/^(?=.*[a-z])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeastOneSmallLetter' })) }) .matches(/^(?=.*[A-Z])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeastOneCapLetter' })) }) .matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1Number' })) }) - .matches(/^(?=.*[!@#%&])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1SpecialChar' })) }), + .matches(/^(?=.*\W)/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1SpecialChar' })) }), confirmPassword: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'atLeast8CharPassword' }))).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseConfirmPassword' }))).oneOf([yup.ref('password'), null], displayErrorMsg(intl.formatMessage({ id: 'samePassword' }))), chName: yup.string().max(6, getMaxErrStr(6)), enName: yup.string().max(40, getMaxErrStr(40)).when('chName', { @@ -866,6 +866,9 @@ const CustomFormWizard = (props) => { value={formik.values.confirmPassword.trim()} name="confirmPassword" onBlur={formik.handleBlur} + onCut={handleCCPChange} + onCopy={handleCCPChange} + onPaste={handleCCPChange} onChange={(e) => { formik.handleChange(e); // changePassword(e.target.value); @@ -1245,7 +1248,7 @@ const CustomFormWizard = (props) => { value={selectedAddress4} options={ComboData.district} disabled={checkCountry} - error={Boolean(districtErrStr != "")} + // error={Boolean(districtErrStr != "")} onBlur={formik.handleBlur} getOptionLabel={(option) => option.type ? intl.formatMessage({ id: option.type }) : ""} onChange={(event, newValue) => { @@ -1256,7 +1259,7 @@ const CustomFormWizard = (props) => { "#address4-combo": { padding: "0px 0px 0px 3px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} - renderInput={(params) => } /> { {formik.errors.address3} )} - {/* {districtErrStr != "" && ( + {districtErrStr != "" && ( {districtErrStr} - )} */} + )} diff --git a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js index 12305e6..c306237 100644 --- a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js +++ b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js @@ -583,14 +583,14 @@ const CustomFormWizard = (props) => { value={selectedAddress4} options={address4ComboList} disabled={checkCountry} - error={Boolean(districtErrStr != "")} + // error={Boolean(districtErrStr != "")} onBlur={formik.handleBlur} getOptionLabel={(option) => option.type ? intl.formatMessage({ id: option.type }) : ""} onChange={(event, newValue) => { setSelectedAddress4(newValue); }} sx={{ "& .MuiInputBase-root": { height: "41px" }, "#address4-combo": { padding: "0px 0px 0px 0px" }, "& .MuiAutocomplete-endAdornment": { top: "auto" }, }} - renderInput={(params) => } /> { {formik.errors.address3} )} - {/* {districtErrStr != "" && ( {districtErrStr} - )} */} + )} diff --git a/src/translations/en.json b/src/translations/en.json index 9eb22b2..c552c53 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -351,7 +351,7 @@ "cancelled": "Cancelled", "withdrawn": "Withdrawn", "searchApplyRecord": "Search application records", - "applicationId": "Application ID", + "applicationId": "Application No", "submitDate": "Submit Date", "submitDateFrom": "Submit Date (From)", "submitDateTo": "Submit Date (To)", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index a3d635a..c95aa7c 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -408,7 +408,7 @@ "payReceipt": "付款收据", "contactPerson": "联络人", "requireContactPerson": "请输入联络人", - "requireCareOf": "请输入客戶備註", + "requireCareOf": "请输入客户备注", "search": "搜寻", "searchForm": "搜寻表格", "cancel": "取消", @@ -436,9 +436,9 @@ "applyStatus": "申请状态", "gazetteCount": "宪报期数", "gazetteCount2" :"宪报期数/ 其他备注", - "gazetteCount2_1" :"客戶備註/ 其他备注", - "gazetteCount3" :"宪报期数/ 客戶備註/ 其他备注", - "careOf":"客戶備註", + "gazetteCount2_1" :"客户备注/ 其他备注", + "gazetteCount3" :"宪报期数/ 客户备注/ 其他备注", + "careOf":"客户备注", "careOfWarning":"您已选择了不同的客户备注申请。您要付款吗?", "warning":"警告", "publishDate": "发布日期",