You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

704 lines
37 KiB

  1. // material-ui
  2. import {
  3. Grid, Button, Typography,
  4. FormHelperText,
  5. Stack,
  6. IconButton
  7. } from '@mui/material';
  8. import MainCard from "components/MainCard";
  9. import { useEffect, useState, lazy } from "react";
  10. import * as yup from 'yup';
  11. import { useFormik } from 'formik';
  12. import * as FieldUtils from "utils/FieldUtils";
  13. import * as HttpUtils from 'utils/HttpUtils';
  14. import * as UrlUtils from "utils/ApiPathConst";
  15. import * as ComboData from "utils/ComboData";
  16. import en from "translations/en.json";
  17. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  18. import Loadable from 'components/Loadable';
  19. import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction';
  20. import { useIntl } from "react-intl";
  21. import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
  22. import { ThemeProvider } from "@emotion/react";
  23. import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
  24. import { isGrantedAny } from "auth/utils";
  25. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  26. const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
  27. const intl = useIntl();
  28. const [currentUserData, setCurrentUserData] = useState(formData);
  29. const [editMode, setEditMode] = useState(false);
  30. const [locked, setLocked] = useState(false);
  31. const [onReady, setOnReady] = useState(false);
  32. const [errorMsg, setErrorMsg] = useState("");
  33. const [showId, setshowId] = useState(false);
  34. const [selectedIdDocInputType, setSelectedIdDocInputType] = useState("");
  35. const handleClickShowId = () => {
  36. setshowId(!showId);
  37. };
  38. const handleMouseDownId = (event) => {
  39. event.preventDefault();
  40. };
  41. const getIdDocTypeLabel = (option) => {
  42. if (!option) return "";
  43. if (typeof option === "string") {
  44. const item = ComboData.idDocType.find((o) => o.type === option);
  45. return item?.label ? (en[item.label] ?? option) : option;
  46. }
  47. return option.label ? (en[option.label] ?? "") : "";
  48. };
  49. useEffect(() => {
  50. //if state data are ready and assign to different field
  51. // console.log(currentApplicationDetailData)
  52. if (Object.keys(currentUserData).length > 0) {
  53. setSelectedIdDocInputType(currentUserData.idDocType);
  54. setOnReady(true);
  55. }
  56. }, [currentUserData]);
  57. function getMaxErrStr(num, fieldname) {
  58. return intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" });
  59. }
  60. function getRequiredErrStr(fieldname) {
  61. return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" }));
  62. }
  63. function displayErrorMsg(errorMsg) {
  64. return <Typography variant="errorMessage1">{errorMsg}</Typography>
  65. }
  66. const formik = useFormik({
  67. enableReinitialize: true,
  68. initialValues: currentUserData,
  69. validationSchema: yup.object().shape({
  70. enName: yup.string().max(40, getMaxErrStr(40)).when('chName', {
  71. is: (chName) => chName?false:true,
  72. then: yup.string().required(intl.formatMessage({ id: 'userRequireEnglishName' }))
  73. }).nullable(),
  74. chName: yup.string().max(6, getMaxErrStr(6)).nullable(),
  75. addressLine1: yup.string().max(40, getMaxErrStr(40)).required(intl.formatMessage({ id: 'validateAddressLine1' })),
  76. addressLine2: yup.string().max(40, getMaxErrStr(40)).nullable(),
  77. addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(),
  78. emailAddress: yup.string().email(intl.formatMessage({ id: 'validEmailFormat' })).max(255).required(intl.formatMessage({ id: 'requireEmail' })),
  79. idDocType: yup.string().max(255, getMaxErrStr(255)).required(intl.formatMessage({ id: 'requireIdDocType' })),
  80. identification: yup.string().when('verifiedBy', {
  81. is: (verifiedBy) => verifiedBy != null,
  82. then: (schema) => schema.notRequired(),
  83. otherwise: (schema) => schema.required(getRequiredErrStr('number'))
  84. .matches(/^[aA-zZ0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) })
  85. .matches(/^\S*$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpace' })}`) })
  86. .test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredValid' })}${selectedIdDocInputType}${intl.formatMessage({ id: 'number' })}`), function (value) {
  87. var pattern_HKIDv1 = /^[A-Z]{1}[0-9]{6}$/;
  88. var pattern_HKIDv2 = /^[A-Z]{2}[0-9]{6}$/;
  89. var pattern_passport = /^[A-Z]{1}[0-9]{8}$/;
  90. var pattern_CHID = /^[0-9]{6}(20|19)[0-9]{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])[0-9]{3}[0-9X]{1}/;
  91. var pattern_otherCert = /^[A-Z]{1}[0-9]{5,}/;
  92. if (value !== undefined) {
  93. switch (selectedIdDocInputType) {
  94. case "HKID":
  95. if (value.match(pattern_HKIDv1)) {
  96. return true
  97. } else if (value.match(pattern_HKIDv2)) {
  98. return true
  99. } else {
  100. return false
  101. }
  102. case "passport":
  103. if (value.match(pattern_passport)) {
  104. return true
  105. } else {
  106. return false
  107. }
  108. case "CNID":
  109. if (value.match(pattern_CHID)) {
  110. const subStr_year = value.substring(6, 10)
  111. const subStr_month = value.substring(10, 12)
  112. const subStr_date = value.substring(12, 14)
  113. const today = new Date()
  114. const inputDate = new Date(`${subStr_year}-${subStr_month}-${subStr_date}`)
  115. if (inputDate > today || inputDate === "Invalid Date" || inputDate.getFullYear().toString() !== subStr_year || (inputDate.getMonth() + 1).toString().padStart(2, "0") !== subStr_month || inputDate.getDate().toString().padStart(2, "0") !== subStr_date) {
  116. return false
  117. } else {
  118. return true
  119. }
  120. } else {
  121. return false
  122. }
  123. case "otherCert":
  124. if (value.match(pattern_otherCert)) {
  125. return true
  126. } else {
  127. return false
  128. }
  129. default:
  130. break;
  131. }
  132. }
  133. })
  134. }),
  135. checkDigit: yup.string().when('verifiedBy', {
  136. is: (verifiedBy) => verifiedBy != null,
  137. then: (schema) => schema.notRequired(),
  138. otherwise: (schema) => schema.max(1, getMaxErrStr(1)).nullable()
  139. .matches(/^[A-Z0-9\s]+$/, { message: displayErrorMsg(`${selectedIdDocInputType}${intl.formatMessage({ id: 'noSpecialCharacter' })}`) })
  140. .test('checkIDCardFormat', displayErrorMsg(`${intl.formatMessage({ id: 'requiredNumberInQuote' })}`), function (value) {
  141. // console.log(selectedIdDocInputType)
  142. if (value != undefined || value != null) {
  143. switch (selectedIdDocInputType) {
  144. case "HKID":
  145. if (value.length == 1) {
  146. return true
  147. } else {
  148. return false
  149. }
  150. case "passport":
  151. return true
  152. case "CNID":
  153. return true
  154. case "otherCert":
  155. return true
  156. default:
  157. break;
  158. }
  159. } else {
  160. if (selectedIdDocInputType != "HKID"){
  161. return true
  162. } else {
  163. return false
  164. }
  165. }
  166. })
  167. }),
  168. tel_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })).required(intl.formatMessage({ id: 'requireDialingCode' })),
  169. fax_countryCode: yup.string().min(3, intl.formatMessage({ id: 'require3Number' })),
  170. phoneNumber: yup.string().min(8, intl.formatMessage({ id: 'require8Number' })).required(intl.formatMessage({ id: 'requireContactNumber' })),
  171. faxNumber: yup.string().min(8, intl.formatMessage({ id: 'require8Number' })).nullable(),
  172. }),
  173. onSubmit: values => {
  174. if (values.country == null) {
  175. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' }))
  176. } else {
  177. if (values.country.type == "hongKong" && values.district == null) {
  178. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' }))
  179. } else {
  180. HttpUtils.post({
  181. url: UrlUtils.POST_IND_USER + "/" + formData.id,
  182. params: {
  183. prefix: values.prefix,
  184. enName: values.enName,
  185. chName: values.chName,
  186. idDocType: values.idDocType,
  187. mobileNumber: {
  188. countryCode: values.tel_countryCode,
  189. phoneNumber: values.phoneNumber
  190. },
  191. ...(values.verifiedBy == null ? {
  192. identification: values.identification,
  193. checkDigit: values.checkDigit,
  194. } : {}),
  195. faxNo: {
  196. countryCode: values.fax_countryCode,
  197. faxNumber: values.faxNumber
  198. },
  199. emailAddress: values.emailAddress,
  200. address: {
  201. country: values.country.type,
  202. district: values.district?.type,
  203. addressLine1: values.addressLine1,
  204. addressLine2: values.addressLine2,
  205. addressLine3: values.addressLine3,
  206. },
  207. preferLocale: values.preferLocale.type
  208. },
  209. onSuccess: function () {
  210. notifySaveSuccess();
  211. loadDataFun();
  212. }
  213. });
  214. }
  215. }
  216. }
  217. });
  218. useEffect(() => {
  219. if (Object.keys(formData).length > 0) {
  220. setCurrentUserData(formData);
  221. }
  222. }, [formData]);
  223. useEffect(() => {
  224. setLocked(currentUserData.locked);
  225. }, [currentUserData]);
  226. const onEditClick = () => {
  227. setEditMode(true);
  228. };
  229. const onVerifiedClick = () => {
  230. HttpUtils.get({
  231. url: UrlUtils.GET_IND_USER_VERIFY + "/" + formData.id,
  232. onSuccess: function () {
  233. notifyVerifySuccess()
  234. loadDataFun();
  235. }
  236. });
  237. };
  238. const doLock = () => {
  239. HttpUtils.get({
  240. url: UrlUtils.GET_USER_LOCK + "/" + formData.id,
  241. onSuccess: function () {
  242. notifyLockSuccess()
  243. loadDataFun();
  244. }
  245. });
  246. };
  247. const doUnlock = () => {
  248. HttpUtils.get({
  249. url: UrlUtils.GET_USER_UNLOCK + "/" + formData.id,
  250. onSuccess: function () {
  251. notifyActiveSuccess()
  252. loadDataFun();
  253. }
  254. });
  255. };
  256. return (
  257. <MainCard elevation={0}
  258. border={false}
  259. content={false}
  260. >
  261. {!onReady ?
  262. <LoadingComponent />
  263. :
  264. <form onSubmit={formik.handleSubmit} style={{ padding: 12 }}>
  265. {/*top button*/}
  266. {
  267. isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) ?
  268. <Grid item xs={12} sm={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center">
  269. <Grid container maxWidth justifyContent="flex-start">
  270. {editMode ?
  271. <>
  272. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  273. <Grid item sx={{ mr: 3 }}>
  274. <Button
  275. variant="contained"
  276. onClick={loadDataFun}
  277. color="cancel"
  278. >
  279. Reset & Back
  280. </Button>
  281. </Grid>
  282. <Grid item sx={{ ml: 3, mr: 3 }}>
  283. <Button
  284. variant="contained"
  285. type="submit"
  286. color="success"
  287. >
  288. Save
  289. </Button>
  290. </Grid>
  291. </ThemeProvider>
  292. </>
  293. :
  294. <>
  295. <Grid item sx={{ mr: 3 }}>
  296. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  297. <Button
  298. variant="contained"
  299. onClick={onEditClick}
  300. >
  301. Edit
  302. </Button>
  303. </ThemeProvider>
  304. </Grid>
  305. </>
  306. }
  307. </Grid>
  308. </Grid>
  309. : <></>
  310. }
  311. {/*end top button*/}
  312. <Typography variant="h4" sx={{ mt: 3, mb: 2, borderBottom: "1px solid black" }}>
  313. Individual User Details
  314. </Typography>
  315. <Grid item xs={12} sm={12} md={12} lg={12}>
  316. <Grid container>
  317. <Grid item xs={12}>
  318. <FormHelperText error id="helper-text-address1-signup">
  319. <Typography variant="errorMessage1">
  320. {errorMsg}
  321. </Typography>
  322. </FormHelperText>
  323. </Grid>
  324. <Grid item xs={12} sm={12} md={12} lg={4} >
  325. {FieldUtils.getTextField({
  326. label: "Username:",
  327. valueName: "username",
  328. disabled: true,
  329. form: formik
  330. })}
  331. </Grid>
  332. <Grid item xs={12} sm={12} md={12} lg={4}>
  333. {FieldUtils.getTextField({
  334. label: "English Name:",
  335. valueName: "enName",
  336. disabled: (!editMode),
  337. form: formik
  338. })}
  339. </Grid>
  340. <Grid item xs={12} sm={12} md={12} lg={4}>
  341. {FieldUtils.getTextField({
  342. label: "Created Date:",
  343. valueName: "createDate",
  344. disabled: true,
  345. form: formik
  346. })}
  347. </Grid>
  348. <Grid item xs={12} sm={12} md={12} lg={4}>
  349. {FieldUtils.getTextField({
  350. label: "Prefix:",
  351. valueName: "prefix",
  352. disabled: (!editMode),
  353. form: formik
  354. })}
  355. </Grid>
  356. <Grid item xs={12} sm={12} md={12} lg={4}>
  357. {FieldUtils.getTextField({
  358. label: "Chinese Name:",
  359. valueName: "chName",
  360. disabled: (!editMode),
  361. form: formik
  362. })}
  363. </Grid>
  364. <Grid item xs={12} sm={12} md={12} lg={4}>
  365. {FieldUtils.getTextField({
  366. label: "Last Updated:",
  367. valueName: "modifieDate",
  368. disabled: true,
  369. form: formik
  370. })}
  371. </Grid>
  372. <Grid item xs={12} sm={12} md={12} lg={4}>
  373. {FieldUtils.getComboField({
  374. label: `${en.idDocType}:`,
  375. valueName: "idDocType",
  376. disabled: true,
  377. dataList: ComboData.idDocType,
  378. filterOptions: (options) => options,
  379. getOptionLabel: getIdDocTypeLabel,
  380. isOptionEqualToValue: (option, value) => {
  381. if (typeof value === "string") {
  382. return option?.type === value;
  383. }
  384. return option?.type === value?.type;
  385. },
  386. form: formik
  387. })}
  388. </Grid>
  389. <Grid item xs={12} sm={12} md={12} lg={4}>
  390. {FieldUtils.getPhoneField({
  391. label: "Contact Tel:",
  392. valueName: {
  393. code: "tel_countryCode",
  394. num: "phoneNumber"
  395. },
  396. disabled: (!editMode),
  397. form: formik
  398. })}
  399. </Grid>
  400. <Grid item xs={12} sm={12} md={12} lg={4}>
  401. <Grid container alignItems={"center"}>
  402. <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  403. <Typography variant="h5">Verified:</Typography>
  404. </Grid>
  405. {
  406. !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) || currentUserData.verifiedBy || editMode ?
  407. <Grid item xs={12} sm={12} md={6} lg={6} sx={{ mb: 2 }}>
  408. {FieldUtils.initField({
  409. valueName: "verifiedStatus",
  410. disabled: true,
  411. form: formik,
  412. })}
  413. </Grid>
  414. :
  415. <>
  416. <Grid item xs={8} sm={8} md={6} lg={4} sx={{ mb: 2 }}>
  417. {FieldUtils.initField({
  418. valueName: "verifiedStatus",
  419. disabled: true,
  420. form: formik,
  421. })}
  422. </Grid>
  423. <Grid item xs={2} sm={2} md={2} lg={2} sx={{ ml: 2, mb: 2 }}>
  424. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  425. <Button
  426. variant="contained"
  427. onClick={onVerifiedClick}
  428. >
  429. Verify
  430. </Button>
  431. </ThemeProvider>
  432. </Grid>
  433. </>
  434. }
  435. </Grid>
  436. </Grid>
  437. <Grid xs={12} sm={12} md={12} lg={4}>
  438. <Grid container alignItems={"center"} sx={{ mb: 2 }}>
  439. <Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  440. <Typography variant="h5">ID No.:</Typography>
  441. </Grid>
  442. <Grid item xs={12} sm={12} md={9} lg={6}>
  443. {currentUserData.verifiedBy ?
  444. <Typography variant="h5" mt={1}>
  445. Hidden for security purpose
  446. </Typography>
  447. :
  448. <Grid container>
  449. {formik.values.idDocType === "HKID" ?
  450. editMode ?
  451. <>
  452. <Grid item xs={6} sm={6} md={6} lg={7.5} sx={{ mr: 1 }}>
  453. {FieldUtils.initField({
  454. valueName: "identification",
  455. disabled: (!editMode),
  456. form: formik,
  457. placeholder: intl.formatMessage({ id: 'idDocNumber' }),
  458. inputProps: {
  459. maxLength: 7,
  460. onKeyDown: (e) => {
  461. if (e.key === 'Enter') {
  462. e.preventDefault();
  463. }
  464. },
  465. }
  466. })}
  467. </Grid>
  468. <Grid item xs={2} sm={2} md={2} lg={2} style={{ minWidth: 40 }}>
  469. {FieldUtils.initField({
  470. valueName: "checkDigit",
  471. disabled: (!editMode),
  472. form: formik,
  473. })}
  474. </Grid>
  475. </>
  476. :
  477. <Stack direction="row">
  478. <Typography variant="h5" mt={1}>
  479. {formik.values.identification?.slice(0, 4)}
  480. </Typography>
  481. <Typography variant="h5" mt={1}>
  482. {showId ? formik.values.identification?.slice(4) : "****"}{showId ? formik.values.checkDigit?'(' +formik.values.checkDigit+ ')': "()" : ""}
  483. </Typography>
  484. <IconButton
  485. aria-label={intl.formatMessage({ id: 'ariaToggleIdVisibility' })}
  486. onClick={handleClickShowId}
  487. onMouseDown={handleMouseDownId}
  488. edge="end"
  489. size="large"
  490. >
  491. {showId ? <EyeOutlined /> : <EyeInvisibleOutlined />}
  492. </IconButton>
  493. </Stack>
  494. :
  495. editMode ?
  496. <>
  497. <Grid item xs={10} sm={4} md={4} lg={10}>
  498. {FieldUtils.initField({
  499. valueName: "identification",
  500. disabled: (!editMode),
  501. form: formik
  502. })}
  503. </Grid>
  504. </>
  505. :
  506. <Stack direction="row">
  507. <Typography variant="h5" mt={1}>
  508. {formik.values.identification?.slice(0, 4)}
  509. </Typography>
  510. <Typography variant="h5" mt={1}>
  511. {showId ? formik.values.identification?.slice(4) : "****"}
  512. </Typography>
  513. <IconButton
  514. aria-label={intl.formatMessage({ id: 'ariaToggleIdVisibility' })}
  515. onClick={handleClickShowId}
  516. onMouseDown={handleMouseDownId}
  517. edge="end"
  518. size="large"
  519. >
  520. {showId ? <EyeOutlined /> : <EyeInvisibleOutlined />}
  521. </IconButton>
  522. </Stack>
  523. }
  524. </Grid>
  525. }
  526. </Grid>
  527. </Grid>
  528. </Grid>
  529. <Grid item xs={12} sm={12} md={12} lg={4}>
  530. {FieldUtils.getPhoneField({
  531. label: "Fax No.:",
  532. valueName: {
  533. code: "fax_countryCode",
  534. num: "faxNumber"
  535. },
  536. disabled: (!editMode),
  537. form: formik
  538. })}
  539. </Grid>
  540. <Grid item xs={12} sm={12} md={12} lg={4}>
  541. {FieldUtils.getTextField({
  542. label: "Last Login:",
  543. valueName: "lastLoginDate",
  544. disabled: true,
  545. form: formik
  546. })}
  547. </Grid>
  548. <Grid item xs={12} sm={12} md={12} lg={4}>
  549. {FieldUtils.getComboField({
  550. label: intl.formatMessage({ id: 'language' }) + ":",
  551. valueName: "preferLocale",
  552. dataList: ComboData.Locale,
  553. getOptionLabel: (option) => (option?.label != null ? String(option.label) : ""),
  554. disabled: (!editMode),
  555. form: formik
  556. })}
  557. </Grid>
  558. <Grid item xs={12} sm={12} md={12} lg={4}>
  559. {FieldUtils.getTextField({
  560. label: "Email:",
  561. valueName: "emailAddress",
  562. disabled: (!editMode),
  563. form: formik
  564. })}
  565. </Grid>
  566. <Grid item xs={12} sm={12} md={12} lg={4}>
  567. <Grid container alignItems={"center"} sx={{ mb: 2 }}>
  568. <Grid item xs={12} sm={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  569. <Typography variant="h5">Status:</Typography>
  570. </Grid>
  571. {
  572. !isGrantedAny(["MAINTAIN_USER", "MAINTAIN_IND_USER"]) || editMode ?
  573. <Grid item xs={8} sm={8} md={6} lg={6}>
  574. {FieldUtils.initField({
  575. valueName: "status",
  576. disabled: true,
  577. form: formik,
  578. })}
  579. </Grid>
  580. :
  581. <>
  582. <Grid item xs={8} sm={8} md={6} lg={4}>
  583. {FieldUtils.initField({
  584. valueName: "status",
  585. disabled: true,
  586. form: formik,
  587. })}
  588. </Grid>
  589. {
  590. locked ?
  591. <Grid item xs={2} sm={2} md={2} lg={2} sx={{ ml: 2 }}>
  592. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  593. <Button
  594. variant="contained"
  595. color="success"
  596. onClick={doUnlock}
  597. >
  598. Active
  599. </Button>
  600. </ThemeProvider>
  601. </Grid>
  602. :
  603. <Grid item xs={2} sm={2} md={2} lg={2} sx={{ ml: 2 }}>
  604. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  605. <Button
  606. variant="contained"
  607. color="error"
  608. onClick={doLock}
  609. >
  610. Lock
  611. </Button>
  612. </ThemeProvider>
  613. </Grid>
  614. }
  615. </>
  616. }
  617. </Grid>
  618. </Grid>
  619. <Grid item xs={12} sm={12} md={12} lg={12}>
  620. {FieldUtils.getAddressField({
  621. label: "Address:",
  622. valueName: ["addressLine1", "addressLine2", "addressLine3"],
  623. disabled: (!editMode),
  624. form: formik
  625. })}
  626. </Grid>
  627. <Grid item xs={12} sm={12} md={12} lg={12}>
  628. {FieldUtils.getProfileComboField({
  629. label: "",
  630. valueName: "district",
  631. dataList: ComboData.district,
  632. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  633. disabled: (!editMode),
  634. form: formik
  635. })}
  636. </Grid>
  637. <Grid item xs={12} sm={12} md={12} lg={12}>
  638. {FieldUtils.getProfileComboField({
  639. label: "",
  640. valueName: "country",
  641. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  642. dataList: ComboData.country,
  643. disabled: true,
  644. form: formik
  645. })}
  646. </Grid>
  647. </Grid>
  648. </Grid>
  649. </form>
  650. }
  651. </MainCard>
  652. );
  653. };
  654. export default UserInformationCard_Individual;