diff --git a/src/assets/style/navbarStyles.css b/src/assets/style/navbarStyles.css index d71cd84..3555ab0 100644 --- a/src/assets/style/navbarStyles.css +++ b/src/assets/style/navbarStyles.css @@ -127,7 +127,7 @@ visibility: hidden; opacity: 0; min-width: 16rem; - position: absolute; + position: relative; /* transition: all 0.5s ease; */ left: 0; display: none; diff --git a/src/layout/MainLayout/Header/index.js b/src/layout/MainLayout/Header/index.js index 6040307..83bf88f 100644 --- a/src/layout/MainLayout/Header/index.js +++ b/src/layout/MainLayout/Header/index.js @@ -39,7 +39,7 @@ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import Logo from 'components/Logo'; import AdminLogo from 'components/AdminLogo'; import MobileLogo from 'components/MobileLogo'; -import Profile from './HeaderContent/Profile'; +//import Profile from './HeaderContent/Profile'; import "assets/style/navbarStyles.css"; import { isUserLoggedIn, @@ -59,7 +59,7 @@ import { Link } from "react-router-dom"; import LocaleSelector from "./HeaderContent/LocaleSelector"; import { FormattedMessage } from "react-intl"; -const drawerWidth = 240; +const drawerWidth = 300; // const navItems = ['Home', 'About', 'Contact']; // ==============================|| MAIN LAYOUT - HEADER ||============================== // @@ -135,11 +135,11 @@ function Header(props) {
  • - Email Template + Email Template
  • - {/*
  • +
  • Logout -
  • */} + :
    @@ -174,7 +174,9 @@ function Header(props) {
  • - 繳款通知記錄 + + +
  • @@ -241,9 +243,11 @@ function Header(props) { } - {/*
  • - 登出 -
  • */} +
  • + + + +
  • ); @@ -268,7 +272,7 @@ function Header(props) { const drawer = ( isUserLoggedIn() ? - + PNSPS @@ -386,7 +390,7 @@ function Header(props) { : } - + {/**/} @@ -467,7 +471,7 @@ function Header(props) { - {/* */} + {/**/} diff --git a/src/pages/DemandNote/Search_Public/DataGrid.js b/src/pages/DemandNote/Search_Public/DataGrid.js index 3b4d47a..2028d5d 100644 --- a/src/pages/DemandNote/Search_Public/DataGrid.js +++ b/src/pages/DemandNote/Search_Public/DataGrid.js @@ -31,7 +31,7 @@ export default function SearchDemandNote({ recordList }) { const columns = [ { field: 'dnNo', - headerName: '繳款單號', + headerName: intl.formatMessage({id: 'paymentRecordId'}), width: 200, }, { @@ -42,7 +42,7 @@ export default function SearchDemandNote({ recordList }) { { id: 'issueDate', field: 'issueDate', - headerName: '簽發日期', + headerName: intl.formatMessage({id: 'receiptDate'}), width: 175, valueGetter: (params) => { return DateUtils.dateStr(params?.value); @@ -58,7 +58,7 @@ export default function SearchDemandNote({ recordList }) { }, { field: 'sentDate', - headerName: '發送日期', + headerName: intl.formatMessage({id: 'sendDate'}), flex: 1, valueGetter: (params) => { return params?.value ? DateUtils.datetimeStr(params?.value) + " - " + params.row.sentBy : ""; @@ -66,7 +66,7 @@ export default function SearchDemandNote({ recordList }) { }, { field: 'filename', - headerName: '檔案', + headerName: intl.formatMessage({id: 'files'}), flex: 1, renderCell: (params) => { return ; diff --git a/src/pages/DemandNote/Search_Public/SearchForm.js b/src/pages/DemandNote/Search_Public/SearchForm.js index d9e87cb..cd5f59b 100644 --- a/src/pages/DemandNote/Search_Public/SearchForm.js +++ b/src/pages/DemandNote/Search_Public/SearchForm.js @@ -133,7 +133,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData fullWidth {...register("dnNo")} id='dnNo' - label="繳款單號" + label={intl.formatMessage({id: 'paymentRecordId'})} defaultValue={searchCriteria.dnNo} InputLabelProps={{ shrink: true @@ -147,7 +147,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData {...register("dateFrom")} id="dateFrom" type="date" - label={"發送日期(從)"} + label={intl.formatMessage({id: 'sendDateFrom'})} defaultValue={searchCriteria.dateFrom} InputProps={{ inputProps: { max: maxDate } }} onChange={(newValue) => { @@ -172,7 +172,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData }} id="dateTo" type="date" - label={"發送日期(到)"} + label={intl.formatMessage({id: 'sendDateTo'})} defaultValue={searchCriteria.dateTo} /> @@ -182,6 +182,7 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData option.labelCht} inputValue={selectedStatus?.labelCht ? selectedStatus?.labelCht : ""} @@ -233,7 +234,9 @@ const SearchDemandNoteForm = ({ applySearch, searchCriteria, issueComboData textTransform: 'capitalize', alignItems: 'end' }}> - 提交 + + + diff --git a/src/pages/DemandNote/Search_Public/index.js b/src/pages/DemandNote/Search_Public/index.js index 35d06c7..8c246f3 100644 --- a/src/pages/DemandNote/Search_Public/index.js +++ b/src/pages/DemandNote/Search_Public/index.js @@ -16,6 +16,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 {FormattedMessage} from "react-intl"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -97,7 +98,9 @@ const UserSearchPage_Individual = () => {
    - 繳款通知記錄 + + +
    diff --git a/src/pages/Payment/Details_Public/PaymentDetails.js b/src/pages/Payment/Details_Public/PaymentDetails.js index e12965d..b7e6037 100644 --- a/src/pages/Payment/Details_Public/PaymentDetails.js +++ b/src/pages/Payment/Details_Public/PaymentDetails.js @@ -35,7 +35,7 @@ const PaymentDetails = ({ formData,doPrint }) => { }, [data]); const getPaymentMethod=()=>{ - let paymentmethod = data.payload.paymentdetail.paymentmethod; + let paymentmethod = data?.payload?.paymentdetail?.paymentmethod; if("01" == paymentmethod) return "PPS"; if("02" == paymentmethod || "03" == paymentmethod) return "Credit Card"; if("04" == paymentmethod) return "FPS"; diff --git a/src/pages/Payment/FPS/AckPage.js b/src/pages/Payment/FPS/AckPage.js index ba0b67c..86eed41 100644 --- a/src/pages/Payment/FPS/AckPage.js +++ b/src/pages/Payment/FPS/AckPage.js @@ -90,7 +90,7 @@ const AckPage = () => { }, onSuccess: function(responseData){ setResponeDataData(responseData) - setPaymentId(responseData.paymentdetail.paymentid) + if (responseData.paymentdetail?.result?.paymentstatuscode === "APPR") { localStorage.removeItem("webtoken"); localStorage.removeItem("transactionid"); @@ -111,6 +111,7 @@ const AckPage = () => { setItemList(responseData2.paymentItemList) setPaymentData(responseData2.data); localStorage.removeItem("paymentId"); + setPaymentId(responseData2.id) } }); } diff --git a/src/pages/Payment/FPS/FPS.js b/src/pages/Payment/FPS/FPS.js index 1c4c0e2..7250439 100644 --- a/src/pages/Payment/FPS/FPS.js +++ b/src/pages/Payment/FPS/FPS.js @@ -176,6 +176,7 @@ const Index = () => { + encodeURIComponent("https://"+window.location.hostname+ '/paymentPage/fps/fpscallback?TRANSACTION_ID='+paymentData.transactionid+"&WEB_TOKEN="+paymentData.webtoken+"&PAYMENT_ID="+localStorage.getItem("paymentId")); setFpsqrcodeurl(openPASGUrl) setFpsqrcodeurlPrd(openPASGUrlPrd) + } }); diff --git a/src/pages/Payment/PaymentCallback.js b/src/pages/Payment/PaymentCallback.js index 987f2cb..1bcdb4d 100644 --- a/src/pages/Payment/PaymentCallback.js +++ b/src/pages/Payment/PaymentCallback.js @@ -113,7 +113,6 @@ const Index = () => { }, onSuccess: function (responseData) { setResponeDataData(responseData) - setPaymentId(responseData.paymentdetail.paymentid) if (responseData.paymentdetail?.result?.paymentstatuscode === "APPR") { localStorage.removeItem("webtoken"); localStorage.removeItem("transactionid"); @@ -134,6 +133,7 @@ const Index = () => { setItemList(responseData2.paymentItemList) setPaymentData(responseData2.data); localStorage.removeItem("paymentId"); + setPaymentId(responseData2.id) } }); } diff --git a/src/pages/PublicNotice/ListPanel/BaseGrid.js b/src/pages/PublicNotice/ListPanel/BaseGrid.js index c5cde6a..7727eee 100644 --- a/src/pages/PublicNotice/ListPanel/BaseGrid.js +++ b/src/pages/PublicNotice/ListPanel/BaseGrid.js @@ -74,7 +74,7 @@ export default function BaseGrid({rows}) { { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn()?"Care Of / 我的備註": intl.formatMessage({id: 'myRemarks'}), + headerName: isORGLoggedIn()? intl.formatMessage({id: 'gazetteCount2_1'}) : intl.formatMessage({id: 'myRemarks'}), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( diff --git a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js index ebdc1d8..e1f2df8 100644 --- a/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js +++ b/src/pages/PublicNotice/ListPanel/PendingPaymentTab.js @@ -160,7 +160,7 @@ export default function SubmittedTab({ rows }) { { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn() ? "Care Of / 我的備註" : intl.formatMessage({id: 'myRemarks'}), + headerName: isORGLoggedIn() ? intl.formatMessage({id: 'gazetteCount2_1'}) : intl.formatMessage({id: 'myRemarks'}), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( diff --git a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js index 2872274..ce1c222 100644 --- a/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js +++ b/src/pages/PublicNotice/ListPanel/SearchPublicNoticeTable.js @@ -77,7 +77,7 @@ export default function SearchPublicNoticeTable({ recordList }) { { id: 'remarks', field: 'remarks', - headerName: isORGLoggedIn()?"Care Of / 我的備註": intl.formatMessage({id: 'myRemarks'}), + headerName: isORGLoggedIn()? intl.formatMessage({id: 'gazetteCount2_1'}) : intl.formatMessage({id: 'myRemarks'}), width: isMdOrLg ? 'auto' : 400, flex: isMdOrLg ? 3 : undefined, renderCell: (params) => ( diff --git a/src/pages/User/ManagePage_OrgPublic/index.js b/src/pages/User/ManagePage_OrgPublic/index.js index 5e505af..b14ec04 100644 --- a/src/pages/User/ManagePage_OrgPublic/index.js +++ b/src/pages/User/ManagePage_OrgPublic/index.js @@ -2,7 +2,7 @@ import { FiDataGrid } from "components/FiDataGrid"; import { - Typography, Button, Grid, Stack + Typography, Button, Grid, Stack, useMediaQuery } from '@mui/material'; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' @@ -13,6 +13,7 @@ import * as HttpUtils from "utils/HttpUtils"; import * as UrlUtils from "utils/ApiPathConst"; import * as DateUtils from "utils/DateUtils"; import {FormattedMessage, useIntl} from "react-intl"; +import {useTheme} from "@emotion/react"; const BackgroundHead = { backgroundImage: `url(${titleBackgroundImg})`, @@ -31,6 +32,8 @@ const BackgroundHead = { const ManageOrgUserPage = () => { const [rows, setRows] = React.useState([]); const intl = useIntl(); + const theme = useTheme(); + const isMdOrLg = useMediaQuery(theme.breakpoints.up('md')); const _sx = { padding: "4 2 4 2", @@ -81,14 +84,16 @@ const ManageOrgUserPage = () => { if (params.row.locked) { return ( <> - {getStatusTag({ color: "#525150", text: "鎖定" })} - + {getStatusTag({ color: "#525150", text: intl.formatMessage({id: 'locked'}) })} + ) } else if (!params.row.verifiedBy) { - return getStatusTag({ color: "#fca503", text: "待批核" }) - } else if (params.row.status == "active") { - return getStatusTag({ color: "#73AD21", text: "生效中" }) + return getStatusTag({ color: "#fca503", text: intl.formatMessage({id: 'pendingFor'}) }) + } else if (params.row.status === "active") { + return getStatusTag({ color: "#73AD21", text: intl.formatMessage({id: 'active'}) }) } return getStatusTag({ text: params.row.status }) } @@ -117,22 +122,25 @@ const ManageOrgUserPage = () => { { id: 'username', field: 'username', - headerName: getHeader('登錄名稱'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'loginName'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, }, { id: 'contactPerson', field: 'contactPerson', - headerName: getHeader('用戶名稱'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'userName'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, }, { id: 'contactTel', field: 'contactTel', - headerName: getHeader('聯絡電話'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'userContactNumber'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { let contactTel = JSON.parse(params.value) return contactTel?.countryCode + " " + contactTel?.phoneNumber; @@ -141,14 +149,16 @@ const ManageOrgUserPage = () => { { id: 'emailBus', field: 'emailBus', - headerName: getHeader('電郵'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'userContactEmail'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, }, { id: 'lastLogin', field: 'lastLogin', - headerName: getHeader('最後登入日期'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'lastLoginDate'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: (params) => { return DateUtils.datetimeStr(params.value); } @@ -156,8 +166,9 @@ const ManageOrgUserPage = () => { { id: 'lastApply', field: 'lastApply', - headerName: getHeader('最後提交申請日期'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'lastSubmissionDate'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, valueGetter: () => { return "--"; } @@ -166,7 +177,8 @@ const ManageOrgUserPage = () => { field: 'actions', type: 'actions', headerName: getHeader(intl.formatMessage({id: 'status'})), - flex: 1, + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, cellClassName: 'actions', getActions: (params) => { return [getStatus(params)] @@ -176,8 +188,9 @@ const ManageOrgUserPage = () => { id: 'primaryUser', field: 'primaryUser', type: 'bool', - headerName: getHeader('Primary'), - flex: 1, + headerName: getHeader(intl.formatMessage({id: 'primary'})), + width: isMdOrLg ? 'auto' : 160, + flex: isMdOrLg ? 1 : undefined, renderCell: (params) => { console.log(params); return ( diff --git a/src/pages/authentication/RegisterCustom.js b/src/pages/authentication/RegisterCustom.js index b64074e..33d236f 100644 --- a/src/pages/authentication/RegisterCustom.js +++ b/src/pages/authentication/RegisterCustom.js @@ -9,7 +9,7 @@ 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 { iAmSmartPath, iAmSmartAppPath, clientId, getBowserType, isAppBowser, iAmSmartCallbackPath} from 'auth/utils' +import { iAmSmartPath, clientId, getBowserType, isAppBowser, iAmSmartCallbackPath} from 'auth/utils' import * as React from 'react'; import {FormattedMessage, useIntl} from "react-intl"; @@ -48,20 +48,17 @@ const RegisterCustom = () => { } const openApp = () => { - setTimeout(function () { - openQR(); - }, 1000); - let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/registrycallback"; - let url = iAmSmartAppPath + "auth" + let callbackUrl = "https://"+iAmSmartCallbackPath()+"/iamsmart/registrycallback"; + let url = iAmSmartPath + "/api/v1/auth/getQR" + "?clientID=" + clientId + "&responseType=code" - + "&source=" + getBowserType() - + "&redirectURI=" + encodeURIComponent(callbackUrl) - + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") - + "&lang=zh-HK"//en-US, zh-HK, or zh-CN + +"&source=" + getBowserType() + +"&redirectURI="+encodeURIComponent(callbackUrl) + +"&scope="+encodeURIComponent("eidapi_auth eidapi_profiles") + +"&lang=zh-HK"//en-US, zh-HK, or zh-CN //+"&state=" - + "&brokerPage=false" - window.location=url; + +"&brokerPage=true" + window.location.assign(url); } return ( diff --git a/src/pages/authentication/auth-forms/AuthLoginCustom.js b/src/pages/authentication/auth-forms/AuthLoginCustom.js index fe4a2af..0784c6a 100644 --- a/src/pages/authentication/auth-forms/AuthLoginCustom.js +++ b/src/pages/authentication/auth-forms/AuthLoginCustom.js @@ -6,7 +6,8 @@ import React, { import { Link as RouterLink } from 'react-router-dom'; import { useNavigate } from 'react-router-dom'; import { useForm, } from 'react-hook-form' -import { iAmSmartPath, iAmSmartAppPath, clientId, getBowserType, isAppBowser, iAmSmartCallbackPath } from 'auth/utils' +import { iAmSmartPath, clientId, getBowserType, isAppBowser, iAmSmartCallbackPath } from 'auth/utils' +//iAmSmartAppPath // material-ui import { @@ -193,11 +194,26 @@ const AuthLoginCustom = () => { } const openApp = () => { - setTimeout(function () { - openQR(); - }, 1000); + // setTimeout(function () { + // openQR(); + // }, 1000); + // let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/authcallback"; + + // let source = getBowserType() + // console.log(source) + // let url = iAmSmartAppPath + "auth" + // + "?clientID=" + clientId + // + "&responseType=code" + // + "&source=" + getBowserType() + // + "&redirectURI=" + encodeURIComponent(callbackUrl) + // + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") + // + "&lang=zh-HK"//en-US, zh-HK, or zh-CN + // //+"&state=" + // + "&brokerPage=true" + // window.location=url; + let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/authcallback"; - let url = iAmSmartAppPath + "auth" + let url = iAmSmartPath + "/api/v1/auth/getQR" + "?clientID=" + clientId + "&responseType=code" + "&source=" + getBowserType() @@ -205,8 +221,9 @@ const AuthLoginCustom = () => { + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") + "&lang=zh-HK"//en-US, zh-HK, or zh-CN //+"&state=" - + "&brokerPage=false" - window.location=url; + + "&brokerPage=true" + window.location=url; + } diff --git a/src/pages/dashboard/Public/Message.js b/src/pages/dashboard/Public/Message.js new file mode 100644 index 0000000..39f5168 --- /dev/null +++ b/src/pages/dashboard/Public/Message.js @@ -0,0 +1,30 @@ +// material-ui +import { + Stack, + Typography +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as React from "react"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const SearchDemandNoteForm = () => { + + return ( + + + + + + + + + ); +}; + +export default SearchDemandNoteForm; diff --git a/src/pages/dashboard/Public/Notice.js b/src/pages/dashboard/Public/Notice.js new file mode 100644 index 0000000..b7a1029 --- /dev/null +++ b/src/pages/dashboard/Public/Notice.js @@ -0,0 +1,31 @@ +// material-ui +import { + Typography, + Stack +} from '@mui/material'; +import MainCard from "components/MainCard"; +import * as React from "react"; + +// ==============================|| DASHBOARD - DEFAULT ||============================== // + + +const SearchDemandNoteForm = () => { + + return ( + + + + + + + + + + ); +}; + +export default SearchDemandNoteForm; diff --git a/src/pages/dashboard/Public/index.js b/src/pages/dashboard/Public/index.js index 1eaa554..1dcc53d 100644 --- a/src/pages/dashboard/Public/index.js +++ b/src/pages/dashboard/Public/index.js @@ -4,13 +4,19 @@ import { Grid, Typography, - Stack + Stack, + Button, + Box } from '@mui/material'; -import { - isORGLoggedIn, -} from "utils/Utils"; +import { isORGLoggedIn, } from "utils/Utils"; import titleBackgroundImg from 'assets/images/dashboard/gazette-bar.png' import {FormattedMessage} from "react-intl"; +import AdsClickRoundedIcon from '@mui/icons-material/AdsClickRounded'; +import * as React from "react"; +import Loadable from 'components/Loadable'; +const Message = Loadable(React.lazy(() => import('./Message'))); +const Notice = Loadable(React.lazy(() => import('./Notice'))); + // ==============================|| DASHBOARD - DEFAULT ||============================== // const DashboardDefault = () => { @@ -20,23 +26,68 @@ const DashboardDefault = () => { backgroundImage: `url(${titleBackgroundImg})`, width: '100%', height: '100%', - backgroundSize:'contain', + backgroundSize: 'contain', backgroundRepeat: 'no-repeat', backgroundColor: '#0C489E', backgroundPosition: 'right' } return ( - +
    {/* 我的公共啟事 */} - + {isORGLoggedIn() ?userData.fullenName:userData.fullchName},
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ); }; diff --git a/src/pages/iAmSmart/AuthCallback/index.js b/src/pages/iAmSmart/AuthCallback/index.js index 5f30bb6..b83ba04 100644 --- a/src/pages/iAmSmart/AuthCallback/index.js +++ b/src/pages/iAmSmart/AuthCallback/index.js @@ -56,9 +56,11 @@ const Index = () => { }, onError:(error)=>{ console.log(error); - //window.location.assign("/iamsmart/loginFail"); + window.location.assign("/iamsmart/loginFail"); } }); + }else{ + window.location.assign("/iamsmart/loginFail"); } } diff --git a/src/pages/iAmSmart/FallCallback/index.js b/src/pages/iAmSmart/DirectLoginCallback/index.js similarity index 78% rename from src/pages/iAmSmart/FallCallback/index.js rename to src/pages/iAmSmart/DirectLoginCallback/index.js index 7716ad5..89208b8 100644 --- a/src/pages/iAmSmart/FallCallback/index.js +++ b/src/pages/iAmSmart/DirectLoginCallback/index.js @@ -18,24 +18,22 @@ const Index = () => { const navigate = useNavigate() React.useEffect(() => { - getPrfile(); + goLogin(); }, []); - function getPrfile(){ + function goLogin(){ dispatch(handleLogoutFunction()); let params = new URLSearchParams(window.location.search) if(params.get("code")){ HttpUtils.post({ - url: UrlUtils.GET_SMART_LOGIN, + url: UrlUtils.GET_SMART_DIRECT_LOGIN, params:{ 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,16 @@ 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); } }); } diff --git a/src/pages/iAmSmart/RegistryCallback/index.js b/src/pages/iAmSmart/RegistryCallback/index.js index 0c03fbe..ab69b32 100644 --- a/src/pages/iAmSmart/RegistryCallback/index.js +++ b/src/pages/iAmSmart/RegistryCallback/index.js @@ -27,14 +27,22 @@ const Index = () => { }, onSuccess: (responseData) => { navigate('/iAmSmartRegisterFrom', { state: { responseData: responseData } }); + }, + onFail: (response)=>{ + console.log("Fail"); + console.log(response); + window.location.assign("/register"); + }, + onError:(error)=>{ + console.log(error); + window.location.assign("/register"); } }); + }else{ + window.location.assign("/register"); } } - - - return ( ); diff --git a/src/routes/LoginRoutes.js b/src/routes/LoginRoutes.js index 0a745f0..b3c7533 100644 --- a/src/routes/LoginRoutes.js +++ b/src/routes/LoginRoutes.js @@ -12,7 +12,8 @@ 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 IAmSmart_FallCallback = Loadable(lazy(() => import('pages/iAmSmart/FallCallback'))); +const IAmSmart_DirectLoginCallback = Loadable(lazy(() => import('pages/iAmSmart/DirectLoginCallback'))); +//const IAmSmart_FallCallback = Loadable(lazy(() => import('pages/iAmSmart/FallCallback'))); const IAmSmart_FailCallback = Loadable(lazy(() => import('pages/iAmSmart/FailCallback'))); const IAmSmart_SuccessCallback = Loadable(lazy(() => import('pages/iAmSmart/SuccessCallback'))); const IAmSmart_AuthCallback = Loadable(lazy(() => import('pages/iAmSmart/AuthCallback'))); @@ -60,11 +61,11 @@ const LoginRoutes = { }, { path: 'iamsmart/logincallback', - element: + element: }, { path: 'iamsmart/loginfallback', - element: + element: }, { path: 'iamsmart/authcallback', diff --git a/src/themes/palette.js b/src/themes/palette.js index 80eda43..ea3f267 100644 --- a/src/themes/palette.js +++ b/src/themes/palette.js @@ -53,6 +53,12 @@ const Palette = (mode) => { paper: paletteColor.grey[0], default: paletteColor.grey.A50 }, + gray: { + main: '#777', + light: '#777', + dark: '#777', + contrastText: '#FFF', + }, white: { main: '#fff', light: '#fff', diff --git a/src/translations/en.json b/src/translations/en.json index 764e308..90f5ac2 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -242,7 +242,7 @@ "cancelled": "Cancelled", "withdrawn": "Withdrawn", "searchApplyRecord": "Search application record", - "applicationId": "Application number", + "applicationId": "Application ID", "submitDate": "Submit date", "submitDateFrom": "Submit date (from)", "submitDateTo": "Submit date (to)", @@ -281,6 +281,7 @@ "applyStatus": "Application Status", "gazetteCount": "Gazette issues number", "gazetteCount2" :"Gazette issues number / Remarks", + "gazetteCount2_1" :"Care Of / Remarks", "gazetteCount3" :"Gazette issues number / Care Of/ Remarks", "publishDate": "Publish date", "draftFile": "Manuscript file", @@ -318,6 +319,29 @@ "transactionTime": "Transaction time", "paymentRefCode": "Payment Reference Number", + "paymentInfoRecord": "Payment Notice Record", + "paymentRecordId": "Payment record number", + "receiptDate": "Issuance date", + "sendDate": "Send date", + "sendDateFrom": "Send date (from)", + "sendDateTo": "Send date (to)", + "files": "File(s)", + "loginName": "Login Name", + "lastLoginDate": "Last login date", + "lastSubmissionDate": "Last submission date", + "locked": "Locked", + "unlock": "Unlock", + "pendingFor": "Pending approval", + "active": "Active", + "primary": "Primary", + + "submitApplication": "Submit public notice application", + "applicationSubheading": "Provide your advertisement content with formatting, proofreading and pricing.", + "announcement": "Announcement", + "viewAllAnnouncement": "Show all announcements", + "systemMessage": "System message", + "viewAllSystemMessage": "Show all messages", + "Dashboard": "Dashboard", "event": "Event" } \ No newline at end of file diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index c7ff027..52aa5cd 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -280,6 +280,7 @@ "applyStatus": "申请状态", "gazetteCount": "宪报期数", "gazetteCount2" :"宪报期数 / 我的备注", + "gazetteCount2_1" :"Care Of / 我的备注", "gazetteCount3" :"宪报期数 / Care Of/ 我的备注", "publishDate": "发布日期", "draftFile": "稿件档案", @@ -317,6 +318,29 @@ "transactionTime": "交易时间", "paymentRefCode": "付款参考号码", + "paymentInfoRecord": "缴款通知记录", + "paymentRecordId": "缴款单号", + "receiptDate": "签发日期", + "sendDate": "发送日期", + "sendDateFrom": "发送日期(从)", + "sendDateTo": "发送日期(到)", + "files": "档案", + "loginName": "登录名称", + "lastLoginDate": "最后登入日期", + "lastSubmissionDate": "最后提交申请日期", + "locked": "锁定", + "unlock": "解锁", + "pendingFor": "待批核", + "active": "生效中", + "primary": "源自", + + "submitApplication": "提交公共启事申请", + "applicationSubheading": "提供你的启事内容作排版,校对及计价。", + "announcement": "公告", + "viewAllAnnouncement": "显示所有公告", + "systemMessage": "系统消息", + "viewAllSystemMessage": "显示所有消息", + "Dashboard": "仪表板", "event": "活动" } \ No newline at end of file diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index ec87245..7442bc4 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -280,6 +280,7 @@ "applyStatus": "申請狀態", "gazetteCount": "憲報期數", "gazetteCount2" :"憲報期數 / 我的備註", + "gazetteCount2_1" :"Care Of / 我的備註", "gazetteCount3" :"憲報期數 / Care Of/ 我的備註", "publishDate": "發佈日期", "draftFile": "稿件檔案", @@ -317,6 +318,29 @@ "transactionTime": "交易時間", "paymentRefCode": "付款參考號碼", + "paymentInfoRecord": "繳款通知記錄", + "paymentRecordId": "繳款單號", + "receiptDate": "簽發日期", + "sendDate": "發送日期", + "sendDateFrom": "發送日期(從)", + "sendDateTo": "發送日期(到)", + "files": "檔案", + "loginName": "登錄名稱", + "lastLoginDate": "最後登入日期", + "lastSubmissionDate": "最後提交申請日期", + "locked": "鎖定", + "unlock": "解鎖", + "pendingFor": "待批核", + "active": "生效中", + "primary": "源自", + + "submitApplication": "提交公共啟事申請", + "applicationSubheading": "提供你的啟事內容作排版,校對及計價。", + "announcement": "公告", + "viewAllAnnouncement": "顯示所有公告", + "systemMessage": "系統消息", + "viewAllSystemMessage": "顯示所有消息", + "Dashboard": "儀表板", "event": "活動" } \ No newline at end of file diff --git a/src/utils/ApiPathConst.js b/src/utils/ApiPathConst.js index 19282fc..a0a8170 100644 --- a/src/utils/ApiPathConst.js +++ b/src/utils/ApiPathConst.js @@ -130,6 +130,7 @@ export const DELETE_EMAIL = apiPath+'/email/delete'; //iAmSmart export const GET_SMART_PROFILE = apiPath+'/smart/getProfile'; //POST export const GET_SMART_LOGIN = apiPath+'/smart/login'; //POST +export const GET_SMART_DIRECT_LOGIN = apiPath+'/smart/directLogin'; //POST //gen report