| @@ -48,7 +48,8 @@ import { | |||
| isCreditorLoggedIn, | |||
| isINDLoggedIn, | |||
| isPasswordExpiry, | |||
| // isORGLoggedIn, | |||
| haveOrgPaymentRecord, | |||
| isORGLoggedIn, | |||
| // getUserId | |||
| } from "utils/Utils"; | |||
| import { handleLogoutFunction } from 'auth/index'; | |||
| @@ -343,30 +344,45 @@ function Header(props) { | |||
| </li> | |||
| <li> | |||
| {isCreditorLoggedIn() ? | |||
| <> | |||
| <Link className="paymentRecord"> | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentHistory" /> | |||
| </Typography> | |||
| <KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} /> | |||
| </Link> | |||
| <ul className='dropdown'> | |||
| <li> | |||
| <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="onlinePaymentHistory" /> | |||
| </Typography></Link> | |||
| </li> | |||
| <li> | |||
| <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentInfoRecord" /> | |||
| </Typography></Link> | |||
| </li> | |||
| </ul> | |||
| </> | |||
| haveOrgPaymentRecord()? | |||
| <> | |||
| <Link className="paymentRecord"> | |||
| <Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentHistory" /> | |||
| </Typography> | |||
| <KeyboardArrowDownIcon sx={{ fontSize: '1.0rem' }} /> | |||
| </Link> | |||
| <ul className='dropdown'> | |||
| <li> | |||
| <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="onlinePaymentHistory" /> | |||
| </Typography></Link> | |||
| </li> | |||
| <li> | |||
| <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentInfoRecord" /> | |||
| </Typography></Link> | |||
| </li> | |||
| </ul> | |||
| </> | |||
| : | |||
| <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentInfoRecord" /> | |||
| </Typography></Link> | |||
| : | |||
| isORGLoggedIn()? | |||
| haveOrgPaymentRecord()? | |||
| <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="onlinePaymentHistory" /> | |||
| </Typography></Link> | |||
| : | |||
| <Link className="manageOrgUser" to='/paymentPage/demandNote'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="paymentInfoRecord" /> | |||
| </Typography></Link> | |||
| : | |||
| <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="onlinePaymentHistory" /> | |||
| </Typography></Link> | |||
| <Link className="manageOrgUser" to='/paymentPage/search'><Typography style={{ opacity: 0.9 }} variant={"pnspsHeaderTitle"} sx={{ ml: 1 }}> | |||
| <FormattedMessage id="onlinePaymentHistory" /> | |||
| </Typography></Link> | |||
| } | |||
| </li> | |||
| <li> | |||
| @@ -111,7 +111,7 @@ export default function OrganizationTable({ searchCriteria }) { | |||
| <div style={{ height: "fit-content", width: '100%' }}> | |||
| <FiDataGrid | |||
| columns={columns} | |||
| customPageSize={5} | |||
| customPageSize={10} | |||
| onRowDoubleClick={handleRowDoubleClick} | |||
| doLoad={{ | |||
| url: GET_ORG_PATH, | |||
| @@ -134,7 +134,7 @@ export default function UserTable({searchCriteria}) { | |||
| <div style={{height: "fit-content", width: '100%'}}> | |||
| <FiDataGrid | |||
| columns={columns} | |||
| customPageSize={5} | |||
| customPageSize={10} | |||
| onRowDoubleClick={handleRowDoubleClick} | |||
| getRowHeight={() => 'auto'} | |||
| doLoad={{ | |||
| @@ -84,6 +84,7 @@ const AuthLogin = () => { | |||
| role: response.data.role, | |||
| abilities: response.data.abilities, | |||
| passwordExpiryDate: response.data.passwordExpiryDate, | |||
| orgPaymentRecord: response.data.orgPaymentRecord, | |||
| //avatar: require('src/assets/images/users/avatar-3.png').default, | |||
| } | |||
| // const abilities = response.data.abilities | |||
| @@ -94,6 +94,7 @@ const AuthLoginCustom = () => { | |||
| creditor: response.data.creditor, | |||
| locale: response.data.preferLocale, | |||
| passwordExpiryDate: response.data.passwordExpiryDate, | |||
| orgPaymentRecord: response.data.orgPaymentRecord, | |||
| //avatar: require('src/assets/images/users/avatar-3.png').default, | |||
| } | |||
| const data = { ...userData, accessToken: response.data.accessToken, refreshToken: response.data.refreshToken } | |||
| @@ -59,6 +59,8 @@ import {FormattedMessage, useIntl} from "react-intl"; | |||
| const BusCustomFormWizard = (props) => { | |||
| const intl = useIntl(); | |||
| const { locale } = intl; | |||
| const theme = useTheme() | |||
| const [level, setLevel] = useState(); | |||
| const [showPassword, setShowPassword] = useState(false); | |||
| @@ -367,6 +369,7 @@ const BusCustomFormWizard = (props) => { | |||
| tncFlag = false | |||
| } | |||
| const preferLocale = locale === 'en' ? 'en': locale === 'zh-HK' ? 'zh_HK': 'zh-CN' | |||
| const user = { | |||
| username: values.username, | |||
| password: values.password, | |||
| @@ -380,7 +383,8 @@ const BusCustomFormWizard = (props) => { | |||
| tncFlag: tncFlag, | |||
| type: "ORG", | |||
| captcha: base64Url, | |||
| checkCode: checkCode | |||
| checkCode: checkCode, | |||
| preferLocale:preferLocale | |||
| }; | |||
| var formData = new FormData(); | |||
| @@ -53,8 +53,9 @@ import * as HttpUtils from "../../../utils/HttpUtils"; | |||
| // ============================|| FIREBASE - REGISTER ||============================ // | |||
| const CustomFormWizard = (props) => { | |||
| const intl = useIntl(); | |||
| const { locale } = intl; | |||
| const theme = useTheme() | |||
| const [level, setLevel] = useState(); | |||
| const [showPassword, setShowPassword] = useState(false); | |||
| @@ -363,6 +364,7 @@ const CustomFormWizard = (props) => { | |||
| tncFlag = false | |||
| } | |||
| const preferLocale = locale === 'en' ? 'en': locale === 'zh-HK' ? 'zh_HK': 'zh-CN' | |||
| const user = { | |||
| username: values.username, | |||
| password: values.password, | |||
| @@ -376,7 +378,8 @@ const CustomFormWizard = (props) => { | |||
| tncFlag: tncFlag, | |||
| type: "IND", | |||
| captcha: base64Url, | |||
| checkCode: checkCode | |||
| checkCode: checkCode, | |||
| preferLocale: preferLocale | |||
| }; | |||
| var formData = new FormData(); | |||
| @@ -47,6 +47,7 @@ const CustomFormWizard = (props) => { | |||
| const location = useLocation(); | |||
| const theme = useTheme(); | |||
| const intl = useIntl(); | |||
| const { locale } = intl; | |||
| const [iAmSmartData, setIAmSmartData] = useState({}); | |||
| @@ -321,6 +322,7 @@ const CustomFormWizard = (props) => { | |||
| tncFlag = false | |||
| } | |||
| const preferLocale = locale === 'en' ? 'en': locale === 'zh-HK' ? 'zh_HK': 'zh-CN' | |||
| const formData = { | |||
| enName: iAmSmartData.enName, | |||
| chName: iAmSmartData.chName, | |||
| @@ -334,7 +336,8 @@ const CustomFormWizard = (props) => { | |||
| userMobileNumber: JSON.stringify(userMobileNumber), | |||
| userAddress: JSON.stringify(userAddress), | |||
| captcha: base64Url, | |||
| checkCode: checkCode | |||
| checkCode: checkCode, | |||
| preferLocale:preferLocale | |||
| }; | |||
| if (isValid) { | |||
| @@ -46,6 +46,7 @@ const Index = () => { | |||
| abilities: responseData.abilities, | |||
| creditor: responseData.creditor, | |||
| passwordExpiryDate: response.data.passwordExpiryDate, | |||
| orgPaymentRecord: response.data.orgPaymentRecord, | |||
| //locale: responseData.preferLocale, | |||
| //avatar: require('src/assets/images/users/avatar-3.png').default, | |||
| } | |||
| @@ -46,6 +46,7 @@ const Index = () => { | |||
| abilities: responseData.abilities, | |||
| creditor: responseData.creditor, | |||
| passwordExpiryDate: response.data.passwordExpiryDate, | |||
| orgPaymentRecord: response.data.orgPaymentRecord, | |||
| //avatar: require('src/assets/images/users/avatar-3.png').default, | |||
| } | |||
| const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken } | |||
| @@ -94,6 +94,11 @@ export const isDummyLoggedIn = () =>{ | |||
| if (localStorage.getItem('userData') != null){ | |||
| return JSON.parse(localStorage.getItem('userData')).role === 'dummy' | |||
| } | |||
| } | |||
| export const haveOrgPaymentRecord = () =>{ | |||
| if (localStorage.getItem('userData') != null){ | |||
| return JSON.parse(localStorage.getItem('userData')).orgPaymentRecord | |||
| } | |||
| } | |||
| /** | |||
| ** This function is used for demo purpose route navigation | |||