@@ -36,7 +36,7 @@ const AuthFooter = () => { | |||||
variant="subtitle2" | variant="subtitle2" | ||||
color="secondary" | color="secondary" | ||||
component={Link} | component={Link} | ||||
href="https://www.gld.gov.hk/zh-hk/privacy-policy/" | |||||
href="/privacyPolicy" | |||||
//href="/testMailPage" | //href="/testMailPage" | ||||
target="_blank" | target="_blank" | ||||
underline="hover" | underline="hover" | ||||
@@ -78,9 +78,10 @@ function Header(props) { | |||||
}; | }; | ||||
const handleLogout = async () => { | const handleLogout = async () => { | ||||
dispatch(handleLogoutFunction()); | |||||
await dispatch(handleLogoutFunction()); | |||||
//await handleLogoutFunction(); | //await handleLogoutFunction(); | ||||
navigate('/login'); | |||||
await navigate('/login'); | |||||
}; | }; | ||||
const loginContent = ( | const loginContent = ( | ||||
@@ -60,8 +60,11 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => { | |||||
enableReinitialize: true, | enableReinitialize: true, | ||||
initialValues: currentUserData, | initialValues: currentUserData, | ||||
validationSchema: yup.object().shape({ | validationSchema: yup.object().shape({ | ||||
enName: yup.string().max(40, getMaxErrStr(40)).required(intl.formatMessage({ id: 'userRequireEnglishName' })), | |||||
chName: yup.string().max(6, getMaxErrStr(6)).required(intl.formatMessage({ id: 'userRequireChineseName' })), | |||||
enName: yup.string().max(40, getMaxErrStr(40)).when('chName', { | |||||
is: (chName) => chName?false:true, | |||||
then: yup.string().required(intl.formatMessage({ id: 'userRequireEnglishName' })) | |||||
}).nullable(), | |||||
chName: yup.string().max(6, getMaxErrStr(6)).nullable(), | |||||
addressLine1: yup.string().max(40, getMaxErrStr(40)).required(intl.formatMessage({ id: 'validateAddressLine1' })), | addressLine1: yup.string().max(40, getMaxErrStr(40)).required(intl.formatMessage({ id: 'validateAddressLine1' })), | ||||
addressLine2: yup.string().max(40, getMaxErrStr(40)).nullable(), | addressLine2: yup.string().max(40, getMaxErrStr(40)).nullable(), | ||||
addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(), | addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(), | ||||
@@ -66,8 +66,11 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => { | |||||
enableReinitialize: true, | enableReinitialize: true, | ||||
initialValues: currentUserData, | initialValues: currentUserData, | ||||
validationSchema: yup.object().shape({ | validationSchema: yup.object().shape({ | ||||
enName: yup.string().max(40, getMaxErrStr(40)).required(intl.formatMessage({id: 'userRequireEnglishName'})), | |||||
chName: yup.string().max(6, getMaxErrStr(6)).required(intl.formatMessage({id: 'userRequireChineseName'})), | |||||
enName: yup.string().max(40, getMaxErrStr(40)).when('chName', { | |||||
is: (chName) => chName?false:true, | |||||
then: yup.string().required(intl.formatMessage({ id: 'userRequireEnglishName' })) | |||||
}).nullable(), | |||||
chName: yup.string().max(6, getMaxErrStr(6)).nullable(), | |||||
addressLine1: yup.string().max(40).required(intl.formatMessage({id: 'validateAddressLine1'})), | addressLine1: yup.string().max(40).required(intl.formatMessage({id: 'validateAddressLine1'})), | ||||
addressLine2: yup.string().max(40).nullable(), | addressLine2: yup.string().max(40).nullable(), | ||||
addressLine3: yup.string().max(40).nullable(), | addressLine3: yup.string().max(40).nullable(), | ||||
@@ -0,0 +1,78 @@ | |||||
import { Grid,Typography, Stack, } from '@mui/material'; | |||||
import { useState, useEffect, lazy } from "react"; | |||||
import * as HttpUtils from "utils/HttpUtils"; | |||||
import { PRIVACY_POLICY_PATH } from "utils/ApiPathConst"; | |||||
import Loadable from 'components/Loadable'; | |||||
import { useIntl, FormattedMessage } from "react-intl"; | |||||
import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' | |||||
const BackgroundHead = { | |||||
backgroundImage: `url(${titleBackgroundImg})`, | |||||
width: '100%', | |||||
height: '100%', | |||||
backgroundSize: 'contain', | |||||
backgroundRepeat: 'no-repeat', | |||||
backgroundColor: '#0C489E', | |||||
backgroundPosition: 'right' | |||||
} | |||||
const LoadingComponent = Loadable(lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||||
const PrivacyPolicy = () => { | |||||
const intl = useIntl(); | |||||
const { locale } = intl; | |||||
const [onReady, setOnReady] = useState(false); | |||||
const [record, setRecord] = useState({}); | |||||
const [content, setContent] = useState(""); | |||||
useEffect(() => { | |||||
setOnReady(true); | |||||
HttpUtils.get({ | |||||
url: PRIVACY_POLICY_PATH, | |||||
onSuccess: (responseData) => { | |||||
setRecord(responseData); | |||||
} | |||||
}); | |||||
}, []); | |||||
useEffect(() => { | |||||
if (locale === 'zh-CN') { | |||||
setContent(record.cn); | |||||
} else if (locale === 'zh-HK') { | |||||
setContent(record.zh); | |||||
} else { | |||||
setContent(record.en); | |||||
} | |||||
}, [locale, record]); | |||||
return ( | |||||
!onReady ? | |||||
<Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | |||||
<Grid item> | |||||
<LoadingComponent /> | |||||
</Grid> | |||||
</Grid> | |||||
: | |||||
( | |||||
<Grid container justifyContent="center" alignItems="center" > | |||||
<Grid item xs={12}> | |||||
<div style={BackgroundHead}> | |||||
<Stack direction="row" height='70px' justifyContent="flex-start" alignItems="center"> | |||||
<Typography ml={15} color='#FFF' variant="h4" sx={{ display: { xs: 'none', sm: 'none', md: 'block', pt: 2 } }}> | |||||
<FormattedMessage id="privacyPolicy" /> | |||||
</Typography> | |||||
</Stack> | |||||
</div> | |||||
</Grid> | |||||
<Grid item xs={10} md={5}> | |||||
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: content }} /> | |||||
</Grid> | |||||
</Grid> | |||||
) | |||||
); | |||||
} | |||||
export default PrivacyPolicy; |
@@ -12,6 +12,7 @@ const RegisterForm = Loadable(lazy(() => import('pages/authentication/Register') | |||||
const BusRegisterForm = Loadable(lazy(() => import('pages/authentication/BusRegister'))); | const BusRegisterForm = Loadable(lazy(() => import('pages/authentication/BusRegister'))); | ||||
const IAmSmartRegister = Loadable(lazy(() => import('pages/authentication/IAmSmartRegister'))); | const IAmSmartRegister = Loadable(lazy(() => import('pages/authentication/IAmSmartRegister'))); | ||||
const ErrorPage = Loadable(lazy(() => import('pages/extra-pages/ErrorPage'))); | const ErrorPage = Loadable(lazy(() => import('pages/extra-pages/ErrorPage'))); | ||||
const PrivacyPolicyPage = Loadable(lazy(() => import('pages/extra-pages/PrivacyPolicy'))); | |||||
const ForgotPassword = Loadable(lazy(() => import('pages/authentication/ForgotPassword'))); | const ForgotPassword = Loadable(lazy(() => import('pages/authentication/ForgotPassword'))); | ||||
const AfterForgotPasswordPage = Loadable(lazy(() => import('pages/authentication/ForgotPassword/AfterForgotPasswordPage'))); | const AfterForgotPasswordPage = Loadable(lazy(() => import('pages/authentication/ForgotPassword/AfterForgotPasswordPage'))); | ||||
@@ -65,6 +66,10 @@ const LoginRoutes = { | |||||
path: 'error', | path: 'error', | ||||
element: <ErrorPage/> | element: <ErrorPage/> | ||||
}, | }, | ||||
{ | |||||
path: 'privacyPolicy', | |||||
element: <PrivacyPolicyPage/> | |||||
}, | |||||
{ | { | ||||
path: 'iamsmart/logincallback', | path: 'iamsmart/logincallback', | ||||
element: <IAmSmart_DirectLoginCallback/> | element: <IAmSmart_DirectLoginCallback/> | ||||
@@ -8,6 +8,7 @@ export const REFRESH_TOKEN = "/refresh-token" | |||||
export const CHANGE_PASSWORD_PATH = "/user/change-password" | export const CHANGE_PASSWORD_PATH = "/user/change-password" | ||||
export const GET_SYS_PARAMS = apiPath+'/settings'; | export const GET_SYS_PARAMS = apiPath+'/settings'; | ||||
export const PRIVACY_POLICY_PATH = apiPath+'/privacyPolicy'; | |||||
//Group Config | //Group Config | ||||
export const GET_GROUP_LIST_PATH = apiPath+'/group'; | export const GET_GROUP_LIST_PATH = apiPath+'/group'; | ||||