diff --git a/src/components/cards/AuthFooter.js b/src/components/cards/AuthFooter.js
index 46260c6..4a1cf3f 100644
--- a/src/components/cards/AuthFooter.js
+++ b/src/components/cards/AuthFooter.js
@@ -36,7 +36,7 @@ const AuthFooter = () => {
variant="subtitle2"
color="secondary"
component={Link}
- href="https://www.gld.gov.hk/zh-hk/privacy-policy/"
+ href="/privacyPolicy"
//href="/testMailPage"
target="_blank"
underline="hover"
diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js
index 308a259..5f675fa 100644
--- a/src/layout/MainLayout/Header/index.js
+++ b/src/layout/MainLayout/Header/index.js
@@ -78,9 +78,10 @@ function Header(props) {
};
const handleLogout = async () => {
- dispatch(handleLogoutFunction());
+ await dispatch(handleLogoutFunction());
//await handleLogoutFunction();
- navigate('/login');
+
+ await navigate('/login');
};
const loginContent = (
diff --git a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
index 076979c..f840521 100644
--- a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
+++ b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual.js
@@ -60,8 +60,11 @@ const UserInformationCard_Individual = ({ formData, loadDataFun }) => {
enableReinitialize: true,
initialValues: currentUserData,
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' })),
addressLine2: yup.string().max(40, getMaxErrStr(40)).nullable(),
addressLine3: yup.string().max(40, getMaxErrStr(40)).nullable(),
diff --git a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
index 24f7acf..86018de 100644
--- a/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
+++ b/src/pages/User/DetailsPage_Individual/UserInformationCard_Individual_Pub.js
@@ -66,8 +66,11 @@ const UserInformationCard_Individual_Pub = ({ formData, loadDataFun }) => {
enableReinitialize: true,
initialValues: currentUserData,
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'})),
addressLine2: yup.string().max(40).nullable(),
addressLine3: yup.string().max(40).nullable(),
diff --git a/src/pages/extra-pages/PrivacyPolicy.js b/src/pages/extra-pages/PrivacyPolicy.js
new file mode 100644
index 0000000..b2cd0c3
--- /dev/null
+++ b/src/pages/extra-pages/PrivacyPolicy.js
@@ -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 ?
+
+
+
+
+
+ :
+ (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ );
+
+}
+
+export default PrivacyPolicy;
\ No newline at end of file
diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js
index dd0467a..c846e1d 100644
--- a/src/routes/LoginRoutes.js
+++ b/src/routes/LoginRoutes.js
@@ -12,6 +12,7 @@ const RegisterForm = Loadable(lazy(() => import('pages/authentication/Register')
const BusRegisterForm = Loadable(lazy(() => import('pages/authentication/BusRegister')));
const IAmSmartRegister = Loadable(lazy(() => import('pages/authentication/IAmSmartRegister')));
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 AfterForgotPasswordPage = Loadable(lazy(() => import('pages/authentication/ForgotPassword/AfterForgotPasswordPage')));
@@ -65,6 +66,10 @@ const LoginRoutes = {
path: 'error',
element:
},
+ {
+ path: 'privacyPolicy',
+ element:
+ },
{
path: 'iamsmart/logincallback',
element:
diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js
index 531ddc8..0e8ccaf 100644
--- a/src/utils/ApiPathConst.js
+++ b/src/utils/ApiPathConst.js
@@ -8,6 +8,7 @@ export const REFRESH_TOKEN = "/refresh-token"
export const CHANGE_PASSWORD_PATH = "/user/change-password"
export const GET_SYS_PARAMS = apiPath+'/settings';
+export const PRIVACY_POLICY_PATH = apiPath+'/privacyPolicy';
//Group Config
export const GET_GROUP_LIST_PATH = apiPath+'/group';