Bläddra i källkod

fix preferLocale and add orgPaymentRecord for org check online payment record

CR003
Alex Cheung 1 år sedan
förälder
incheckning
b8b843aae2
11 ändrade filer med 65 tillägg och 30 borttagningar
  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 Visa fil

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


+ 1
- 1
src/pages/Organization/SearchPage/OrganizationTable.js Visa fil

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


+ 1
- 1
src/pages/User/SearchPage/UserTable.js Visa fil

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


+ 1
- 0
src/pages/authentication/auth-forms/AuthLogin.js Visa fil

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


+ 1
- 0
src/pages/authentication/auth-forms/AuthLoginCustom.js Visa fil

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


+ 5
- 1
src/pages/authentication/auth-forms/BusCustomFormWizard.js Visa fil

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


+ 5
- 2
src/pages/authentication/auth-forms/CustomFormWizard.js Visa fil

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


+ 4
- 1
src/pages/authentication/auth-forms/IAmSmartFormWizard.js Visa fil

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


+ 1
- 0
src/pages/iAmSmart/AuthCallback/index.js Visa fil

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


+ 1
- 0
src/pages/iAmSmart/DirectLoginCallback/index.js Visa fil

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


+ 5
- 0
src/utils/Utils.js Visa fil

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


Laddar…
Avbryt
Spara