From 25fafe59dc71732f3bdecdaa2a646e6029a9a592 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 9 Jan 2024 14:23:19 +0800 Subject: [PATCH 1/8] fix bug --- .../auth-forms/IAmSmartFormWizard.js | 2 +- src/pages/iAmSmart/AuthCallback/index.js | 24 +++++++++---------- src/routes/LoginRoutes.js | 6 +---- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js index ee8f752..df10f15 100644 --- a/src/pages/authentication/auth-forms/IAmSmartFormWizard.js +++ b/src/pages/authentication/auth-forms/IAmSmartFormWizard.js @@ -83,7 +83,7 @@ const CustomFormWizard = (props) => { const responseToData = () => { //let rd = JSON.parse("{\"emailAddress\":\"test@gmail.com\",\"postalAddress\":{\"EngPremisesAddress\":{\"EngDistrict\":{\"DcDistrict\":\"KC\",\"Sub-district\":\"TSING YI\"},\"EngEstate\":{\"EstateName\":\"Cheung Hang Estate\",\"EngPhase\":{\"PhaseName\":\"N/A\"}},\"BuildingName\":\"Hang Lai House\",\"EngBlock\":{\"BlockDescriptor\":\"Block\",\"BlockNo\":\"2\"},\"Region\":\"NT\",\"EngStreet\":{\"StreetName\":\"Liu To Road\",\"BuildingNoFrom\":\"6\"},\"Eng3dAddress\":{\"EngFloor\":{\"FloorNum\":\"33\"},\"EngUnit\":{\"UnitDescriptor\":\"Room\",\"UnitNo\":\"3301\"}}}},\"mobileNumber\":{\"CountryCode\":\"852\",\"SubscriberNumber\":\"99999999\"},\"residentialAddress\":{\"ChiPremisesAddress\":{\"Chi3dAddress\":{\"ChiUnit\":{\"UnitDescriptor\":\"室\",\"UnitNo\":\"1010\"},\"ChiFloor\":{\"FloorNum\":\"10\"}},\"ChiBlock\":{\"BlockDescriptor\":\"座\",\"BlockNo\":\"2\"},\"BuildingName\":\"亨麗樓(第2座)\",\"ChiDistrict\":{\"DcDistrict\":\"KC\",\"Sub-district\":\"青衣\"},\"Region\":\"新界\",\"ChiEstate\":{\"EstateName\":\"長亨邨\"},\"ChiStreet\":{\"StreetName\":\"寮肚路\",\"BuildingNoFrom\":\"6\"}}},\"enName\":{\"UnstructuredName\":\"Testing Co One\"},\"idNo\":{\"Identification\":\"G561107\",\"CheckDigit\":\"4\"},\"chName\":{\"ChineseName\":\"測試商一\"}}"); - let rd = location.state?.responseData; + let rd = JSON.parse(location.state?.responseData.data); let data = { "enName": rd?.enName?.UnstructuredName ?? "", "chName": rd?.chName?.ChineseName ?? "", diff --git a/src/pages/iAmSmart/AuthCallback/index.js b/src/pages/iAmSmart/AuthCallback/index.js index 7716ad5..5f30bb6 100644 --- a/src/pages/iAmSmart/AuthCallback/index.js +++ b/src/pages/iAmSmart/AuthCallback/index.js @@ -18,10 +18,10 @@ const Index = () => { const navigate = useNavigate() React.useEffect(() => { - getPrfile(); + goLogin(); }, []); - function getPrfile(){ + function goLogin(){ dispatch(handleLogoutFunction()); let params = new URLSearchParams(window.location.search) @@ -32,10 +32,8 @@ const Index = () => { code: params.get("code") }, onSuccess: (responseData) => { - - //navigate('/iAmSmartRegisterFrom', { state: { responseData: responseData } }); - - console.log(response) + console.log("responseData"); + console.log(responseData); const userData = { id: responseData.id, fullenName: responseData.name, @@ -48,17 +46,17 @@ const Index = () => { //avatar: require('src/assets/images/users/avatar-3.png').default, } const data = { ...userData, accessToken: responseData.accessToken, refreshToken: responseData.refreshToken } - // setSuccess(true) dispatch(handleLogin(data)) navigate('/dashboard'); - location.reload() - }, - onFail: ()=>{ - window.location.assign("/login"); + onFail: (response)=>{ + console.log("Fail"); + console.log(response); + window.location.assign("/iamsmart/loginFail"); }, - onError:()=>{ - window.location.assign("/login"); + onError:(error)=>{ + console.log(error); + //window.location.assign("/iamsmart/loginFail"); } }); } diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index 4b4d963..593a51e 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -57,10 +57,6 @@ const LoginRoutes = { path: 'error', element: }, - { - path: 'iamsmart/fallcallback', - element: - }, { path: 'iamsmart/authcallback', element: @@ -70,7 +66,7 @@ const LoginRoutes = { element: }, { - path: 'iamsmart/loginFall', + path: 'iamsmart/loginFail', element: }, { From 9a13e1f56620c3880cd9d3e658892ef414e20806 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Tue, 9 Jan 2024 14:49:00 +0800 Subject: [PATCH 2/8] update pay reminder page --- src/pages/Proof/Payment/Pay.js | 50 ++++++++++++------- .../Details_Public/ApplicationDetailCard.js | 13 ++--- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index 4fa0e19..697fcdc 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -32,6 +32,8 @@ import { // useEffect, useState } from "react"; +import {PNSPS_BUTTON_THEME, PNSPS_LONG_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const Index = () => { @@ -90,11 +92,11 @@ const Index = () => {
- + 公共啟事:校對完成及付款 - + 我們已收到申請編號: {record?.appNo} 的稿件校對確定及可付印的指示。

請於 {DateUtils.dateStr_Cht(record?.returnBeforeDate)} 下午 2:00 前 完成繳費,我們將於收到繳費確認後處理刊出事宜。 @@ -102,27 +104,37 @@ const Index = () => { 如你在憲報期數 {record?.issueYear} 年 {record?.issueVolume} 卷, 第 {record?.issueNo} 期內有多於一個公共啟事的申請,你可選擇完成所有此期所有稿件校對確定後,於繳費期限前在「我的公共啟事」內合併付款。
- + 請按以下完成繳費: - + + + + + + 或 - + + + (返回「我的公共啟事」) +
diff --git a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js index 2e44798..8c2a124 100644 --- a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js @@ -142,26 +142,23 @@ const ApplicationDetailCard = ( spacing={2} mb={2} > + { currentApplicationDetailData.status == "confirmed" ? : null } - +
{/*row 2*/} diff --git a/src/pages/Proof/Payment/Pay.js b/src/pages/Proof/Payment/Pay.js index 697fcdc..c28940a 100644 --- a/src/pages/Proof/Payment/Pay.js +++ b/src/pages/Proof/Payment/Pay.js @@ -141,9 +141,20 @@ const Index = () => {
- setIsPopUp(false)} > - - 確認付款 + setIsPopUp(false)} + PaperProps={{ + sx: { + minWidth: '40vw', + maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '30vw' }, + maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '50vh' } + } + }} + > + + 確認付款 + 總額(HK$): {FormatUtils.currencyFormat(fee)} diff --git a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js index 8c2a124..572db9f 100644 --- a/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js +++ b/src/pages/PublicNotice/Details_Public/ApplicationDetailCard.js @@ -39,6 +39,7 @@ import EditNoteIcon from '@mui/icons-material/EditNote'; import DownloadIcon from '@mui/icons-material/Download'; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; +import * as React from "react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const ApplicationDetailCard = ( { applicationDetailData, @@ -147,7 +148,7 @@ const ApplicationDetailCard = ( currentApplicationDetailData.status == "confirmed" ? */} - + + + + Pending Payment: {paymentCount} + + + + Pending Publish: {publishCount} +
@@ -165,6 +207,35 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData }) => {
+
+ setIsSuccessPopUp(false)} > + Create Result + + + + Created DN record: {resultCount} + + {resultCount == 0 ? <> : + + + + } + + + + + + + +
); }; diff --git a/src/pages/DemandNote/Create/index.js b/src/pages/DemandNote/Create/index.js index 1c6cafe..2d0d5e4 100644 --- a/src/pages/DemandNote/Create/index.js +++ b/src/pages/DemandNote/Create/index.js @@ -35,6 +35,9 @@ const Index = () => { const [searchCriteria, setSearchCriteria] = React.useState({}); const [onReady, setOnReady] = React.useState(false); + const [paymentCount, setPaymentCount] = React.useState(0); + const [publishCount, setPublishCount] = React.useState(0); + React.useEffect(()=>{ getIssueCombo(); },[]); @@ -51,7 +54,9 @@ const Index = () => { HttpUtils.get({ url: UrlUtils.DEMAND_NOTE_PREVIEW+"/"+searchCriteria.issueId, onSuccess: function(responseData){ - setRecord(responseData); + setRecord(responseData.records); + setPaymentCount(responseData.paymentCount); + setPublishCount(responseData.publishCount); } }); } @@ -88,6 +93,8 @@ const Index = () => { {/*row 2*/} diff --git a/src/pages/DemandNote/Search/index.js b/src/pages/DemandNote/Search/index.js index b0ab178..cbe9141 100644 --- a/src/pages/DemandNote/Search/index.js +++ b/src/pages/DemandNote/Search/index.js @@ -18,6 +18,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa const SearchForm = Loadable(React.lazy(() => import('./SearchForm'))); const EventTable = Loadable(React.lazy(() => import('./DataGrid'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import { notifyDownloadSuccess } from 'utils/CommonFunction'; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -77,6 +78,7 @@ const UserSearchPage_Individual = () => { url: UrlUtils.DEMAND_NOTE_EXPORT, params: searchCriteria, onSuccess: function () { + notifyDownloadSuccess(); } }); } From f3edc59062a1830f69922b3cadac409bb1615ce9 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Tue, 9 Jan 2024 16:58:09 +0800 Subject: [PATCH 5/8] update proof reply --- .../Proof/Reply_Public/ApplicationDetails.js | 52 +++++++------ src/pages/Proof/Reply_Public/ProofForm.js | 2 +- src/pages/Proof/Reply_Public/index.js | 78 ++++++++----------- 3 files changed, 64 insertions(+), 68 deletions(-) diff --git a/src/pages/Proof/Reply_Public/ApplicationDetails.js b/src/pages/Proof/Reply_Public/ApplicationDetails.js index 5ddffdc..e0e65bd 100644 --- a/src/pages/Proof/Reply_Public/ApplicationDetails.js +++ b/src/pages/Proof/Reply_Public/ApplicationDetails.js @@ -119,7 +119,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + @@ -147,7 +147,7 @@ const ApplicationDetailCard = ({ formData, }) => { - + @@ -178,29 +178,36 @@ const ApplicationDetailCard = ({ formData, }) => { - + - + - + 請下載下列印刷稿檔案,並仔細校對: + + + - + - + @@ -209,17 +216,16 @@ const ApplicationDetailCard = ({ formData, }) => {  {DateUtils.datetimeStr_Cht(data.returnBeforeDate)} 前 - 應繳費用: - - {FormatUtils.currencyFormat(data.fee)} + + {FormatUtils.currencyFormat(data.fee)} - { - formik.values.groupType == "Private Bill" + formik.values.groupType === "Private Bill" ? ( {data.noOfPages} 頁 x $6,552 ) : diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index d99e197..8352580 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -135,7 +135,7 @@ const FormPanel = ({ formData }) => { return ( - diff --git a/src/pages/Proof/Reply_Public/index.js b/src/pages/Proof/Reply_Public/index.js index f1b3578..43f6e22 100644 --- a/src/pages/Proof/Reply_Public/index.js +++ b/src/pages/Proof/Reply_Public/index.js @@ -3,7 +3,6 @@ import { Grid, Typography, Stack, - Box, Button } from '@mui/material'; import * as UrlUtils from "utils/ApiPathConst"; @@ -20,6 +19,7 @@ const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/Loa const ApplicationDetails = Loadable(React.lazy(() => import('./ApplicationDetails'))); const ProofForm = Loadable(React.lazy(() => import('./ProofForm'))); import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' +import MainCard from "../../../components/MainCard"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', @@ -39,22 +39,6 @@ const Index = () => { const [record, setRecord] = React.useState(); const [onReady, setOnReady] = React.useState(false); - const _sx = { - padding: "4 2 4 2", - boxShadow: 1, - border: 1, - borderColor: '#DDD', - '& .MuiDataGrid-cell': { - borderTop: 1, - borderBottom: 1, - borderColor: "#EEE" - }, - '& .MuiDataGrid-footerContainer': { - border: 1, - borderColor: "#EEE" - } - } - React.useEffect(() => { loadForm(); }, []); @@ -98,7 +82,7 @@ const Index = () => { : ( - +
@@ -106,38 +90,44 @@ const Index = () => {
- - {/*row 1*/} - - -
- - - - - - - - - - -
-
+ + + + + {/*row 2*/} + + + + +
From 89776860821d412ac540d51969c345e9193aa455 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 9 Jan 2024 17:38:26 +0800 Subject: [PATCH 6/8] update color --- src/utils/statusUtils/PublicNoteStatusUtils.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utils/statusUtils/PublicNoteStatusUtils.js b/src/utils/statusUtils/PublicNoteStatusUtils.js index 8fddc1b..4c6c592 100644 --- a/src/utils/statusUtils/PublicNoteStatusUtils.js +++ b/src/utils/statusUtils/PublicNoteStatusUtils.js @@ -28,9 +28,9 @@ export function getStatusByText(status, creditor) { case "resubmit": return getStatusTag({ color: "#757373", text: "需重新提交" }) case "cancelled": - return getStatusTag({ color: "#f5a83d", text: "已取消" }) + return getStatusTag({ color: "#909497", text: "已取消" }) case "withdrawn": - return getStatusTag({ color: "#8a8784", text: "已撤銷" }) + return getStatusTag({ color: "#909497", text: "已撤銷" }) default: return getStatusTag({ text: status }) } @@ -42,18 +42,18 @@ export function getStatusEng(params) { export function getStatusByTextEng(status, creditor) { switch (status) { case "submitted": - return getStatusTag({ color: "#f5a83d", text: "Submitted" }) + return getStatusTag({ color: "#F1C40F", text: "Submitted" }) case "reviewed": return getStatusTag({ color: "#0C489E", text: "Reviewed" }) case "confirmed": if (creditor) - return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) + return getStatusTag({ color: "#3498DB", text: "Pending Publish" }) else - return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) + return getStatusTag({ color: "#F39C12", text: "Pending Payment" }) case "published": - return getStatusTag({ color: "#22a13f", text: "Pending Payment" }) + return getStatusTag({ color: "#F39C12", text: "Pending Payment" }) case "paid": - return getStatusTag({ color: "#22a13f", text: "Pending Publish" }) + return getStatusTag({ color: "#3498DB", text: "Pending Publish" }) case "complated": return getStatusTag({ color: "#8a8784", text: "Completed" }) case "notAccepted": From 81848787fa1a5e2d4b831856db86febd5cbe69e6 Mon Sep 17 00:00:00 2001 From: Jason Date: Tue, 9 Jan 2024 17:46:29 +0800 Subject: [PATCH 7/8] update label --- src/layout/MainLayout/Header/index.js | 2 +- src/pages/DemandNote/Create/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 383f321..49c6ac6 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -127,7 +127,7 @@ function Header(props) { Download XML
  • - Create DN + Create Demand Note
  • Demand Note diff --git a/src/pages/DemandNote/Create/index.js b/src/pages/DemandNote/Create/index.js index 1c6cafe..f92908d 100644 --- a/src/pages/DemandNote/Create/index.js +++ b/src/pages/DemandNote/Create/index.js @@ -79,7 +79,7 @@ const Index = () => {
    - Create DN + Create Demand Note
    From da5845fcb9a0d3b9f0c477f0a1234ae1780f3b87 Mon Sep 17 00:00:00 2001 From: "jason.lam" Date: Tue, 9 Jan 2024 17:49:04 +0800 Subject: [PATCH 8/8] update card --- src/pages/Proof/Reply_Public/ProofForm.js | 38 ++++++++++--------- .../Proof/Reply_Public/UploadFileTable.js | 19 ++++++---- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/pages/Proof/Reply_Public/ProofForm.js b/src/pages/Proof/Reply_Public/ProofForm.js index 8352580..f9ede05 100644 --- a/src/pages/Proof/Reply_Public/ProofForm.js +++ b/src/pages/Proof/Reply_Public/ProofForm.js @@ -22,6 +22,8 @@ import { useNavigate } from "react-router-dom"; import * as DateUtils from "utils/DateUtils" import Loadable from 'components/Loadable'; import { notifyActionSuccess } from 'utils/CommonFunction'; +import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; +import {ThemeProvider} from "@emotion/react"; const UploadFileTable = Loadable(React.lazy(() => import('./UploadFileTable'))); // ==============================|| DASHBOARD - DEFAULT ||============================== // @@ -147,8 +149,8 @@ const FormPanel = ({ formData }) => { { formik.values.replyDate ? - - + + 校對回覆日期: {DateUtils.datetimeStr_Cht(formik.values.replyDate)} @@ -158,7 +160,7 @@ const FormPanel = ({ formData }) => { formik.values.action ? null : - + { : ( isOverTime() ? - + 回覆逾時,請重新申請。 : - + { type="file" accept=".pdf" style={{ display: 'none' }} - disabled={attachments.length >= (formik.values.groupType == "Private Bill" ? 2 : 1)} + disabled={attachments.length >= (formik.values.groupType === "Private Bill" ? 2 : 1)} onChange={(event) => { readFile(event) }} /> - + } - + 簽署: @@ -261,7 +265,7 @@ const FormPanel = ({ formData }) => { WebkitTextFillColor: "#000000", background: "#f8f8f8", }, - width: '50%' + width: '70%' } } /> @@ -271,17 +275,15 @@ const FormPanel = ({ formData }) => { + + diff --git a/src/pages/Proof/Reply_Public/UploadFileTable.js b/src/pages/Proof/Reply_Public/UploadFileTable.js index 9090721..ca2b6e1 100644 --- a/src/pages/Proof/Reply_Public/UploadFileTable.js +++ b/src/pages/Proof/Reply_Public/UploadFileTable.js @@ -10,15 +10,18 @@ import {useEffect} from "react"; // import {useNavigate} from "react-router-dom"; // import { useTheme } from '@mui/material/styles'; import { - Box, - Stack + Stack, useMediaQuery } from '@mui/material'; +import {useTheme} from "@emotion/react"; // ==============================|| EVENT TABLE ||============================== // export default function UploadFileTable({recordList, setRecordList,}) { const [rows, setRows] = React.useState(recordList); const [rowModesModel,setRowModesModel] = React.useState({}); + const theme = useTheme(); + const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); + // const theme = useTheme(); // const navigate = useNavigate() @@ -74,7 +77,8 @@ export default function UploadFileTable({recordList, setRecordList,}) { id: 'name', field: 'name', headerName: '檔案名稱', - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, }, { id: 'size', @@ -84,13 +88,14 @@ export default function UploadFileTable({recordList, setRecordList,}) { // console.log(params) return Math.ceil(params.value/1024)+" KB"; }, - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, }, ]; return ( - - + ); }