Browse Source

update IND user bug and label

master
Anna Ho 1 year ago
parent
commit
a1aab9ed08
6 changed files with 25 additions and 39 deletions
  1. +9
    -32
      src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
  2. +1
    -1
      src/pages/User/DetailsPage_Individual/index.js
  3. +3
    -0
      src/translations/en.json
  4. +4
    -1
      src/translations/zh-CN.json
  5. +4
    -1
      src/translations/zh-HK.json
  6. +4
    -4
      src/utils/ComboData.js

+ 9
- 32
src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js View File

@@ -26,11 +26,17 @@ import {ThemeProvider} from "@emotion/react";
const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {


const intl = useIntl(); const intl = useIntl();
const [currentUserData, setCurrentUserData] = useState(formData);
const [currentUserData, setCurrentUserData] = useState({});
const [editMode, setEditMode] = useState(false); const [editMode, setEditMode] = useState(false);
const [onReady, setOnReady] = useState(false); const [onReady, setOnReady] = useState(false);
const [errorMsg, setErrorMsg] = useState(""); const [errorMsg, setErrorMsg] = useState("");


useEffect(() => {
if (Object.keys(formData).length > 0) {
setCurrentUserData(formData);
}
}, [formData]);

useEffect(() => { useEffect(() => {
//if state data are ready and assign to different field //if state data are ready and assign to different field
// console.log(currentApplicationDetailData) // console.log(currentApplicationDetailData)
@@ -91,7 +97,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
}, },
onSuccess: function () { onSuccess: function () {
notifySaveSuccess(); notifySaveSuccess();
loadDataFun();
window.location.reload();
} }
}); });
} }
@@ -99,18 +105,6 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
} }
}); });




useEffect(() => {
if (Object.keys(formData).length > 0) {
setCurrentUserData(formData);
}
}, [formData]);

useEffect(() => {

}, [currentUserData]);

const onEditClick = () => { const onEditClick = () => {
setEditMode(true); setEditMode(true);
}; };
@@ -216,24 +210,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
valueName: "idDocType", valueName: "idDocType",
disabled: true, disabled: true,
dataList: ComboData.idDocType, dataList: ComboData.idDocType,
filterOptions: (options) => options,
getOptionLabel: (item) => item ? typeof item === 'string' ? item : (item["type"] ? item["type"] + "-" + item["label"] : "") : "",
onInputChange: (event, newValue, setInputValue) => {
if (newValue == null) {
setInputValue("");
}
let _val = newValue.split("-");
if (_val[0]) {
setInputValue(_val[0]);
}
},
onChange: (event, newValue) => {
if (newValue == null) {
formik.setFieldValue("idDocType", "");
return;
}
formik.setFieldValue("idDocType", newValue.type);
},
getOptionLabel: (option) => option? intl.formatMessage({ id: option }) : "",
form: formik form: formik
})} })}
</Grid> </Grid>


+ 1
- 1
src/pages/User/DetailsPage_Individual/index.js View File

@@ -95,7 +95,7 @@ const UserMaintainPage_Individual = () => {
} }
}); });
} }
if (isINDLoggedIn()){
else if (isINDLoggedIn()){
HttpUtils.get({ HttpUtils.get({
url: `${UrlUtils.GET_PUB_IND_USER_PATH}`, url: `${UrlUtils.GET_PUB_IND_USER_PATH}`,
onSuccess: function (response) { onSuccess: function (response) {


+ 3
- 0
src/translations/en.json View File

@@ -262,8 +262,11 @@
"yourContact": "Your Contact Information", "yourContact": "Your Contact Information",
"passport": "Passport", "passport": "Passport",
"HKIDcard": "Hong Kong ID Card", "HKIDcard": "Hong Kong ID Card",
"HKID": "Hong Kong ID Card",
"mainlandIDCard": "Mainland ID card", "mainlandIDCard": "Mainland ID card",
"CNID": "Mainland ID card",
"proCert": "Professional Practice Certificate", "proCert": "Professional Practice Certificate",
"otherCert": "Professional Practice Certificate",
"idDocType": "Document Category", "idDocType": "Document Category",
"requireIdDocType": "Please select the document type", "requireIdDocType": "Please select the document type",
"idDocNumber": "ID number", "idDocNumber": "ID number",


+ 4
- 1
src/translations/zh-CN.json View File

@@ -256,8 +256,11 @@
"yourContact": "你的联络资料", "yourContact": "你的联络资料",
"passport": "护照", "passport": "护照",
"HKIDcard": "香港身份证", "HKIDcard": "香港身份证",
"HKID": "香港身份证",
"mainlandIDCard": "内地身份证", "mainlandIDCard": "内地身份证",
"CNID": "内地身份证",
"proCert": "专业执业证书", "proCert": "专业执业证书",
"otherCert": "专业执业证书",
"idDocType": "证件类别", "idDocType": "证件类别",
"requireIdDocType": "请选择证件类别", "requireIdDocType": "请选择证件类别",
"idDocNumber": "证件号码", "idDocNumber": "证件号码",
@@ -442,7 +445,7 @@
"idType": "身份证类型", "idType": "身份证类型",
"idNo": "身份证号码", "idNo": "身份证号码",
"country": "国家", "country": "国家",
"district": "区",
"district": "区",
"noRecordFound": "找不到记录", "noRecordFound": "找不到记录",
"rowsPerPage": "每页项数", "rowsPerPage": "每页项数",
"date" : "日期", "date" : "日期",


+ 4
- 1
src/translations/zh-HK.json View File

@@ -259,8 +259,11 @@
"yourContact": "你的聯絡資料", "yourContact": "你的聯絡資料",
"passport": "護照", "passport": "護照",
"HKIDcard": "香港身份證", "HKIDcard": "香港身份證",
"HKID": "香港身份證",
"mainlandIDCard": "內地身份證", "mainlandIDCard": "內地身份證",
"CNID": "內地身份證",
"proCert": "專業執業證書", "proCert": "專業執業證書",
"otherCert": "專業執業證書",
"idDocType": "證件類別", "idDocType": "證件類別",
"requireIdDocType": "請選擇證件類別", "requireIdDocType": "請選擇證件類別",
"idDocNumber": "證件號碼", "idDocNumber": "證件號碼",
@@ -445,7 +448,7 @@
"idType": "身分證類型", "idType": "身分證類型",
"idNo": "身分證號碼", "idNo": "身分證號碼",
"country": "國家", "country": "國家",
"district": "區",
"district": "區",
"noRecordFound": "找不到記錄", "noRecordFound": "找不到記錄",
"rowsPerPage": "每頁項數", "rowsPerPage": "每頁項數",
"date" : "日期", "date" : "日期",


+ 4
- 4
src/utils/ComboData.js View File

@@ -1,8 +1,8 @@
export const idDocType = [ export const idDocType = [
{ id:1, key: 1, label: 'passport', type: 'passport' },
{ id:2, key: 2, label: 'HKIDcard', type: 'HKID' },
{ id:3, key: 3, label: 'mainlandIDCard', type: 'CNID' },
{ id:4, key: 4, label: 'proCert', type: 'otherCert' }
{ id:1, key: 'passport', label: 'passport', type: 'passport', i18nLabel: 'passport' },
{ id:2, key: 'HKID', label: 'HKIDcard', type: 'HKID', i18nLabel: 'HKIDcard' },
{ id:3, key: 'CNID', label: 'mainlandIDCard', type: 'CNID', i18nLabel: 'mainlandIDCard' },
{ id:4, key: 'otherCert', label: 'proCert', type: 'otherCert', i18nLabel: 'proCert' }
]; ];
export const district = [ export const district = [


Loading…
Cancel
Save