Parcourir la source

update IND user bug and label

master
Anna Ho il y a 1 an
Parent
révision
a1aab9ed08
6 fichiers modifiés avec 25 ajouts et 39 suppressions
  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 Voir le fichier

@@ -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
})}
</Grid>


+ 1
- 1
src/pages/User/DetailsPage_Individual/index.js Voir le fichier

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


+ 3
- 0
src/translations/en.json Voir le fichier

@@ -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",


+ 4
- 1
src/translations/zh-CN.json Voir le fichier

@@ -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" : "日期",


+ 4
- 1
src/translations/zh-HK.json Voir le fichier

@@ -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" : "日期",


+ 4
- 4
src/utils/ComboData.js Voir le fichier

@@ -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 = [


Chargement…
Annuler
Enregistrer