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