From 35d9301c579f1e28b634f298788feff16e0f9a6a Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 4 Mar 2024 11:14:59 +0800 Subject: [PATCH 1/5] update label --- src/pages/dashboard/GLD/index.js | 15 ++++++++++++++- src/pages/dashboard/Public/index.js | 16 +++++++++++++++- src/translations/en.json | 5 ++++- src/translations/zh-CN.json | 4 +++- src/translations/zh-HK.json | 4 +++- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/pages/dashboard/GLD/index.js b/src/pages/dashboard/GLD/index.js index 9d60aac..42608f5 100644 --- a/src/pages/dashboard/GLD/index.js +++ b/src/pages/dashboard/GLD/index.js @@ -20,13 +20,26 @@ const DashboardDefault = () => { backgroundColor: '#0C489E', backgroundPosition: 'right' } + const getWelcomeMsg=()=>{ + var current = new Date() + var curHr = current.getHours() + + if (curHr < 12) { + return "Good Morning" + } else if (curHr < 18) { + return "Good Afternoon" + } else { + //evening + return "Good Evening" + } + } return (
- Morning, {userData.fullenName} + {getWelcomeMsg()}, {userData.fullenName}
diff --git a/src/pages/dashboard/Public/index.js b/src/pages/dashboard/Public/index.js index ee7f1df..00f3deb 100644 --- a/src/pages/dashboard/Public/index.js +++ b/src/pages/dashboard/Public/index.js @@ -35,6 +35,20 @@ const DashboardDefault = () => { backgroundColor: '#0C489E', backgroundPosition: 'right' } + + const getWelcomeMsg=()=>{ + var current = new Date() + var curHr = current.getHours() + + if (curHr < 12) { + return + } else if (curHr < 18) { + return + } else { + return + } + } + return ( @@ -42,7 +56,7 @@ const DashboardDefault = () => { {/* 我的公共啟事 */} - {isORGLoggedIn() ? userData.fullenName : userData.fullchName}, + {isORGLoggedIn() ? userData.fullenName : userData.fullchName}, {getWelcomeMsg()} diff --git a/src/translations/en.json b/src/translations/en.json index a7bcca3..03348c4 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -96,7 +96,10 @@ "onlinePaymentHistory": "Online Payment History", "setting": "Settings", "companyOrUserRecord": "Company/Institutional User Records", - "welcomeMsg": "Good afternoon! Please select the required service.", + "welcomeMsg_am": "Good morning! Please select the required service.", + "welcomeMsg_pm": "Good afternoon! Please select the required service.", + "welcomeMsg_night": "Good evening! Please select the required service.", + "login": "Login", "logout": "Logout", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index f398d5b..e617f24 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -95,7 +95,9 @@ "onlinePaymentHistory": "网上付款记录", "setting": "设置", "companyOrUserRecord": "公司/机构用户记录", - "welcomeMsg": "午安! 请选择所需服务。", + "welcomeMsg_am": "早安! 请选择所需服务。", + "welcomeMsg_pm": "午安! 请选择所需服务。", + "welcomeMsg_night": "晚安! 请选择所需服务。", "login": "登录", "logout": "登出", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 7c306b9..b524645 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -95,7 +95,9 @@ "onlinePaymentHistory": "網上付款記錄", "setting": "設定", "companyOrUserRecord": "公司/機構用戶記錄", - "welcomeMsg": "午安! 請選擇所需服務。", + "welcomeMsg_am": "早安! 請選擇所需服務。", + "welcomeMsga_pm": "午安! 請選擇所需服務。", + "welcomeMsg_night": "晚安! 請選擇所需服務。", "login": "登入", "logout": "登出", From 638ef90b46cb478c3ce2f48858dc366e8d777817 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 4 Mar 2024 12:14:22 +0800 Subject: [PATCH 2/5] allow input eng name or chi name --- .../auth-forms/CustomFormWizard.js | 46 +++++++++++-------- src/translations/en.json | 1 + src/translations/zh-CN.json | 1 + src/translations/zh-HK.json | 1 + 4 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 22b5922..d59cde9 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -303,13 +303,13 @@ const CustomFormWizard = (props) => { selectedAddress4, selectedAddress5, termsAndConAccept, termsAndConNotAccept, fileList]) - useEffect(()=>{ + useEffect(() => { setDistrictErrStr(""); - if(selectedAddress5?.type === "hongKong"){ - if(selectedAddress4 ==null || selectedAddress4 == ""|| selectedAddress4 == {}) + if (selectedAddress5?.type === "hongKong") { + if (selectedAddress4 == null || selectedAddress4 == "" || selectedAddress4 == {}) setDistrictErrStr(getRequiredErrStr("district")) } - },[selectedAddress4, selectedAddress5]) + }, [selectedAddress4, selectedAddress5]) useEffect(() => { props.step == 2 ? _onSubmit() : null; @@ -541,11 +541,11 @@ const CustomFormWizard = (props) => { return {errorMsg} } - function getMaxErrStr(num, fieldname){ - return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' },{num:num, fieldname:fieldname?intl.formatMessage({ id: fieldname})+": ":""})); + function getMaxErrStr(num, fieldname) { + return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" })); } - function getRequiredErrStr(fieldname){ - return displayErrorMsg(intl.formatMessage({ id: 'require'},{fieldname:fieldname?intl.formatMessage({ id: fieldname}):""})); + function getRequiredErrStr(fieldname) { + return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" })); } const formik = useFormik({ @@ -581,14 +581,17 @@ const CustomFormWizard = (props) => { .matches(/^(?=.*[0-9])/, { message: displayErrorMsg(intl.formatMessage({ id: 'atLeast1Number' })) }) .matches(/^(?=.*[!@#%&])/, { 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' }))), - chName: yup.string().max(6, getMaxErrStr(6)).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))), + enName: yup.string().max(40, getMaxErrStr(40)), + chName: yup.string().max(6, getMaxErrStr(6)).when('enName', { + is: (enName) => enName?false:true, + then: yup.string().required(displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))) + }), address1: yup.string().max(40, getMaxErrStr(40, "addressLine1")).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))), address2: yup.string().max(40, getMaxErrStr(40, "addressLine2")), address3: yup.string().max(40, getMaxErrStr(40, "addressLine3")), email: yup.string().email(displayErrorMsg(intl.formatMessage({ id: 'validEmailFormat' }))).max(128, getMaxErrStr(128)).required(displayErrorMsg(intl.formatMessage({ id: 'requireEmail' }))), emailConfirm: yup.string().email(displayErrorMsg(intl.formatMessage({ id: 'validEmailFormat' }))).max(128, getMaxErrStr(128)).required(displayErrorMsg(intl.formatMessage({ id: 'requireEmail' }))).oneOf([yup.ref('email'), null], displayErrorMsg(intl.formatMessage({ id: 'validSameEmail' }))), - idNo: yup.string().required(displayErrorMsg(`${intl.formatMessage({ id: 'require' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`)) + idNo: yup.string().required(getRequiredErrStr('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) { @@ -648,7 +651,7 @@ const CustomFormWizard = (props) => { // faxCountryCode: yup.string().min(3,'請輸入3位數字'), phone: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requireAtLeast8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), // fax: yup.string().min(8,'請輸入8位數字'), - captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')), + captchaField: yup.string().max(5, getMaxErrStr(5)).required(displayErrorMsg(intl.formatMessage({ id: 'requireVerify' }))),//.oneOf([captcha], displayErrorMsg('請輸入有效驗證')), }), }); @@ -934,7 +937,7 @@ const CustomFormWizard = (props) => { /> {formik.touched.idDocType && ( selectedIdDocType === null || selectedIdDocType?.type == null ? - + : '' )} @@ -1067,12 +1070,17 @@ const CustomFormWizard = (props) => { } + + + () + + - {selectedIdDocType.type === "CNID" ? "" : *} + {selectedIdDocType.type === "CNID" ? "" : } { - * + { 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) => { @@ -1252,7 +1260,7 @@ const CustomFormWizard = (props) => { {formik.errors.address3} )} - {districtErrStr!= "" && ( + {districtErrStr != "" && ( {districtErrStr} @@ -1685,8 +1693,8 @@ const CustomFormWizard = (props) => { : - {intl.formatMessage({ id: selectedIdDocType?.label??" " })} - + {intl.formatMessage({ id: selectedIdDocType?.label ?? " " })} + diff --git a/src/translations/en.json b/src/translations/en.json index 03348c4..ddac5d4 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -150,6 +150,7 @@ "registerNewBusinessUser": "Apply as organisation/company user", "becomeNewBusinessUser": "Become New Organisation/Company user", "userName": "Username", + "registerNameLabel": "Please provide either an English name or a Chinese name, at a minimum.", "userChineseName": "Chinese Name", "userEnglishName": "English Name", "userContactName": "Name", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index e617f24..fa30fa9 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -144,6 +144,7 @@ "registerNewBusinessUser": "申请机构/公司用户", "becomeNewBusinessUser": "成为新的机构/公司用户", "userName": "用户名称", + "registerNameLabel": "请至少输入英文姓名或中文姓名。", "userChineseName": "中文姓名", "userEnglishName": "英文姓名", "userContactName": "姓名", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index b524645..a641af8 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -147,6 +147,7 @@ "registerNewBusinessUser": "申請機構/公司用戶", "becomeNewBusinessUser": "成為新的機構/公司用戶", "userName": "用戶名稱", + "registerNameLabel": "請至少輸入英文姓名或中文姓名。", "userChineseName": "中文姓名", "userEnglishName": "英文姓名", "userContactName": "姓名", From 59c51da07172d5944bd573b12e2d656967fd1037 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 4 Mar 2024 14:10:11 +0800 Subject: [PATCH 3/5] update label --- src/translations/en.json | 2 +- src/translations/zh-CN.json | 2 +- src/translations/zh-HK.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/translations/en.json b/src/translations/en.json index 6cbc602..c9f0312 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -246,7 +246,7 @@ "mainlandIDCard": "Mainland ID card", "proCert": "Professional Practice Certificate", "idDocType": "Document Category", - "requireIdDocType": "Please enter the document type", + "requireIdDocType": "Please select the document type", "idDocNumber": "ID number", "requireIdDocNumber": "Please enter the document ID", "requiredNumberInQuote": "Please enter the numbers or letters in brackets", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index dae5511..72d0ef9 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -241,7 +241,7 @@ "mainlandIDCard": "内地身份证", "proCert": "专业执业证书", "idDocType": "证件类别", - "requireIdDocType": "请输入证件类别", + "requireIdDocType": "请选择证件类别", "idDocNumber": "证件号码", "requireIdDocNumber": "请输入证件号码", "requiredNumberInQuote": "请输入括号内的数字或字母", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 0280d50..d80cf84 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -246,7 +246,7 @@ "mainlandIDCard": "內地身份證", "proCert": "專業執業證書", "idDocType": "證件類別", - "requireIdDocType": "請輸入證件類別", + "requireIdDocType": "請選擇證件類別", "idDocNumber": "證件號碼", "requireIdDocNumber": "請輸入證件號碼", "requiredNumberInQuote": "請輸入括號內的數字或字母", From 823cfcc0112094d70825b8d9615dc2fe5a077ab6 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 4 Mar 2024 14:35:18 +0800 Subject: [PATCH 4/5] update label --- src/pages/authentication/auth-forms/CustomFormWizard.js | 2 +- src/translations/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index d59cde9..db3ed52 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -1072,7 +1072,7 @@ const CustomFormWizard = (props) => {
- () + diff --git a/src/translations/en.json b/src/translations/en.json index 85a3d29..7454dfc 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -440,7 +440,7 @@ "noRecordFound": "No record found", "rowsPerPage": "Rows Per Page", "date" : "Date", - "keyword": "Key word", + "keyword": "Keyword", "dateFrom": "Date(From)", "dateTo": "Date(To)", "of": "of", From 1de8ae14c74772b8968fe278078435930a84a50c Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 4 Mar 2024 15:52:27 +0800 Subject: [PATCH 5/5] update label --- src/pages/Payment/MultiPaymentWindow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/Payment/MultiPaymentWindow.js b/src/pages/Payment/MultiPaymentWindow.js index 85e2cda..85f06f2 100644 --- a/src/pages/Payment/MultiPaymentWindow.js +++ b/src/pages/Payment/MultiPaymentWindow.js @@ -387,7 +387,7 @@ const MultiPaymentWindow = (props) => {