diff --git a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js index bb2f6ae..825a87f 100644 --- a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js +++ b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js @@ -26,11 +26,17 @@ import {ThemeProvider} from "@emotion/react"; const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { const intl = useIntl(); - const [currentUserData, setCurrentUserData] = useState(formData); + const [currentUserData, setCurrentUserData] = useState({}); const [editMode, setEditMode] = useState(false); const [onReady, setOnReady] = useState(false); const [errorMsg, setErrorMsg] = useState(""); + useEffect(() => { + if (Object.keys(formData).length > 0) { + setCurrentUserData(formData); + } + }, [formData]); + useEffect(() => { //if state data are ready and assign to different field // console.log(currentApplicationDetailData) @@ -91,7 +97,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { }, onSuccess: function () { 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 = () => { setEditMode(true); }; @@ -216,24 +210,7 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { valueName: "idDocType", disabled: true, 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 })} diff --git a/src/pages/User/DetailsPage_Individual/index.js b/src/pages/User/DetailsPage_Individual/index.js index 5831a1d..f7cdb6c 100644 --- a/src/pages/User/DetailsPage_Individual/index.js +++ b/src/pages/User/DetailsPage_Individual/index.js @@ -95,7 +95,7 @@ const UserMaintainPage_Individual = () => { } }); } - if (isINDLoggedIn()){ + else if (isINDLoggedIn()){ HttpUtils.get({ url: `${UrlUtils.GET_PUB_IND_USER_PATH}`, onSuccess: function (response) { diff --git a/src/translations/en.json b/src/translations/en.json index 980ee64..de9f4e6 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -262,8 +262,11 @@ "yourContact": "Your Contact Information", "passport": "Passport", "HKIDcard": "Hong Kong ID Card", + "HKID": "Hong Kong ID Card", "mainlandIDCard": "Mainland ID card", + "CNID": "Mainland ID card", "proCert": "Professional Practice Certificate", + "otherCert": "Professional Practice Certificate", "idDocType": "Document Category", "requireIdDocType": "Please select the document type", "idDocNumber": "ID number", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 822acae..a7374cb 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -256,8 +256,11 @@ "yourContact": "你的联络资料", "passport": "护照", "HKIDcard": "香港身份证", + "HKID": "香港身份证", "mainlandIDCard": "内地身份证", + "CNID": "内地身份证", "proCert": "专业执业证书", + "otherCert": "专业执业证书", "idDocType": "证件类别", "requireIdDocType": "请选择证件类别", "idDocNumber": "证件号码", @@ -442,7 +445,7 @@ "idType": "身份证类型", "idNo": "身份证号码", "country": "国家", - "district": "区", + "district": "区域", "noRecordFound": "找不到记录", "rowsPerPage": "每页项数", "date" : "日期", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 667b52d..39941ef 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -259,8 +259,11 @@ "yourContact": "你的聯絡資料", "passport": "護照", "HKIDcard": "香港身份證", + "HKID": "香港身份證", "mainlandIDCard": "內地身份證", + "CNID": "內地身份證", "proCert": "專業執業證書", + "otherCert": "專業執業證書", "idDocType": "證件類別", "requireIdDocType": "請選擇證件類別", "idDocNumber": "證件號碼", @@ -445,7 +448,7 @@ "idType": "身分證類型", "idNo": "身分證號碼", "country": "國家", - "district": "區", + "district": "區域", "noRecordFound": "找不到記錄", "rowsPerPage": "每頁項數", "date" : "日期", diff --git a/src/utils/ComboData.js b/src/utils/ComboData.js index 74f2bf8..bed01a4 100644 --- a/src/utils/ComboData.js +++ b/src/utils/ComboData.js @@ -1,8 +1,8 @@ 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 = [