| @@ -269,7 +269,7 @@ export default function SearchDemandNote({ applySearch, searchCriteria }) { | |||||
| <tbody> | <tbody> | ||||
| <tr><td>Issue:</td><td>{DateUtils.dateStr(params?.row.issueDate)}</td></tr> | <tr><td>Issue:</td><td>{DateUtils.dateStr(params?.row.issueDate)}</td></tr> | ||||
| <tr><td>Due:</td><td>{params?.value ? DateUtils.dateStr(params?.value) : "--"}</td></tr> | <tr><td>Due:</td><td>{params?.value ? DateUtils.dateStr(params?.value) : "--"}</td></tr> | ||||
| <tr><td>Sent:</td><td>{params.row.sentDate ? DateUtils.datetimeStr(params.row.sentDate) - params.row.sentBy : "To be sent"}</td></tr> | |||||
| <tr><td>Sent:</td><td>{params.row.sentDate ? DateUtils.datetimeStr(params.row.sentDate) +" - "+ params.row.sentBy : "To be sent"}</td></tr> | |||||
| </tbody> | </tbody> | ||||
| </table>); | </table>); | ||||
| } | } | ||||
| @@ -0,0 +1,99 @@ | |||||
| // material-ui | |||||
| import { | |||||
| Grid, | |||||
| Typography, | |||||
| Stack, | |||||
| Button | |||||
| } from '@mui/material'; | |||||
| import * as React from "react"; | |||||
| import { FormattedMessage, useIntl } from "react-intl"; | |||||
| import { useLocation } from "react-router-dom"; | |||||
| import { useNavigate } from "react-router-dom"; | |||||
| import Loadable from 'components/Loadable'; | |||||
| const LoadingComponent = Loadable(React.lazy(() => import('pages/extra-pages/LoadingComponent'))); | |||||
| import AccountCircleIcon from '@mui/icons-material/AccountCircle'; | |||||
| 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' | |||||
| } | |||||
| // ==============================|| DASHBOARD - DEFAULT ||============================== // | |||||
| const Index = () => { | |||||
| const intl = useIntl(); | |||||
| const location = useLocation(); | |||||
| const navigate = useNavigate() | |||||
| const [onReady, setOnReady] = React.useState(false); | |||||
| React.useEffect(() => { | |||||
| if ("iAmSmart" == location?.state?.registryMethod) { | |||||
| setOnReady(true); | |||||
| } else { | |||||
| //setOnReady(true); | |||||
| navigate('/login'); | |||||
| } | |||||
| }, []); | |||||
| return ( | |||||
| !onReady ? | |||||
| <Grid container sx={{ minHeight: '87vh', mb: 3 }} direction="column" justifyContent="center" alignItems="center"> | |||||
| <Grid item> | |||||
| <LoadingComponent /> | |||||
| </Grid> | |||||
| </Grid> | |||||
| : | |||||
| <Grid container sx={{ minHeight: '110vh', backgroundColor: '#fff' }} direction="column" justifyContent="flex-start" alignItems="center" > | |||||
| <Grid item xs={12} width="100%"> | |||||
| <div style={BackgroundHead} width="100%"> | |||||
| <Stack direction="row" height='70px'> | |||||
| <Typography ml={15} color='#FFF' variant="h4" sx={{ pt: 2 }}> | |||||
| <FormattedMessage id="pleaseLloginMessage1" /> | |||||
| </Typography> | |||||
| </Stack> | |||||
| </div> | |||||
| </Grid> | |||||
| {/*row 1*/} | |||||
| <Grid item xs={12} md={12} > | |||||
| <Grid container justifyContent="flex-start" alignItems="center" > | |||||
| <center> | |||||
| <AccountCircleIcon color="secondary" sx={{ width: "200px", height: "200px" }} /> | |||||
| <Grid item xs={12} md={12} > | |||||
| <Typography variant="h3" sx={{ ml: 8, mt: 4, mr: 8, textAlign: "center" }}> | |||||
| <div dangerouslySetInnerHTML={{ __html: intl.formatMessage({ id: 'pleaseLloginMessage2' }) }} /> | |||||
| </Typography> | |||||
| </Grid> | |||||
| </center> | |||||
| </Grid> | |||||
| </Grid> | |||||
| {/*row 2*/} | |||||
| <Grid item xs={12} md={12} > | |||||
| <Grid container justifyContent="flex-start" alignItems="center" > | |||||
| <center> | |||||
| <Button | |||||
| component="span" | |||||
| variant="contained" | |||||
| size="large" | |||||
| sx={{ m: 4 }} | |||||
| onClick={() => { | |||||
| navigate("/login"); | |||||
| }} | |||||
| > | |||||
| <FormattedMessage id="pleaseLloginMessage3" /> | |||||
| </Button> | |||||
| </center> | |||||
| </Grid> | |||||
| </Grid> | |||||
| </Grid > | |||||
| ); | |||||
| }; | |||||
| export default Index; | |||||
| @@ -38,7 +38,11 @@ const Index = () => { | |||||
| }, | }, | ||||
| onError:(error)=>{ | onError:(error)=>{ | ||||
| console.log(error); | console.log(error); | ||||
| window.location.assign("/register"); | |||||
| if(error?.response?.data?.exception == "msg: account created"){ | |||||
| window.location.assign("/iamsmart/pleaseLogin", { state: {registryMethod:"iAmSmart"}} ); | |||||
| }else{ | |||||
| window.location.assign("/register"); | |||||
| } | |||||
| } | } | ||||
| }); | }); | ||||
| }else{ | }else{ | ||||
| @@ -33,6 +33,7 @@ const IAmSmart_FailCallback = Loadable(lazy(() => import('pages/iAmSmart/FailCal | |||||
| const FailCallback_VerifyMail = Loadable(lazy(() => import('pages/iAmSmart/FailCallback_VerifyMail'))); | const FailCallback_VerifyMail = Loadable(lazy(() => import('pages/iAmSmart/FailCallback_VerifyMail'))); | ||||
| const IAmSmart_AuthCallback = Loadable(lazy(() => import('pages/iAmSmart/AuthCallback'))); | const IAmSmart_AuthCallback = Loadable(lazy(() => import('pages/iAmSmart/AuthCallback'))); | ||||
| const IAmSmart_RegistryCallback = Loadable(lazy(() => import('pages/iAmSmart/RegistryCallback'))); | const IAmSmart_RegistryCallback = Loadable(lazy(() => import('pages/iAmSmart/RegistryCallback'))); | ||||
| const IAmSmart_PleaseLoginCallback = Loadable(lazy(() => import('pages/iAmSmart/PleaseLoginCallback'))); | |||||
| //TODO: this page for testing only, please remove at prod | //TODO: this page for testing only, please remove at prod | ||||
| const VerifyPage = Loadable(lazy(() => import('pages/authentication/Verify'))); | const VerifyPage = Loadable(lazy(() => import('pages/authentication/Verify'))); | ||||
| @@ -106,6 +107,10 @@ const LoginRoutes = { | |||||
| path: 'iamsmart/registrycallback', | path: 'iamsmart/registrycallback', | ||||
| element: <IAmSmart_RegistryCallback/> | element: <IAmSmart_RegistryCallback/> | ||||
| }, | }, | ||||
| { | |||||
| path: 'iamsmart/pleaseLogin', | |||||
| element: <IAmSmart_PleaseLoginCallback/> | |||||
| }, | |||||
| { | { | ||||
| path: 'iamsmart/loginFail', | path: 'iamsmart/loginFail', | ||||
| element: <IAmSmart_FailCallback/> | element: <IAmSmart_FailCallback/> | ||||
| @@ -164,6 +164,10 @@ | |||||
| "loginErrorMessage5":"Incorrect Username or Password", | "loginErrorMessage5":"Incorrect Username or Password", | ||||
| "loginErrorMessage6":"User account not found", | "loginErrorMessage6":"User account not found", | ||||
| "pleaseLloginMessage1":"User account already created", | |||||
| "pleaseLloginMessage2":"You are our existing user, please login to your account.", | |||||
| "pleaseLloginMessage3":"Go to Login page", | |||||
| "loginSuccessMessage1":"User account link up success", | "loginSuccessMessage1":"User account link up success", | ||||
| "loginSuccessMessage2":"You are our existing user and successfully linked your existing account.<br/>From now on, you can log in through \"iAM Smart\".", | "loginSuccessMessage2":"You are our existing user and successfully linked your existing account.<br/>From now on, you can log in through \"iAM Smart\".", | ||||
| "loginSuccessMessage3":"Continue to use e-Service", | "loginSuccessMessage3":"Continue to use e-Service", | ||||
| @@ -199,6 +199,10 @@ | |||||
| "loginErrorMessage4":"系统连接失败", | "loginErrorMessage4":"系统连接失败", | ||||
| "loginErrorMessage5":"用户登入名称或密码错误", | "loginErrorMessage5":"用户登入名称或密码错误", | ||||
| "loginErrorMessage6":"找不到用户帐户", | "loginErrorMessage6":"找不到用户帐户", | ||||
| "pleaseLloginMessage1":"帐户已建立", | |||||
| "pleaseLloginMessage2":"你是我们的现有用户,请登入你的帐户。", | |||||
| "pleaseLloginMessage3":"前往登入页面", | |||||
| "loginSuccessMessage1":"成功连结现有帐户", | "loginSuccessMessage1":"成功连结现有帐户", | ||||
| "loginSuccessMessage2":"你是我们的现有客户,已成功连结现有帐户。<br/>以后可以透过「智方便」登入。", | "loginSuccessMessage2":"你是我们的现有客户,已成功连结现有帐户。<br/>以后可以透过「智方便」登入。", | ||||
| @@ -201,6 +201,10 @@ | |||||
| "loginErrorMessage5":"用戶名或密碼錯誤", | "loginErrorMessage5":"用戶名或密碼錯誤", | ||||
| "loginErrorMessage6":"找不到用戶帳戶", | "loginErrorMessage6":"找不到用戶帳戶", | ||||
| "pleaseLloginMessage1":"帳戶已建立", | |||||
| "pleaseLloginMessage2":"你是我們的現有用戶,請登入你的帳戶。", | |||||
| "pleaseLloginMessage3":"前往登入頁面", | |||||
| "loginSuccessMessage1":"成功連結現有帳戶", | "loginSuccessMessage1":"成功連結現有帳戶", | ||||
| "loginSuccessMessage2":"你是我們的現有客戶,已成功連結現有帳戶。<br/>以後可以透過「智方便」登入。", | "loginSuccessMessage2":"你是我們的現有客戶,已成功連結現有帳戶。<br/>以後可以透過「智方便」登入。", | ||||
| "loginSuccessMessage3":"繼續使用e-Service", | "loginSuccessMessage3":"繼續使用e-Service", | ||||