25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

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