Browse Source

add login public check, message check, demand note no

CR013B2
CCHooo 3 months ago
parent
commit
3663276cb1
13 changed files with 87 additions and 67 deletions
  1. +2
    -2
      src/pages/Proof/Payment/Pay_Online.js
  2. +9
    -2
      src/pages/Proof/Payment/index.js
  3. +2
    -2
      src/pages/Proof/Reply_Public/ProofForm.js
  4. +15
    -13
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  5. +6
    -6
      src/pages/PublicNotice/ListPanel/PendingPaymentTab.js
  6. +35
    -20
      src/pages/PublicNotice/Search_Mark_As_Paid_GLD/DataGrid.js
  7. +3
    -7
      src/pages/authentication/AuthWrapper.js
  8. +4
    -0
      src/pages/authentication/auth-forms/PasswordAlertDialog.js
  9. +5
    -11
      src/pages/dashboard/Public/index.js
  10. +1
    -0
      src/translations/en.json
  11. +1
    -0
      src/translations/zh-CN.json
  12. +1
    -0
      src/translations/zh-HK.json
  13. +3
    -4
      src/utils/Utils.js

+ 2
- 2
src/pages/Proof/Payment/Pay_Online.js View File

@@ -176,8 +176,8 @@ const Index = () => {
<br /> <br />
{checkPaymentSuspention()? {checkPaymentSuspention()?
<div> <div>
<Typography style={{ textAlign: "flex-start" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<Typography style={{ textAlign: "flex-start", color: "red" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography> </Typography>
<br /> <br />
</div>:null </div>:null


+ 9
- 2
src/pages/Proof/Payment/index.js View File

@@ -12,12 +12,14 @@ const Pay_Creditor = Loadable(lazy(() => import('./Pay_Creditor')));
const Pay_Dn = Loadable(lazy(() => import('./Pay_DN'))); const Pay_Dn = Loadable(lazy(() => import('./Pay_DN')));
const Pay_Office = Loadable(lazy(() => import('./Pay_Office'))); const Pay_Office = Loadable(lazy(() => import('./Pay_Office')));
const Pay_Online = Loadable(lazy(() => import('./Pay_Online'))); const Pay_Online = Loadable(lazy(() => import('./Pay_Online')));
import { checkPaymentSuspention } from "utils/Utils";




const Index = () => { const Index = () => {
const params = useParams(); const params = useParams();
const [onReady, setOnReady] = useState(false); const [onReady, setOnReady] = useState(false);
const [record, setRecord] = useState({}); const [record, setRecord] = useState({});
const [paymentMethod, setPaymentMethod] = useState();
const navigate = useNavigate() const navigate = useNavigate()


useEffect(() => { useEffect(() => {
@@ -33,6 +35,11 @@ const Index = () => {
navigate("/proof/search"); navigate("/proof/search");
} }
setRecord(responseData.data); setRecord(responseData.data);
if(checkPaymentSuspention()){
setPaymentMethod("online")
}else{
setPaymentMethod(responseData.data.paymentMethod)
}
}, },
onError: () => { onError: () => {


@@ -56,12 +63,12 @@ const Index = () => {
record={record} record={record}
/> />
: ( : (
record.paymentMethod == "demandNote" ?
paymentMethod == "demandNote" ?
<Pay_Dn <Pay_Dn
record={record} record={record}
/> />
: ( : (
record.paymentMethod == "online" ?
paymentMethod == "online" ?
<Pay_Online <Pay_Online
record={record} record={record}
/> />


+ 2
- 2
src/pages/Proof/Reply_Public/ProofForm.js View File

@@ -436,8 +436,8 @@ const FormPanel = ({ formData }) => {
<td style={tabelStyle}> <td style={tabelStyle}>
<FormattedMessage id="payOnline" /> <FormattedMessage id="payOnline" />
{checkPaymentSuspention()? {checkPaymentSuspention()?
<Typography style={{ padding: '16px' }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<Typography style={{ padding: '16px', color: "red" }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography>:null </Typography>:null
} }
<br /><a href="#payOnlineDetails" color='#fff' onClick={() => { <br /><a href="#payOnlineDetails" color='#fff' onClick={() => {


+ 15
- 13
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js View File

@@ -746,7 +746,7 @@ const ApplicationDetailCard = (
</Grid> </Grid>
<Grid item xs={12} md={8} lg={8} sx={{ display: 'flex', alignItems: 'center' }}> <Grid item xs={12} md={8} lg={8} sx={{ display: 'flex', alignItems: 'center' }}>
<Grid container direction="row" justifyContent="flex-start"> <Grid container direction="row" justifyContent="flex-start">
<Grid item xs={10} md={5} lg={5} sx={{ display: 'flex', alignItems: 'center' }}>
<Grid item xs={10} md={6} lg={6} sx={{ display: 'flex', alignItems: 'center' }}>
<FormControl variant="outlined" fullWidth > <FormControl variant="outlined" fullWidth >
<Typography <Typography
// fullWidth // fullWidth
@@ -757,18 +757,20 @@ const ApplicationDetailCard = (
</Typography> </Typography>
</FormControl> </FormControl>
</Grid> </Grid>
<Grid item md={3} lg={3}>
<Button
size="small"
variant="contained"
onClick={() =>{setIsPaymentMeansPopUp(true)}}
sx={{
textTransform: 'capitalize',
alignItems: 'end',
}}>
Change
</Button>
</Grid>
{currentApplicationDetailData.paymentMethod!=null?
<Grid item md={3} lg={3}>
<Button
size="small"
variant="contained"
onClick={() =>{setIsPaymentMeansPopUp(true)}}
sx={{
textTransform: 'capitalize',
alignItems: 'end',
}}>
Change
</Button>
</Grid>:null
}
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>


+ 6
- 6
src/pages/PublicNotice/ListPanel/PendingPaymentTab.js View File

@@ -240,19 +240,19 @@ export default function SubmittedTab({ setCount, url }) {
{ {
params.row.paymentMethod=="online"? params.row.paymentMethod=="online"?
locale === 'en' ? locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
: :
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 14, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
:params.row.paymentMethod=="demandNote" ? :params.row.paymentMethod=="demandNote" ?
locale === 'en' ? locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
: :
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 0)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
: :
locale === 'en' ? locale === 'en' ?
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "a.m.")?.replace("pm", "p.m.")}`
: :
`${DateUtils.dateFormatWithFix(params.row.closingDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
`${DateUtils.dateFormatWithFix(params.row.expiryDate, intl.formatMessage({ id: "datetimeFormate" }), 12, 30)?.replace("am", "上午")?.replace("pm", "下午").replace("00分", "")}`
} }
{/* { {/* {
locale === 'en' ? locale === 'en' ?


+ 35
- 20
src/pages/PublicNotice/Search_Mark_As_Paid_GLD/DataGrid.js View File

@@ -36,7 +36,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false); const [isConfirmPopUp, setIsConfirmPopUp] = React.useState(false);
const [isWarningPopUp, setIsWarningPopUp] = React.useState(false); const [isWarningPopUp, setIsWarningPopUp] = React.useState(false);
const [demandNoteNoPopUp, setDemandNoteNoPopUp] = React.useState(false); const [demandNoteNoPopUp, setDemandNoteNoPopUp] = React.useState(false);
const [confirmDemandNoteNoPopUp, setConfirmDemandNoteNoPopUp] = React.useState(false);
// const [confirmDemandNoteNoPopUp, setConfirmDemandNoteNoPopUp] = React.useState(false);
const [demandNoteNo, setDemandNoteNo] = React.useState(); const [demandNoteNo, setDemandNoteNo] = React.useState();
const [demandNoteNoId, setDemandNoteNoId] = React.useState(); const [demandNoteNoId, setDemandNoteNoId] = React.useState();
@@ -71,7 +71,8 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
function updateDemandNoteNo(id, remark) { function updateDemandNoteNo(id, remark) {
setDemandNoteNoId(id) setDemandNoteNoId(id)
setDemandNoteNo(remark) setDemandNoteNo(remark)
setConfirmDemandNoteNoPopUp(true)
doDemandNoteNo()
// setConfirmDemandNoteNoPopUp(true)
} }
function editDemandNoteNo(id, remark) { function editDemandNoteNo(id, remark) {
@@ -81,7 +82,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
} }


const doDemandNoteNo = () => { const doDemandNoteNo = () => {
setConfirmDemandNoteNoPopUp(false);
// setConfirmDemandNoteNoPopUp(false);
console.log(refreshTrigger) console.log(refreshTrigger)
HttpUtils.post({ HttpUtils.post({
url: APPLICATION_UPDATE_DEMAND_NOTE_NO + "/" + demandNoteNoId, url: APPLICATION_UPDATE_DEMAND_NOTE_NO + "/" + demandNoteNoId,
@@ -213,21 +214,35 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
</Button> </Button>
</Stack> </Stack>
: :
<TextField
size="small"
variant="outlined"
defaultValue={params.row.demandNoteNo || ''}
onBlur={handleBlur}
placeholder="Enter Demand Note No."
InputProps={{
style: { height: '32px', fontSize: '0.875rem' }
}}
sx={{
'& .MuiOutlinedInput-root': { height: '32px' },
flex: 1,
minWidth: '60px'
}}
/>
<Stack direction="row" justifyContent="space-between" alignItems="center" width="100%">
<TextField
size="small"
variant="outlined"
defaultValue={params.row.demandNoteNo || ''}
onBlur={handleBlur}
placeholder="Enter Demand Note No."
InputProps={{
style: { height: '32px', fontSize: '0.875rem' }
}}
sx={{
'& .MuiOutlinedInput-root': { height: '32px' },
flex: 1,
minWidth: '60px'
}}
/>
<Button
// size="small"
variant="contained"
onClick={() => updateDemandNoteNo(params.row.id, params.row.demandNoteNo)}
sx={{
textTransform: 'capitalize',
alignItems: 'end',

}}>
save
{/* <Typography ml={1} variant="h5"> Edit</Typography> */}
</Button>
</Stack>
} }
</div> </div>
); );
@@ -360,7 +375,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</div> </div>
<div>
{/* <div>
<Dialog <Dialog
open={confirmDemandNoteNoPopUp} open={confirmDemandNoteNoPopUp}
onClose={() => setConfirmDemandNoteNoPopUp(false)} onClose={() => setConfirmDemandNoteNoPopUp(false)}
@@ -381,7 +396,7 @@ export default function SearchPublicNoticeTable({ searchCriteria, applyGridOnRea
<Button onClick={() => doDemandNoteNo()}><Typography variant="h5">Confirm</Typography></Button> <Button onClick={() => doDemandNoteNo()}><Typography variant="h5">Confirm</Typography></Button>
</DialogActions> </DialogActions>
</Dialog> </Dialog>
</div>
</div> */}
<div> <div>
<Dialog <Dialog
open={demandNoteNoPopUp} open={demandNoteNoPopUp}


+ 3
- 7
src/pages/authentication/AuthWrapper.js View File

@@ -2,12 +2,11 @@ import PropTypes from 'prop-types';
import { Box, Grid, Typography } from '@mui/material'; import { Box, Grid, Typography } from '@mui/material';
// import { Stack } from '@mui/material'; // import { Stack } from '@mui/material';
import Loadable from 'components/Loadable'; import Loadable from 'components/Loadable';
import { lazy, useContext } from 'react';
import { lazy, } from 'react';
import { FormattedMessage, useIntl } from "react-intl"; import { FormattedMessage, useIntl } from "react-intl";
import { checkSysEnv, checkPaymentSuspention } from "utils/Utils"; import { checkSysEnv, checkPaymentSuspention } from "utils/Utils";
import backbroundImg from 'assets/images/bg_ml.jpg'; import backbroundImg from 'assets/images/bg_ml.jpg';
import 'assets/style/loginStyles.css'; import 'assets/style/loginStyles.css';
import { SysContext } from "components/SysSettingProvider"


const AuthCard = Loadable(lazy(() => import('./AuthCardCustom'))); const AuthCard = Loadable(lazy(() => import('./AuthCardCustom')));


@@ -21,7 +20,6 @@ const BackgroundHead = {
const AuthWrapper = ({ children }) => { const AuthWrapper = ({ children }) => {
// Move useIntl inside component // Move useIntl inside component
const intl = useIntl(); const intl = useIntl();
const { sysSetting } = useContext(SysContext);


return ( return (
<Box sx={{ minHeight: '87vh' }}> <Box sx={{ minHeight: '87vh' }}>
@@ -45,7 +43,7 @@ const AuthWrapper = ({ children }) => {
<Grid item xs={12} sx={{ ml: 4,}}> <Grid item xs={12} sx={{ ml: 4,}}>
{checkPaymentSuspention()? {checkPaymentSuspention()?
<Typography style={{ textAlign: "flex-start" }}> <Typography style={{ textAlign: "flex-start" }}>
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<div style={{ padding: 12 }} dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography> </Typography>
: :
<Typography style={{ textAlign: "flex-start" }}> <Typography style={{ textAlign: "flex-start" }}>
@@ -81,7 +79,6 @@ const AuthWrapper = ({ children }) => {
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
{sysSetting?.publicLogin?
<Grid item xs={12} md={4} lg={4} xl={4}> <Grid item xs={12} md={4} lg={4} xl={4}>
<Grid <Grid
container container
@@ -93,8 +90,7 @@ const AuthWrapper = ({ children }) => {
<AuthCard>{children}</AuthCard> <AuthCard>{children}</AuthCard>
</Grid> </Grid>
</Grid> </Grid>
</Grid>:null
}
</Grid>
</Grid> </Grid>
</div> </div>
</Box> </Box>


+ 4
- 0
src/pages/authentication/auth-forms/PasswordAlertDialog.js View File

@@ -47,6 +47,10 @@ const PasswordAlertDialog = (props) => {
<Typography display="inline"> <Typography display="inline">
<FormattedMessage id="loginErrorMessage4"/> <FormattedMessage id="loginErrorMessage4"/>
</Typography>: </Typography>:
props.errorMassage === 'PUBLIC_LOGIN_DISABLE' ?
<Typography display="inline">
<FormattedMessage id="loginErrorMessage7"/>
</Typography>:
<Typography display="inline"> <Typography display="inline">
<FormattedMessage id="loginErrorMessage5"/> <FormattedMessage id="loginErrorMessage5"/>
</Typography> </Typography>


+ 5
- 11
src/pages/dashboard/Public/index.js View File

@@ -51,13 +51,12 @@ const DashboardDefault = () => {
const [isLoading, setLoding] = useState(true); const [isLoading, setLoding] = useState(true);
const [itemList, setItemList] = React.useState([]); const [itemList, setItemList] = React.useState([]);
const [listData, setListData] = React.useState([]); const [listData, setListData] = React.useState([]);
const [paymentSuspention, setPaymentSuspention] = useState(false);
const [isPopUp, setIsPopUp] = React.useState(false); const [isPopUp, setIsPopUp] = React.useState(false);
React.useEffect(() => { React.useEffect(() => {
loadMessageData() loadMessageData()
loadNoticeData() loadNoticeData()
checkPaymentSuspention()?setPaymentSuspention(true):setPaymentSuspention(false)
localStorage.setItem('searchCriteria',"") localStorage.setItem('searchCriteria',"")
}, []); }, []);


@@ -75,19 +74,14 @@ const DashboardDefault = () => {
} }
} }


React.useEffect(() => {
// console.log(messageOnReady)
// console.log(onNoticeReady)
if(paymentSuspention){
setIsPopUp(true);
}
}, [paymentSuspention]);

React.useEffect(() => { React.useEffect(() => {
// console.log(messageOnReady) // console.log(messageOnReady)
// console.log(onNoticeReady) // console.log(onNoticeReady)
if(messageOnReady&&onNoticeReady){ if(messageOnReady&&onNoticeReady){
setLoding(false) setLoding(false)
if(checkPaymentSuspention()){
setIsPopUp(true);
}
// console.log(123) // console.log(123)
} }
}, [messageOnReady,onNoticeReady]); }, [messageOnReady,onNoticeReady]);
@@ -246,7 +240,7 @@ const DashboardDefault = () => {
</DialogTitle> </DialogTitle>
<DialogContent style={{ display: 'flex', }}> <DialogContent style={{ display: 'flex', }}>
<Typography variant="h5" style={{ padding: '16px' }}> <Typography variant="h5" style={{ padding: '16px' }}>
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessage" }) }} />
<div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: "suspensionMessageText" }) }} />
</Typography> </Typography>
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>


+ 1
- 0
src/translations/en.json View File

@@ -165,6 +165,7 @@
"loginErrorMessage4":"System Connection Failed", "loginErrorMessage4":"System Connection Failed",
"loginErrorMessage5":"Incorrect Username or Password", "loginErrorMessage5":"Incorrect Username or Password",
"loginErrorMessage6":"User account not found", "loginErrorMessage6":"User account not found",
"loginErrorMessage7":"System is under maintenance, please check back later",


"pleaseLloginMessage1":"User account already created", "pleaseLloginMessage1":"User account already created",
"pleaseLloginMessage2":"You are our existing user, please login to your account.", "pleaseLloginMessage2":"You are our existing user, please login to your account.",


+ 1
- 0
src/translations/zh-CN.json View File

@@ -202,6 +202,7 @@
"loginErrorMessage4":"系统连接失败", "loginErrorMessage4":"系统连接失败",
"loginErrorMessage5":"用户登入名称或密码错误", "loginErrorMessage5":"用户登入名称或密码错误",
"loginErrorMessage6":"找不到用户帐户", "loginErrorMessage6":"找不到用户帐户",
"loginErrorMessage7":"系统正在维护中,请稍后再查看",
"pleaseLloginMessage1":"帐户已建立", "pleaseLloginMessage1":"帐户已建立",
"pleaseLloginMessage2":"你是我们的现有用户,请登入你的帐户。", "pleaseLloginMessage2":"你是我们的现有用户,请登入你的帐户。",


+ 1
- 0
src/translations/zh-HK.json View File

@@ -203,6 +203,7 @@
"loginErrorMessage4":"系統連接失敗", "loginErrorMessage4":"系統連接失敗",
"loginErrorMessage5":"用戶名或密碼錯誤", "loginErrorMessage5":"用戶名或密碼錯誤",
"loginErrorMessage6":"找不到用戶帳戶", "loginErrorMessage6":"找不到用戶帳戶",
"loginErrorMessage7":"系統正在維護中,請稍後再查看",


"pleaseLloginMessage1":"帳戶已建立", "pleaseLloginMessage1":"帳戶已建立",
"pleaseLloginMessage2":"你是我們的現有用戶,請登入你的帳戶。", "pleaseLloginMessage2":"你是我們的現有用戶,請登入你的帳戶。",


+ 3
- 4
src/utils/Utils.js View File

@@ -110,13 +110,12 @@ export const checkSysEnv = () =>{
// console.log(localStorage.getItem('sysEnv')) // console.log(localStorage.getItem('sysEnv'))
return localStorage.getItem('sysEnv') return localStorage.getItem('sysEnv')
} }
}
}
export const checkPaymentSuspention = () =>{ export const checkPaymentSuspention = () =>{
if (localStorage.getItem('paymentSuspention') != null){ if (localStorage.getItem('paymentSuspention') != null){
// console.log(localStorage.getItem('sysEnv'))
return localStorage.getItem('paymentSuspention')
return JSON.parse(localStorage.getItem('paymentSuspention'))
} }
}
}
/** /**
** This function is used for demo purpose route navigation ** This function is used for demo purpose route navigation
** In real app you won't need this function because your app will navigate to same route for each users regardless of ability ** In real app you won't need this function because your app will navigate to same route for each users regardless of ability


Loading…
Cancel
Save