浏览代码

Merge branch 'New_Enhancement' of https://git.2fi-solutions.com/alex/PNSPS-frontend-MaterialUI into New_Enhancement

CR003
Jason Chuang 1年前
父节点
当前提交
1eed4d7f3d
共有 11 个文件被更改,包括 65 次插入30 次删除
  1. +40
    -24
      src/layout/MainLayout/Header/index.js
  2. +1
    -1
      src/pages/Organization/SearchPage/OrganizationTable.js
  3. +1
    -1
      src/pages/User/SearchPage/UserTable.js
  4. +1
    -0
      src/pages/authentication/auth-forms/AuthLogin.js
  5. +1
    -0
      src/pages/authentication/auth-forms/AuthLoginCustom.js
  6. +5
    -1
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  7. +5
    -2
      src/pages/authentication/auth-forms/CustomFormWizard.js
  8. +4
    -1
      src/pages/authentication/auth-forms/IAmSmartFormWizard.js
  9. +1
    -0
      src/pages/iAmSmart/AuthCallback/index.js
  10. +1
    -0
      src/pages/iAmSmart/DirectLoginCallback/index.js
  11. +5
    -0
      src/utils/Utils.js

+ 40
- 24
src/layout/MainLayout/Header/index.js 查看文件

@@ -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>


+ 1
- 1
src/pages/Organization/SearchPage/OrganizationTable.js 查看文件

@@ -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,


+ 1
- 1
src/pages/User/SearchPage/UserTable.js 查看文件

@@ -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={{


+ 1
- 0
src/pages/authentication/auth-forms/AuthLogin.js 查看文件

@@ -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


+ 1
- 0
src/pages/authentication/auth-forms/AuthLoginCustom.js 查看文件

@@ -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 }


+ 5
- 1
src/pages/authentication/auth-forms/BusCustomFormWizard.js 查看文件

@@ -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();


+ 5
- 2
src/pages/authentication/auth-forms/CustomFormWizard.js 查看文件

@@ -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();


+ 4
- 1
src/pages/authentication/auth-forms/IAmSmartFormWizard.js 查看文件

@@ -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) {


+ 1
- 0
src/pages/iAmSmart/AuthCallback/index.js 查看文件

@@ -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,
} }


+ 1
- 0
src/pages/iAmSmart/DirectLoginCallback/index.js 查看文件

@@ -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 }


+ 5
- 0
src/utils/Utils.js 查看文件

@@ -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


正在加载...
取消
保存