diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 955ea10..308a259 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -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) {
  • {isCreditorLoggedIn() ? - <> - - - - - - - - + haveOrgPaymentRecord()? + <> + + + + + + +
      +
    • + + + +
    • +
    • + + + +
    • +
    + + : + + + + : + isORGLoggedIn()? + haveOrgPaymentRecord()? + + + + : + + + : - - - + + + }
  • diff --git a/src/pages/Organization/SearchPage/OrganizationTable.js b/src/pages/Organization/SearchPage/OrganizationTable.js index 662cca2..47b7b23 100644 --- a/src/pages/Organization/SearchPage/OrganizationTable.js +++ b/src/pages/Organization/SearchPage/OrganizationTable.js @@ -111,7 +111,7 @@ export default function OrganizationTable({ searchCriteria }) {
    'auto'} doLoad={{ diff --git a/src/pages/authentication/auth-forms/AuthLogin.js b/src/pages/authentication/auth-forms/AuthLogin.js index 5f710eb..3df24c7 100644 --- a/src/pages/authentication/auth-forms/AuthLogin.js +++ b/src/pages/authentication/auth-forms/AuthLogin.js @@ -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 diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index 8421fb5..4b97874 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -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 } diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 9fe444c..4a472c5 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -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(); diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index a30319c..acafb53 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -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(); diff --git a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js index 93dfd2b..b9103c0 100644 --- a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js +++ b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js @@ -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) { diff --git a/src/pages/iAmSmart/AuthCallback/index.js b/src/pages/iAmSmart/AuthCallback/index.js index 4a9602b..7fcd2a7 100644 --- a/src/pages/iAmSmart/AuthCallback/index.js +++ b/src/pages/iAmSmart/AuthCallback/index.js @@ -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, } diff --git a/src/pages/iAmSmart/DirectLoginCallback/index.js b/src/pages/iAmSmart/DirectLoginCallback/index.js index 8c76a2a..c23caa6 100644 --- a/src/pages/iAmSmart/DirectLoginCallback/index.js +++ b/src/pages/iAmSmart/DirectLoginCallback/index.js @@ -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 } diff --git a/src/utils/Utils.js b/src/utils/Utils.js index dba3845..66211bc 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -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