From d6fca0218ae5ef224918be613fedfdaf14d1a1a9 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 10 Nov 2023 15:42:38 +0800 Subject: [PATCH 1/9] update --- src/pages/authentication/Verify.js | 74 +++++++++++++++++++ .../auth-forms/PasswordAlertDialog.js | 67 +++++++++-------- src/routes/LoginRoutes.js | 5 ++ src/utils/ApiPathConst.js | 1 + 4 files changed, 116 insertions(+), 31 deletions(-) create mode 100644 src/pages/authentication/Verify.js diff --git a/src/pages/authentication/Verify.js b/src/pages/authentication/Verify.js new file mode 100644 index 0000000..dbcd8aa --- /dev/null +++ b/src/pages/authentication/Verify.js @@ -0,0 +1,74 @@ +// material-ui +import { Button, Grid } from '@mui/material'; +import { Link } from 'react-router-dom'; +import Typography from '@mui/material/Typography'; +// import iAmSmartICon from 'assets/images/icons/icon_iAmSmart.png'; +// import banner from 'assets/images/bg_ml.jpg'; +import { Stack } from '../../../node_modules/@mui/material/index'; +import { useEffect, useState } from 'react'; +import { useParams } from 'react-router-dom'; +import axios from 'axios'; +import { GET_VERIFY_USER_ACCOUNT } from 'utils/ApiPathConst'; +import Loadable from 'components/Loadable'; +import { lazy } from 'react'; + +const LoadingComponent = Loadable(lazy(() => import('../extra-pages/LoadingComponent'))); +const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); +import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; +import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; + +export default function Verify() { + + const [isLoading, setIsLoading] = useState(true) + const [verifyState, setVerifyState] = useState(null) + + const params = useParams() + const handleVerify = async () => { + const response = await axios.get(GET_VERIFY_USER_ACCOUNT, { + params: { + email: decodeURIComponent(params.email), + emailVerifyHash: decodeURIComponent(params.verifyCode) + } + }) + if (response.status === 200 && response.data) { + setVerifyState(true) + } else { + setVerifyState(false) + } + setIsLoading(false) + } + + let enterUseEffect = false + useEffect(() => { + if (enterUseEffect) handleVerify() + enterUseEffect = true + }, []) + + return ( + + + {isLoading || verifyState == null ? + : + + {verifyState ? + // SUCCESS page + + + 帳戶已成功驗證。 + + + : + // ERROR page + + {/* */} + + 驗證失敗,請聯絡相關的系統管理員協助。 + + + } + + } + + + ) +} \ No newline at end of file diff --git a/src/pages/authentication/auth-forms/PasswordAlertDialog.js b/src/pages/authentication/auth-forms/PasswordAlertDialog.js index 60ef811..adea767 100644 --- a/src/pages/authentication/auth-forms/PasswordAlertDialog.js +++ b/src/pages/authentication/auth-forms/PasswordAlertDialog.js @@ -18,42 +18,47 @@ import { import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; const PasswordAlertDialog = (props) => { + console.log(props) return ( - - - - - {props.errorMassage==='ACCOUNT_LOCKED_ERROR'? - - - 帳戶將被封鎖 - - - 帳戶連續五次登入錯誤,請與系統管理員聯絡 - - : - - 用戶名或密碼錯誤 - - } - - - - - {""} - - - - - - + > + + + + {props.errorMassage === 'ACCOUNT_LOCKED_ERROR' ? + + + 帳戶將被封鎖 + + + 帳戶連續五次登入錯誤,請與系統管理員聯絡 + + : + props.errorMassage === 'ACCOUNT_VERIFIED_ERROR' ? + + 帳戶尚未驗證 + : + + 用戶名或密碼錯誤 + + } + + + + + {""} + + + + + + ); }; diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index a7b48af..30052b9 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 ErrorPage = Loadable(lazy(() => import('pages/extra-pages/ErrorPage'))); const TestMailPage = Loadable(lazy(() => import('pages/pnspsNotifyTest'))); +const VerifyPage = Loadable(lazy(() => import('pages/authentication/Verify'))); // ==============================|| AUTH ROUTING ||============================== // @@ -42,6 +43,10 @@ const LoginRoutes = { { path: 'testMailPage', element: + }, + { + path: 'verify/:verifyCode/:email', + element: } ] }; diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index b6523a6..b90fce1 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -45,6 +45,7 @@ export const POST_CAPTCHA = apiPath+'/captcha'; export const POST_PUBLIC_USER_REGISTER = apiPath+'/user/register'; export const GET_USERNAME = apiPath+'/user/username'; export const GET_USER_EMAIL = apiPath+'/user/email'; +export const GET_VERIFY_USER_ACCOUNT = apiPath+'/user/verifyEmail'; //Public export const GET_PUBLIC_ORG_USER_LIST = apiPath+'/user/listOrg'; From 3dbd0b30dcac6f93d5b37dfb1d3a396d0fc80ecd Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 10 Nov 2023 16:15:39 +0800 Subject: [PATCH 2/9] update --- src/pages/authentication/auth-forms/PasswordAlertDialog.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/authentication/auth-forms/PasswordAlertDialog.js b/src/pages/authentication/auth-forms/PasswordAlertDialog.js index adea767..33b83b3 100644 --- a/src/pages/authentication/auth-forms/PasswordAlertDialog.js +++ b/src/pages/authentication/auth-forms/PasswordAlertDialog.js @@ -18,7 +18,6 @@ import { import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; const PasswordAlertDialog = (props) => { - console.log(props) return ( Date: Fri, 10 Nov 2023 16:16:25 +0800 Subject: [PATCH 3/9] update --- src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js index e7ab1b8..35540bd 100644 --- a/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js +++ b/src/pages/PublicNotice/ApplyForm/PublicNoticeApplyForm.js @@ -90,7 +90,7 @@ const PublicNoticeApplyForm = ({ loadedData, selections }) => { }, files: [attachment], onSuccess: function () { - notifyActionSuccess('申請成功!') + notifyActionSuccess('申請提交成功!') navigate("/publicNotice"); // location.reload(); } From 605c115d48807f6ae460fd2df16827e9dab686c6 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 10 Nov 2023 16:33:40 +0800 Subject: [PATCH 4/9] update --- src/pages/Proof/Reply_Public/ApplicationDetails.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 7ffa56c..71996ef 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -204,19 +204,20 @@ const ApplicationDetailCard = ({ formData, }) => { - 繳費及返稿最後限期: + 繳費及返稿最後限期: - {DateUtils.dateStr_Cht(data.returnBeforeDate)} 下午 2:00前 +  {DateUtils.dateStr_Cht(data.returnBeforeDate)} 下午 2:00前 應繳費用: - {FormatUtils.currencyFormat(data.fee)} + {FormatUtils.currencyFormat(data.fee)} - + + { formik.values.groupType == "A" ? From 9ab48d256efe6aba446579f8f09f6444abd1f6cc Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 10 Nov 2023 17:13:12 +0800 Subject: [PATCH 5/9] update --- src/pages/Proof/Search_Public/DataGrid.js | 36 +++++++++---------- src/pages/Proof/Search_Public/SearchForm.js | 4 +-- .../Details_Public/ApplicationDetailCard.js | 6 ++-- src/pages/User/SearchPage/UserSearchForm.js | 2 +- .../UserSearchForm_Individual.js | 2 +- 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/pages/Proof/Search_Public/DataGrid.js b/src/pages/Proof/Search_Public/DataGrid.js index 96c2f33..76ffefc 100644 --- a/src/pages/Proof/Search_Public/DataGrid.js +++ b/src/pages/Proof/Search_Public/DataGrid.js @@ -37,7 +37,8 @@ export default function SearchPublicNoticeTable({ recordList }) { navigate('/proof/reply/' + params.row.id); }; - const getGroupTitle = (title) => { + /*eslint no-irregular-whitespace: ["error", { "skipComments": true }]*/ + /*const getGroupTitle = (title) => { switch (title) { case 'Private Bill': return "私人帳單"; @@ -52,9 +53,8 @@ export default function SearchPublicNoticeTable({ recordList }) { default: return title; } - } - - + }*/ + const columns = [ { field: 'actions', @@ -68,17 +68,17 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'appId', field: 'appId', - headerName: '申請編號 / 憲報編號 / 憲報期數', + headerName: '申請編號 / 憲報期數', flex: 1, renderCell: (params) => { let appNo = params.row.appNo; - let code = params.row.groupNo; + // let code = params.row.groupNo; let isssue = params.row.issueYear + " Vol. " + FormatUtils.zeroPad(params.row.issueVolume, 3) + ", No. " + FormatUtils.zeroPad(params.row.issueNo, 2) + ", " + DateUtils.dateFormat(params.row.issueDate, "D MMM YYYY (ddd)"); - return
{appNo}
{code}
{isssue}
+ return
{appNo}
{isssue}
}, }, { @@ -110,15 +110,15 @@ export default function SearchPublicNoticeTable({ recordList }) { return params?.value ? DateUtils.datetimeStr(params?.value) : ""; } }, - { - id: 'groupTitle', - field: 'groupTitle', - headerName: '憲報類型', - flex: 1, - valueGetter: (params) => { - return getGroupTitle(params?.value); - } - }, + // { + // id: 'groupTitle', + // field: 'groupTitle', + // headerName: '憲報類型', + // flex: 1, + // valueGetter: (params) => { + // return getGroupTitle(params?.value); + // } + // }, { id: 'fee', field: 'fee', @@ -147,9 +147,9 @@ export default function SearchPublicNoticeTable({ recordList }) { paginationModel: { page: 0, pageSize: 10 }, }, }} - getRowHeight={()=>"auto"} + getRowHeight={() => "auto"} onRowDoubleClick={handleRowDoubleClick} /> ); -} +} \ No newline at end of file diff --git a/src/pages/Proof/Search_Public/SearchForm.js b/src/pages/Proof/Search_Public/SearchForm.js index 422cfca..412f291 100644 --- a/src/pages/Proof/Search_Public/SearchForm.js +++ b/src/pages/Proof/Search_Public/SearchForm.js @@ -154,7 +154,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, issueComboData />
- + {/* )} /> - + */} - + - + @@ -493,7 +494,6 @@ const ApplicationDetailCard = ( diff --git a/src/themes/index.js b/src/themes/index.js index 728f01a..22ee02a 100644 --- a/src/themes/index.js +++ b/src/themes/index.js @@ -17,7 +17,7 @@ export default function ThemeCustomization({ children }) { const theme = Palette('light', 'default'); // eslint-disable-next-line react-hooks/exhaustive-deps - const themeTypography = Typography(`微軟正黑體`); + const themeTypography = Typography(``); const themeCustomShadows = useMemo(() => CustomShadows(theme), [theme]); const themeOptions = useMemo( From dc287a03739bfb541ce9d9c14ab4f6b1e33b5340 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 10 Nov 2023 18:09:28 +0800 Subject: [PATCH 7/9] update --- src/assets/style/navbarStyles.css | 10 +++++----- .../MainLayout/Header/HeaderContent/Profile/index.js | 4 ++-- src/pages/authentication/AuthWrapper.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/assets/style/navbarStyles.css b/src/assets/style/navbarStyles.css index be5f102..d71cd84 100644 --- a/src/assets/style/navbarStyles.css +++ b/src/assets/style/navbarStyles.css @@ -26,7 +26,7 @@ text-decoration: none; font-size: 1.2rem; font-weight: 600; - font-family: 微軟正黑體; + /* font-family: 微軟正黑體; */ color: black; transition: 0.3s ease-in-out; } @@ -76,7 +76,7 @@ font-weight: 600; color: #0C489E; transition: 0.3s ease-in-out; - font-family: 微軟正黑體; + /* font-family: 微軟正黑體; */ text-align: center; } #mobileTitle{ @@ -85,13 +85,13 @@ font-weight: 600; color: #0C489E; transition: 0.3s ease-in-out; - font-family: 微軟正黑體; + /* font-family: 微軟正黑體; */ text-align: center; } #sidebar{ font-size: 1.3rem; font-weight: 600; - font-family: 微軟正黑體; + /* font-family: 微軟正黑體; */ } #sidebartop{ align-items: center; @@ -115,7 +115,7 @@ text-decoration: none; font-size: 1.3rem; font-weight: 600; - font-family: 微軟正黑體; + /* font-family: 微軟正黑體; */ color: black; transition: 0.3s ease-in-out; } diff --git a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js index 239eda5..aa5e13c 100644 --- a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js +++ b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js @@ -109,7 +109,7 @@ const Profile = () => { > - {userData == null ? "" : (userData.fullenName?userData.fullenName: userData.fullchName)} + {userData == null ? "" : (userData.fullenName?userData.fullenName: userData.fullchName)} { - {userData == null ? "" : (userData.fullenName?userData.fullenName: userData.fullchName)} + {userData == null ? "" : (userData.fullenName?userData.fullenName: userData.fullchName)} {/* {userData == null ? "" : userData.fullenName} */} diff --git a/src/pages/authentication/AuthWrapper.js b/src/pages/authentication/AuthWrapper.js index fe37dd3..2b18b90 100644 --- a/src/pages/authentication/AuthWrapper.js +++ b/src/pages/authentication/AuthWrapper.js @@ -44,8 +44,8 @@ const AuthWrapper = ({ children }) => ( alignItems="center" spacing={2}> - 香港特別行政區政府 - 憲報 + 香港特別行政區政府 + 憲報 Date: Mon, 13 Nov 2023 11:31:10 +0800 Subject: [PATCH 8/9] Squashed commit of the following: commit 605c115d48807f6ae460fd2df16827e9dab686c6 Author: cyril.tsui Date: Fri Nov 10 16:33:40 2023 +0800 update commit 4ac2c961276ca1aff05853188c0de9203c60a0a4 Merge: d89d1be 3dbd0b3 Author: Jason Date: Fri Nov 10 16:16:27 2023 +0800 Merge branch 'master' of https://git.2fi-solutions.com/alex/PNSPS-frontend-MaterialUI commit d89d1be964dedda24cf88c1a41f6a0513442661b Author: Jason Date: Fri Nov 10 16:16:25 2023 +0800 update commit 3dbd0b30dcac6f93d5b37dfb1d3a396d0fc80ecd Author: cyril.tsui Date: Fri Nov 10 16:15:39 2023 +0800 update commit d6fca0218ae5ef224918be613fedfdaf14d1a1a9 Author: cyril.tsui Date: Fri Nov 10 15:42:38 2023 +0800 update --- src/pages/Proof/Create_FromApp/ProofForm.js | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/pages/Proof/Create_FromApp/ProofForm.js b/src/pages/Proof/Create_FromApp/ProofForm.js index fb40ee1..c89d34e 100644 --- a/src/pages/Proof/Create_FromApp/ProofForm.js +++ b/src/pages/Proof/Create_FromApp/ProofForm.js @@ -10,6 +10,7 @@ import { FormLabel, Button } from '@mui/material'; + import * as UrlUtils from "utils/ApiPathConst"; import * as HttpUtils from "utils/HttpUtils"; import MainCard from "components/MainCard"; @@ -20,8 +21,6 @@ import { useNavigate } from "react-router-dom"; import Loadable from 'components/Loadable'; import { notifySaveSuccess } from 'utils/CommonFunction'; const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); -// ==============================|| DASHBOARD - DEFAULT ||============================== // - const FormPanel = ({ formData }) => { @@ -239,9 +238,12 @@ const FormPanel = ({ formData }) => { size="small" type="text" onChange={(event) => { - const value = event.target.value; - formik.setFieldValue("length", value); - formik.setFieldValue("fee", 6552 * value); + const re = /^[0-9\b]+$/; + if (event.target.value === '' || re.test(event.target.value)) { + const value = event.target.value; + formik.setFieldValue("length", value); + formik.setFieldValue("fee", 6552 * value); + } }} name="noOfPages" value={formik.values["noOfPages"]} @@ -275,9 +277,13 @@ const FormPanel = ({ formData }) => { size="small" type="text" onChange={(event) => { - const value = event.target.value; - formik.setFieldValue("length", value); - formik.setFieldValue("fee", columnPrice.value * value); + const re = /^[0-9\b]+$/; + if (event.target.value === '' || re.test(event.target.value)) { + const value = event.target.value; + formik.setFieldValue("length", value); + formik.setFieldValue("fee", columnPrice.value * value); + } + }} name="length" value={formik.values["length"]} From 4d011be4d8d4a1081711f3c808a3963a5fdd02e6 Mon Sep 17 00:00:00 2001 From: anna Date: Mon, 13 Nov 2023 12:26:00 +0800 Subject: [PATCH 9/9] update ui --- src/pages/Proof/Create_FromApp/ProofForm.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/Proof/Create_FromApp/ProofForm.js b/src/pages/Proof/Create_FromApp/ProofForm.js index c89d34e..10a09c1 100644 --- a/src/pages/Proof/Create_FromApp/ProofForm.js +++ b/src/pages/Proof/Create_FromApp/ProofForm.js @@ -245,8 +245,6 @@ const FormPanel = ({ formData }) => { formik.setFieldValue("fee", 6552 * value); } }} - name="noOfPages" - value={formik.values["noOfPages"]} variant="outlined" sx={ {