|
@@ -4,37 +4,36 @@ import { |
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
} from '@mui/material'; |
|
|
} from '@mui/material'; |
|
|
import MainCard from "components/MainCard"; |
|
|
import MainCard from "components/MainCard"; |
|
|
import * as React from "react"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { useState, useEffect, lazy } from 'react'; |
|
|
import * as FieldUtils from "utils/FieldUtils"; |
|
|
import * as FieldUtils from "utils/FieldUtils"; |
|
|
import * as HttpUtils from 'utils/HttpUtils'; |
|
|
import * as HttpUtils from 'utils/HttpUtils'; |
|
|
import * as UrlUtils from "utils/ApiPathConst"; |
|
|
|
|
|
|
|
|
import { POST_ORG_USER, GET_IND_USER_VERIFY, GET_USER_LOCK, GET_USER_UNLOCK } from "utils/ApiPathConst"; |
|
|
import * as ComboData from "utils/ComboData"; |
|
|
import * as ComboData from "utils/ComboData"; |
|
|
|
|
|
|
|
|
import { useFormik } from 'formik'; |
|
|
import { useFormik } from 'formik'; |
|
|
import * as yup from 'yup'; |
|
|
import * as yup from 'yup'; |
|
|
const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent'))); |
|
|
|
|
|
|
|
|
const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); |
|
|
import Loadable from 'components/Loadable'; |
|
|
import Loadable from 'components/Loadable'; |
|
|
import { lazy } from 'react'; |
|
|
|
|
|
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; |
|
|
import { notifyActiveSuccess, notifyLockSuccess, notifySaveSuccess, notifyVerifySuccess } from 'utils/CommonFunction'; |
|
|
import {useIntl} from "react-intl"; |
|
|
|
|
|
import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; |
|
|
|
|
|
import {ThemeProvider} from "@emotion/react"; |
|
|
|
|
|
|
|
|
import { useIntl } from "react-intl"; |
|
|
|
|
|
import { PNSPS_BUTTON_THEME } from "themes/buttonConst"; |
|
|
|
|
|
import { ThemeProvider } from "@emotion/react"; |
|
|
|
|
|
import { isGrantedAny } from "auth/utils"; |
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
// ==============================|| DASHBOARD - DEFAULT ||============================== // |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => { |
|
|
const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => { |
|
|
|
|
|
|
|
|
const [currentUserData, setCurrentUserData] = React.useState(userData); |
|
|
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); |
|
|
|
|
|
const [warningText, setWarningText] = React.useState(""); |
|
|
|
|
|
const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false); |
|
|
|
|
|
const [confirmText, setConfirmText] = React.useState(""); |
|
|
|
|
|
const [confirmAction, setConfirmAction] = React.useState(); |
|
|
|
|
|
const [editMode, setEditMode] = React.useState(false); |
|
|
|
|
|
const [onReady, setOnReady] = React.useState(false); |
|
|
|
|
|
|
|
|
const [currentUserData, setCurrentUserData] = useState(userData); |
|
|
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = useState(false); |
|
|
|
|
|
const [warningText, setWarningText] = useState(""); |
|
|
|
|
|
const [isConfirmPopUp, setIsConfirmPopUp] = useState(false); |
|
|
|
|
|
const [confirmText, setConfirmText] = useState(""); |
|
|
|
|
|
const [confirmAction, setConfirmAction] = useState(); |
|
|
|
|
|
const [editMode, setEditMode] = useState(false); |
|
|
|
|
|
const [onReady, setOnReady] = useState(false); |
|
|
const intl = useIntl(); |
|
|
const intl = useIntl(); |
|
|
React.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) |
|
|
if (Object.keys(currentUserData).length > 0) { |
|
|
if (Object.keys(currentUserData).length > 0) { |
|
@@ -50,57 +49,42 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
enableReinitialize: true, |
|
|
enableReinitialize: true, |
|
|
initialValues: currentUserData, |
|
|
initialValues: currentUserData, |
|
|
validationSchema: yup.object().shape({ |
|
|
validationSchema: yup.object().shape({ |
|
|
contactPerson: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'userRequireName'}))), |
|
|
|
|
|
enCompanyName: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'userRequireEnglishName'}))), |
|
|
|
|
|
|
|
|
contactPerson: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireName' }))), |
|
|
|
|
|
enCompanyName: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))), |
|
|
chCompanyName: yup.string().max(255).nullable(), |
|
|
chCompanyName: yup.string().max(255).nullable(), |
|
|
addressLine1: yup.string().max(40).required(displayErrorMsg(intl.formatMessage({id: 'validateAddressLine1'}))), |
|
|
|
|
|
|
|
|
addressLine1: yup.string().max(40).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))), |
|
|
addressLine2: yup.string().max(40).nullable(), |
|
|
addressLine2: yup.string().max(40).nullable(), |
|
|
addressLine3: yup.string().max(40).nullable(), |
|
|
addressLine3: yup.string().max(40).nullable(), |
|
|
emailBus: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({id: 'requireEmail'}))), |
|
|
|
|
|
tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'require3Number'}))).required(displayErrorMsg(intl.formatMessage({id: 'requireDialingCode'}))), |
|
|
|
|
|
fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({id: 'require3Number'}))).nullable(), |
|
|
|
|
|
phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'require8Number'}))).required(displayErrorMsg(intl.formatMessage({id: 'requireContactNumber'}))), |
|
|
|
|
|
faxNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'require8Number'}))).nullable(), |
|
|
|
|
|
brExpiryDate: yup.string().min(8, displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertValidityDate'}))), |
|
|
|
|
|
brNo: yup.string().max(8).required(displayErrorMsg(intl.formatMessage({id: 'pleaseFillInBusinessRegCertNumber'}))) |
|
|
|
|
|
.test('checkBrNoFormat', displayErrorMsg(`${intl.formatMessage({id: 'pleaseFillInValidBusinessRegCertNumber'})} (e.g. 12341234)`), function (value) { |
|
|
|
|
|
var brNo_pattern = /[0-9]{8}/ |
|
|
|
|
|
if (value !== undefined) { |
|
|
|
|
|
if (value.match(brNo_pattern)) { |
|
|
|
|
|
return true |
|
|
|
|
|
} else { |
|
|
|
|
|
return false |
|
|
|
|
|
|
|
|
emailBus: yup.string().max(255).required(displayErrorMsg(intl.formatMessage({ id: 'requireEmail' }))), |
|
|
|
|
|
tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'require3Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))), |
|
|
|
|
|
fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'require3Number' }))).nullable(), |
|
|
|
|
|
phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'require8Number' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))), |
|
|
|
|
|
faxNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'require8Number' }))).nullable(), |
|
|
|
|
|
brExpiryDate: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))), |
|
|
|
|
|
brNo: yup.string().max(8).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertNumber' }))) |
|
|
|
|
|
.test('checkBrNoFormat', displayErrorMsg(`${intl.formatMessage({ id: 'pleaseFillInValidBusinessRegCertNumber' })} (e.g. 12341234)`), function (value) { |
|
|
|
|
|
var brNo_pattern = /[0-9]{8}/ |
|
|
|
|
|
if (value !== undefined) { |
|
|
|
|
|
if (value.match(brNo_pattern)) { |
|
|
|
|
|
return true |
|
|
|
|
|
} else { |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}), |
|
|
|
|
|
|
|
|
}), |
|
|
}), |
|
|
}), |
|
|
onSubmit: (values) => { |
|
|
onSubmit: (values) => { |
|
|
HttpUtils.post({ |
|
|
HttpUtils.post({ |
|
|
url: UrlUtils.POST_ORG_USER + "/" + userData.id, |
|
|
|
|
|
|
|
|
url: POST_ORG_USER + "/" + userData.id, |
|
|
params: { |
|
|
params: { |
|
|
contactTel: { |
|
|
contactTel: { |
|
|
countryCode: values.tel_countryCode, |
|
|
countryCode: values.tel_countryCode, |
|
|
phoneNumber: values.phoneNumber |
|
|
phoneNumber: values.phoneNumber |
|
|
}, |
|
|
}, |
|
|
// faxNo: { |
|
|
|
|
|
// countryCode: values.fax_countryCode, |
|
|
|
|
|
// faxNumber: values.faxNumber |
|
|
|
|
|
// }, |
|
|
|
|
|
// addressBus: { |
|
|
|
|
|
// country: values.country, |
|
|
|
|
|
// district: values.district, |
|
|
|
|
|
// addressLine1: values.addressLine1, |
|
|
|
|
|
// addressLine2: values.addressLine2, |
|
|
|
|
|
// addressLine3: values.addressLine3, |
|
|
|
|
|
// }, |
|
|
|
|
|
identification: values.identification, |
|
|
identification: values.identification, |
|
|
emailBus: values.emailBus, |
|
|
emailBus: values.emailBus, |
|
|
contactPerson: values.contactPerson, |
|
|
contactPerson: values.contactPerson, |
|
|
// enCompanyName: values.enCompanyName, |
|
|
|
|
|
// chCompanyName: values.chCompanyName, |
|
|
|
|
|
orgId: values.orgId?.id, |
|
|
orgId: values.orgId?.id, |
|
|
// brNo: values.brNo, |
|
|
|
|
|
// brExpiryDate: values.brExpiryDate, |
|
|
|
|
|
preferLocale: values.preferLocale.type |
|
|
preferLocale: values.preferLocale.type |
|
|
}, |
|
|
}, |
|
|
onSuccess: function () { |
|
|
onSuccess: function () { |
|
@@ -113,7 +97,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
if (Object.keys(userData).length > 0) { |
|
|
if (Object.keys(userData).length > 0) { |
|
|
setCurrentUserData(userData); |
|
|
setCurrentUserData(userData); |
|
|
} |
|
|
} |
|
@@ -136,7 +120,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
const onVerifiedClick = () => { |
|
|
const onVerifiedClick = () => { |
|
|
if (formik?.values?.orgId) { |
|
|
if (formik?.values?.orgId) { |
|
|
HttpUtils.get({ |
|
|
HttpUtils.get({ |
|
|
url: UrlUtils.GET_IND_USER_VERIFY + "/" + userData.id, |
|
|
|
|
|
|
|
|
url: GET_IND_USER_VERIFY + "/" + userData.id, |
|
|
onSuccess: function () { |
|
|
onSuccess: function () { |
|
|
notifyVerifySuccess() |
|
|
notifyVerifySuccess() |
|
|
loadDataFun(); |
|
|
loadDataFun(); |
|
@@ -154,7 +138,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
setConfirmAction({ |
|
|
setConfirmAction({ |
|
|
function: function () { |
|
|
function: function () { |
|
|
HttpUtils.get({ |
|
|
HttpUtils.get({ |
|
|
url: UrlUtils.GET_USER_LOCK + "/" + userData.id, |
|
|
|
|
|
|
|
|
url: GET_USER_LOCK + "/" + userData.id, |
|
|
onSuccess: function () { |
|
|
onSuccess: function () { |
|
|
notifyLockSuccess() |
|
|
notifyLockSuccess() |
|
|
loadDataFun(); |
|
|
loadDataFun(); |
|
@@ -171,7 +155,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
setConfirmAction({ |
|
|
setConfirmAction({ |
|
|
function: function () { |
|
|
function: function () { |
|
|
HttpUtils.get({ |
|
|
HttpUtils.get({ |
|
|
url: UrlUtils.GET_USER_UNLOCK + "/" + userData.id, |
|
|
|
|
|
|
|
|
url: GET_USER_UNLOCK + "/" + userData.id, |
|
|
onSuccess: function () { |
|
|
onSuccess: function () { |
|
|
notifyActiveSuccess() |
|
|
notifyActiveSuccess() |
|
|
loadDataFun(); |
|
|
loadDataFun(); |
|
@@ -194,50 +178,57 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
<form onSubmit={formik.handleSubmit}> |
|
|
<form onSubmit={formik.handleSubmit}> |
|
|
|
|
|
|
|
|
{/*top button*/} |
|
|
{/*top button*/} |
|
|
<Grid item s={12} md={12} lg={12} sx={{ mb: 3, mt: 2 }} alignItems={"start"} justifyContent="center"> |
|
|
|
|
|
<Grid container maxWidth justifyContent="flex-start"> |
|
|
|
|
|
{editMode ? |
|
|
|
|
|
<> |
|
|
|
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={loadDataFun} |
|
|
|
|
|
color="cancel" |
|
|
|
|
|
> |
|
|
|
|
|
Reset & Back |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
color="success" |
|
|
|
|
|
> |
|
|
|
|
|
Save |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</ThemeProvider> |
|
|
|
|
|
</> |
|
|
|
|
|
: |
|
|
|
|
|
<> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
|
|
|
{isGrantedAny("MAINTAIN_USER") ? |
|
|
|
|
|
<Grid item s={12} md={12} lg={12} sx={{ mb: 3, mt: 2 }} alignItems={"start"} justifyContent="center"> |
|
|
|
|
|
<Grid container maxWidth justifyContent="flex-start"> |
|
|
|
|
|
{editMode ? |
|
|
|
|
|
<> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={onEditClick} |
|
|
|
|
|
> |
|
|
|
|
|
Edit |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={loadDataFun} |
|
|
|
|
|
color="cancel" |
|
|
|
|
|
> |
|
|
|
|
|
Reset & Back |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
type="submit" |
|
|
|
|
|
color="success" |
|
|
|
|
|
> |
|
|
|
|
|
Save |
|
|
|
|
|
</Button> |
|
|
|
|
|
</Grid> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
</> |
|
|
|
|
|
: |
|
|
|
|
|
<> |
|
|
|
|
|
|
|
|
|
|
|
<Grid item sx={{ ml: 3, mr: 3 }}> |
|
|
|
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={onEditClick} |
|
|
|
|
|
> |
|
|
|
|
|
Edit |
|
|
|
|
|
</Button> |
|
|
|
|
|
</ThemeProvider> |
|
|
|
|
|
</Grid> |
|
|
|
|
|
</> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
: <></> |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*end top button*/} |
|
|
{/*end top button*/} |
|
|
<div style={{ paddingLeft: 24, paddingRight: 24 }}> |
|
|
<div style={{ paddingLeft: 24, paddingRight: 24 }}> |
|
|
<Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> |
|
|
<Typography variant="h4" sx={{ mt: 3, mb: 2, mr: 3, borderBottom: "1px solid black" }}> |
|
@@ -305,9 +296,9 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
{FieldUtils.getComboField({ |
|
|
{FieldUtils.getComboField({ |
|
|
label: "Organisation:", |
|
|
label: "Organisation:", |
|
|
valueName: "orgId", |
|
|
valueName: "orgId", |
|
|
getOptionLabel: (option) => option.enCompanyName?option.enCompanyName:option.chCompanyName? option.chCompanyName : "", |
|
|
|
|
|
|
|
|
getOptionLabel: (option) => option.enCompanyName ? option.enCompanyName : option.chCompanyName ? option.chCompanyName : "", |
|
|
dataList: orgData, |
|
|
dataList: orgData, |
|
|
disabled: (!editMode), |
|
|
|
|
|
|
|
|
disabled: (!editMode), |
|
|
form: formik |
|
|
form: formik |
|
|
})} |
|
|
})} |
|
|
{/* {FieldUtils.getComboField({ |
|
|
{/* {FieldUtils.getComboField({ |
|
@@ -361,7 +352,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
</Grid> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
currentUserData.verifiedBy || editMode ? |
|
|
|
|
|
|
|
|
!isGrantedAny("MAINTAIN_USER") || currentUserData.verifiedBy || editMode ? |
|
|
<Grid item xs={12} md={6} lg={6}> |
|
|
<Grid item xs={12} md={6} lg={6}> |
|
|
{FieldUtils.initField({ |
|
|
{FieldUtils.initField({ |
|
|
valueName: "verifiedStatus", |
|
|
valueName: "verifiedStatus", |
|
@@ -380,12 +371,12 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid item xs={1} md={1} lg={1}> |
|
|
<Grid item xs={1} md={1} lg={1}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={() => { onVerifiedClick() }} |
|
|
|
|
|
> |
|
|
|
|
|
Verify |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
onClick={() => { onVerifiedClick() }} |
|
|
|
|
|
> |
|
|
|
|
|
Verify |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
</> |
|
|
</> |
|
@@ -404,10 +395,10 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
</Grid> |
|
|
</Grid> |
|
|
<Grid item xs={12} sm={12} md={12} lg={4}> |
|
|
<Grid item xs={12} sm={12} md={12} lg={4}> |
|
|
{FieldUtils.getComboField({ |
|
|
{FieldUtils.getComboField({ |
|
|
label: intl.formatMessage({id: 'language'}) + ":", |
|
|
|
|
|
|
|
|
label: intl.formatMessage({ id: 'language' }) + ":", |
|
|
valueName: "preferLocale", |
|
|
valueName: "preferLocale", |
|
|
dataList: ComboData.Locale, |
|
|
dataList: ComboData.Locale, |
|
|
getOptionLabel: (option) => option.label? option.label: "", |
|
|
|
|
|
|
|
|
getOptionLabel: (option) => option.label ? option.label : "", |
|
|
disabled: (!editMode), |
|
|
disabled: (!editMode), |
|
|
form: formik |
|
|
form: formik |
|
|
})} |
|
|
})} |
|
@@ -420,7 +411,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
<Typography variant="h5">Status:</Typography> |
|
|
<Typography variant="h5">Status:</Typography> |
|
|
</Grid> |
|
|
</Grid> |
|
|
{ |
|
|
{ |
|
|
editMode ? |
|
|
|
|
|
|
|
|
!isGrantedAny("MAINTAIN_USER") || editMode ? |
|
|
<Grid item xs={12} md={6} lg={6}> |
|
|
<Grid item xs={12} md={6} lg={6}> |
|
|
{FieldUtils.initField({ |
|
|
{FieldUtils.initField({ |
|
|
valueName: "status", |
|
|
valueName: "status", |
|
@@ -442,25 +433,25 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
{formik.values.locked ? |
|
|
{formik.values.locked ? |
|
|
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> |
|
|
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
color="success" |
|
|
|
|
|
onClick={doUnlock} |
|
|
|
|
|
> |
|
|
|
|
|
Active |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
color="success" |
|
|
|
|
|
onClick={doUnlock} |
|
|
|
|
|
> |
|
|
|
|
|
Active |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
: |
|
|
: |
|
|
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> |
|
|
<Grid item xs={1} md={1} lg={1} sx={{ ml: 1 }}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
color="error" |
|
|
|
|
|
onClick={doLock} |
|
|
|
|
|
> |
|
|
|
|
|
Lock |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
variant="contained" |
|
|
|
|
|
color="error" |
|
|
|
|
|
onClick={doLock} |
|
|
|
|
|
> |
|
|
|
|
|
Lock |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
} |
|
|
} |
|
@@ -478,11 +469,11 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
{currentUserData.orgId == null ? |
|
|
{currentUserData.orgId == null ? |
|
|
<Grid item lg={2} > |
|
|
<Grid item lg={2} > |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button variant="contained" |
|
|
|
|
|
onClick={createOrgClick} |
|
|
|
|
|
> |
|
|
|
|
|
Create Organisation |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button variant="contained" |
|
|
|
|
|
onClick={createOrgClick} |
|
|
|
|
|
> |
|
|
|
|
|
Create Organisation |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</Grid> |
|
|
</Grid> |
|
|
: null |
|
|
: null |
|
@@ -525,7 +516,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
{FieldUtils.getComboField({ |
|
|
{FieldUtils.getComboField({ |
|
|
label: "Country:", |
|
|
label: "Country:", |
|
|
valueName: "country", |
|
|
valueName: "country", |
|
|
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type }) : "", |
|
|
|
|
|
|
|
|
getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "", |
|
|
dataList: ComboData.country, |
|
|
dataList: ComboData.country, |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
form: formik |
|
|
form: formik |
|
@@ -558,7 +549,7 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
label: "District:", |
|
|
label: "District:", |
|
|
valueName: "district", |
|
|
valueName: "district", |
|
|
dataList: ComboData.district, |
|
|
dataList: ComboData.district, |
|
|
getOptionLabel: (option) => option.type? intl.formatMessage({ id: option.type }) : "", |
|
|
|
|
|
|
|
|
getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "", |
|
|
disabled: true, |
|
|
disabled: true, |
|
|
form: formik |
|
|
form: formik |
|
|
})} |
|
|
})} |
|
@@ -595,9 +586,9 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
</DialogContent> |
|
|
</DialogContent> |
|
|
<DialogActions> |
|
|
<DialogActions> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button onClick={() => setIsWarningPopUp(false)}> |
|
|
|
|
|
Close |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button onClick={() => setIsWarningPopUp(false)}> |
|
|
|
|
|
Close |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</DialogActions> |
|
|
</DialogActions> |
|
|
</Dialog> |
|
|
</Dialog> |
|
@@ -620,12 +611,12 @@ const UserInformationCard_Organization = ({ userData, loadDataFun, orgData }) => |
|
|
</DialogContent> |
|
|
</DialogContent> |
|
|
<DialogActions> |
|
|
<DialogActions> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<ThemeProvider theme={PNSPS_BUTTON_THEME}> |
|
|
<Button onClick={() => { setIsConfirmPopUp(false) }}> |
|
|
|
|
|
Close |
|
|
|
|
|
</Button> |
|
|
|
|
|
<Button onClick={() => { confirmAction?.function(); }}> |
|
|
|
|
|
Confirm |
|
|
|
|
|
</Button> |
|
|
|
|
|
|
|
|
<Button onClick={() => { setIsConfirmPopUp(false) }}> |
|
|
|
|
|
Close |
|
|
|
|
|
</Button> |
|
|
|
|
|
<Button onClick={() => { confirmAction?.function(); }}> |
|
|
|
|
|
Confirm |
|
|
|
|
|
</Button> |
|
|
</ThemeProvider> |
|
|
</ThemeProvider> |
|
|
</DialogActions> |
|
|
</DialogActions> |
|
|
</Dialog> |
|
|
</Dialog> |
|
|