Преглед изворни кода

incident update

web_access_fix
Jason Chuang пре 2 дана
родитељ
комит
cbe3357883
14 измењених фајлова са 98 додато и 39 уклоњено
  1. +6
    -3
      src/pages/DemandNote/Create/SearchForm.js
  2. +7
    -3
      src/pages/DemandNote/Details/ApplicationDetailCard.js
  3. +6
    -4
      src/pages/DemandNote/Details/DnDetailCard.js
  4. +11
    -8
      src/pages/DemandNote/Search/DataGrid.js
  5. +2
    -2
      src/pages/Proof/Create_FromApp/ProofForm.js
  6. +22
    -3
      src/pages/Proof/Reply_GLD/ApplicationDetails.js
  7. +4
    -2
      src/pages/Proof/Reply_Public/ProofForm.js
  8. +19
    -11
      src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js
  9. +4
    -3
      src/pages/Setting/DrImport/index.js
  10. +1
    -0
      src/pages/authentication/auth-forms/BusCustomFormWizard.js
  11. +1
    -0
      src/pages/authentication/auth-forms/CustomFormWizard.js
  12. +5
    -0
      src/translations/en.json
  13. +5
    -0
      src/translations/zh-CN.json
  14. +5
    -0
      src/translations/zh-HK.json

+ 6
- 3
src/pages/DemandNote/Create/SearchForm.js Прегледај датотеку

@@ -13,7 +13,7 @@ import * as DateUtils from "utils/DateUtils";
import * as UrlUtils from "utils/ApiPathConst";
import * as HttpUtils from "utils/HttpUtils";
import { useNavigate } from "react-router-dom";
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';
import { PNSPS_BUTTON_THEME } from "../../../themes/buttonConst";
import { ThemeProvider } from "@emotion/react";
import { useIntl } from "react-intl";
@@ -118,8 +118,11 @@ const SearchPublicNoticeForm = ({ applySearch, issueComboData, _paymentCount, _p
params: {
"dnIdList": dnIdList
},
onSuccess: function () {
notifyDownloadSuccess();
onResponse: function () {
// 200: browser handles save; no success toast
},
onError: function () {
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
}


+ 7
- 3
src/pages/DemandNote/Details/ApplicationDetailCard.js Прегледај датотеку

@@ -15,11 +15,12 @@ import * as StatusUtils from "utils/statusUtils/PublicNoteStatusUtils";
import * as HttpUtils from "utils/HttpUtils";

import DownloadIcon from '@mui/icons-material/Download';
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';
import { useIntl } from 'react-intl';

// ==============================|| DASHBOARD - DEFAULT ||============================== //
const ApplicationDetailCard = ({ data }) => {
const intl = useIntl();
const [appDetail, setAppDetails] = React.useState({});

React.useEffect(() => {
@@ -33,8 +34,11 @@ const ApplicationDetailCard = ({ data }) => {
fileId: appDetail.appFileId,
skey: appDetail.appSkey,
filename: appDetail.appFilename,
onResponse: function () {},
onError: function () {
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
notifyDownloadSuccess();
};

return (


+ 6
- 4
src/pages/DemandNote/Details/DnDetailCard.js Прегледај датотеку

@@ -14,12 +14,13 @@ import Loadable from 'components/Loadable';
const MainCard = Loadable(React.lazy(() => import('components/MainCard')));

import DownloadIcon from '@mui/icons-material/Download';
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';
import { useIntl } from 'react-intl';


// ==============================|| DASHBOARD - DEFAULT ||============================== //
const DnDetailCard = ({ data }) => {
const intl = useIntl();
const [dnData, setDnData] = React.useState({});

React.useEffect(() => {
@@ -33,8 +34,9 @@ const DnDetailCard = ({ data }) => {
fileId: dnData.fileId,
skey: dnData.skey,
filename: dnData.filename,
onResponse: function () {
notifyDownloadSuccess();
onResponse: function () {},
onError: function () {
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
};


+ 11
- 8
src/pages/DemandNote/Search/DataGrid.js Прегледај датотеку

@@ -13,7 +13,7 @@ import * as FormatUtils from "utils/FormatUtils";
import * as StatusUtils from "utils/statusUtils/DnStatus";
import { useNavigate } from "react-router-dom";
import { FiDataGrid } from "components/FiDataGrid";
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';
import {
DEMAND_NOTE_EXPORT,
DEMAND_NOTE_SEND,
@@ -26,10 +26,11 @@ import * as HttpUtils from "utils/HttpUtils";
import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
import { ThemeProvider } from "@emotion/react";
import { isGrantedAny } from "auth/utils";
import { useIntl } from "react-intl";
// ==============================|| EVENT TABLE ||============================== //

export default function SearchDemandNote({ applySearch, searchCriteria, applyGridOnReady }) {
const intl = useIntl();
const [isConfirmPopUp, setConfirmPopUp] = useState(false);
const [isRevokePopUp, setRevokePopUp] = useState(false);
const [isSendPopUp, setSendPopUp] = useState(false);
@@ -80,8 +81,9 @@ export default function SearchDemandNote({ applySearch, searchCriteria, applyGri
params: {
dnIdList: idList
},
onSuccess: function () {
notifyDownloadSuccess();
onResponse: function () {},
onError: function () {
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
}
@@ -92,11 +94,12 @@ export default function SearchDemandNote({ applySearch, searchCriteria, applyGri
fileId: params.row.fileId,
skey: params.row.skey,
filename: params.row.filename,
onResponse:()=>{
setOnDownload(false)
onResponse: () => {
setOnDownload(false);
},
onError:()=>{
setOnDownload(false)
onError: () => {
setOnDownload(false);
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
};


+ 2
- 2
src/pages/Proof/Create_FromApp/ProofForm.js Прегледај датотеку

@@ -170,8 +170,8 @@ const FormPanel = ({ formData }) => {
msg = "Action Failed: There is already a pending payment and proofreading record for client review."
} else if (msg === "haveProofed") {
msg = "Action Failed: An active proof is already created for this application."
} else if (msg === "applicationNotFound") {
msg = "Application not found."
} else {
msg = intl.formatMessage({ id: msg });
}
setWarningText(msg);
setIsWarningPopUp(true);


+ 22
- 3
src/pages/Proof/Reply_GLD/ApplicationDetails.js Прегледај датотеку

@@ -11,6 +11,7 @@ import {
} from '@mui/material';

import { useFormik } from 'formik';
import { useIntl } from 'react-intl';
import {isGranted} from "auth/utils";
import {useState,useEffect,lazy} from "react";
import * as HttpUtils from "utils/HttpUtils"
@@ -31,10 +32,13 @@ const ApplicationDetailCard = ({
}) => {

const params = useParams();
const intl = useIntl();

const [data, setData] = useState({});
const [cancelPopUp, setCancelPopUp] = useState(false);
const [onDownload, setOnDownload] = useState(false);
const [alertMsg, setAlertMsg] = useState('');
const [showAlert, setShowAlert] = useState(false);

useEffect(() => {
if (formData) {
@@ -97,8 +101,14 @@ const ApplicationDetailCard = ({
setCancelPopUp(false);
HttpUtils.get({
url: UrlUtils.CANCEL_PROOF + "/" + params.id,
onSuccess: function () {
window.location.reload(false);
onSuccess: function (responseData) {
if (responseData && responseData.success === false) {
const msg = responseData.msg ? intl.formatMessage({ id: responseData.msg }) : intl.formatMessage({ id: 'proofAlreadyCancelled' });
setAlertMsg(msg);
setShowAlert(true);
} else {
window.location.reload(false);
}
}
});
}
@@ -189,7 +199,7 @@ const ApplicationDetailCard = ({

<Grid item xs={12} md={9} lg={9} sx={{ display: 'flex', alignItems: 'center' }}>
<FormControl variant="outlined">
{StatusUtils.getStatusByText(data.appStatus)}
{StatusUtils.getStatusByTextEng(data.appStatus, data.creditor)}
</FormControl>
</Grid>
</Grid>
@@ -349,6 +359,15 @@ const ApplicationDetailCard = ({
<Button onClick={() => confirmCancel()}><Typography variant="h5">Confirm</Typography></Button>
</DialogActions>
</Dialog>
<Dialog open={showAlert} onClose={() => setShowAlert(false)}>
<DialogTitle><Typography variant="h3">{intl.formatMessage({ id: 'attention' })}</Typography></DialogTitle>
<DialogContent>
<Typography variant="h4" style={{ padding: '16px' }}>{alertMsg}</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => setShowAlert(false)}><Typography variant="h5">OK</Typography></Button>
</DialogActions>
</Dialog>
</div>
</form>
</MainCard>


+ 4
- 2
src/pages/Proof/Reply_Public/ProofForm.js Прегледај датотеку

@@ -166,14 +166,16 @@ const FormPanel = ({ formData }) => {
onFail: function (response) {
setIsSubmitting(false);
setWarningTitle(intl.formatMessage({ id: "attention" }))
setWarningText(intl.formatMessage({ id: 'actionFail' }));
const msg = response?.data?.msg ? intl.formatMessage({ id: response.data.msg }) : intl.formatMessage({ id: 'actionFail' });
setWarningText(msg);
setIsWarningPopUp(true);
console.log(response);
},
onError: function (error) {
setIsSubmitting(false);
setWarningTitle(intl.formatMessage({ id: "attention" }))
setWarningText(intl.formatMessage({ id: 'actionFail' }));
const msg = error?.response?.data?.msg ? intl.formatMessage({ id: error.response.data.msg }) : intl.formatMessage({ id: 'actionFail' });
setWarningText(msg);
setIsWarningPopUp(true);
console.log(error);
}


+ 19
- 11
src/pages/PublicNotice/Details_GLD/ApplicationDetailCard.js Прегледај датотеку

@@ -33,9 +33,9 @@ import CloseIcon from '@mui/icons-material/Close';
import EditNoteIcon from '@mui/icons-material/EditNote';
import DownloadIcon from '@mui/icons-material/Download';
import ReplayIcon from '@mui/icons-material/Replay';
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';
import { isGrantedAny } from "auth/utils";
// import { useIntl } from "react-intl";
import { useIntl } from "react-intl";

// ==============================|| DASHBOARD - DEFAULT ||============================== //
const ApplicationDetailCard = (
@@ -59,13 +59,15 @@ const ApplicationDetailCard = (
const [mode, setMode] = useState("");

const { register, handleSubmit } = useForm()
// const intl = useIntl();
const intl = useIntl();

const [isWarningPopUp, setIsWarningPopUp] = useState(false);
const [warningText, setWarningText] = useState("");

const [remarksPopUp, setRemarksPopUp] = useState(false);
const [onDownload, setOnDownload] = useState(false);
// eslint-disable-next-line no-unused-vars -- isProofCheckLoading in onProofClick + Button disabled; setIsProofCheckLoading in onProofClick callbacks
const [isProofCheckLoading, setIsProofCheckLoading] = useState(false);

useEffect(() => {
//if user data from parent are not null
@@ -125,12 +127,12 @@ const ApplicationDetailCard = (
fileId: fileDetail?.id,
skey: fileDetail?.skey,
filename: fileDetail?.filename,
onResponse:()=>{
setOnDownload(false)
notifyDownloadSuccess()
onResponse: () => {
setOnDownload(false);
},
onError:()=>{
setOnDownload(false)
onError: () => {
setOnDownload(false);
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
setUploadStatus(true)
@@ -178,10 +180,13 @@ const ApplicationDetailCard = (
};

const onProofClick = () => {
if (isProofCheckLoading) return;
if (applicationDetailData.data.groupNo) {
setIsProofCheckLoading(true);
HttpUtils.get({
url: CHECK_CREATE_PROOF + "/" + currentApplicationDetailData.id,
onSuccess: function (responeData) {
setIsProofCheckLoading(false);
if (responeData.success == true) {
window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer");
window.addEventListener("focus", onFocus)
@@ -191,13 +196,15 @@ const ApplicationDetailCard = (
msg = "Action Failed: There is already a pending payment and proofreading record for client review."
} else if (msg === "haveProofed") {
msg = "Action Failed: An active proof is already created for this application."
} else if (msg === "applicationNotFound") {
msg = "Application not found."
} else {
msg = intl.formatMessage({ id: msg });
}
setWarningText(msg);
setIsWarningPopUp(true);
}
}
},
onFail: () => setIsProofCheckLoading(false),
onError: () => setIsProofCheckLoading(false)
});
} else {
setWarningText("Please generate Gazette Code before Create Proof.");
@@ -258,6 +265,7 @@ const ApplicationDetailCard = (
<Button
// size="large"
variant="contained"
disabled={isProofCheckLoading}
onClick={() => { onProofClick() }}
sx={{
textTransform: 'capitalize',


+ 4
- 3
src/pages/Setting/DrImport/index.js Прегледај датотеку

@@ -9,7 +9,7 @@ import {
Stack, Box,
Dialog, DialogTitle, DialogContent, DialogActions,
} from '@mui/material';
import { notifyDownloadSuccess } from 'utils/CommonFunction';
import { notifyActionError } from 'utils/CommonFunction';

import { FormattedMessage, useIntl } from "react-intl";

@@ -135,8 +135,9 @@ const Index = () => {
onClick={()=>{
HttpUtils.fileDownload({
url: UrlUtils.DR_EXPORT,
onSuccess: ()=>{
notifyDownloadSuccess();
onResponse: () => {},
onError: () => {
notifyActionError(intl.formatMessage({ id: 'downloadFailed' }));
}
});
}}


+ 1
- 0
src/pages/authentication/auth-forms/BusCustomFormWizard.js Прегледај датотеку

@@ -100,6 +100,7 @@ const BusCustomFormWizard = (props) => {
const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false);
const [isValid, setisValid] = useState(false);
const [checkCountry, setCheckCountry] = useState(false);
// eslint-disable-next-line no-unused-vars -- used as ref for hidden file input (ref={fileInputRef}) and in click handlers
const fileInputRef = useRef(null);
const username = document.getElementById("username-login")
const [checkUsername, setCheckUsername] = useState(false);


+ 1
- 0
src/pages/authentication/auth-forms/CustomFormWizard.js Прегледај датотеку

@@ -101,6 +101,7 @@ const CustomFormWizard = (props) => {
const [termsAndConNotAccept, setTermsAndConNotAccept] = useState(false);
const [isValid, setisValid] = useState(false);
const [checkCountry, setCheckCountry] = useState(false);
// eslint-disable-next-line no-unused-vars -- used as ref for hidden file input (ref={fileInputRef}) and in click handlers
const fileInputRef = useRef(null);
const username = document.getElementById("username-login")


+ 5
- 0
src/translations/en.json Прегледај датотеку

@@ -97,6 +97,10 @@
"MSG.plzSelectPaymentMethod": "Please select payment methods",
"MSG.plzSelectApp": "Please select application",
"MSG.actionFail": "Action failed",
"applicationNotFound": "Application not found.",
"applicationStatusChanged": "The application status has changed. Please refresh and try again.",
"proofStatusChanged": "The proof status has changed. Please refresh and try again.",
"proofAlreadyCancelled": "This proof has already been cancelled. Please refresh and try again.",
"MSG.paymentHolded": "Payment for Application Number {appNo} is being processed. In case of unsuccessful payment, please try again after 30 minutes. We apologise for any inconvenience caused.",
"MSG.pay_credity1": "We have received your confirmed application for proofreading and printing instructions regarding application number {appNo}. We will arrange for its publication with in the Year {year}, Volume {issueVolume}, Issue {issueNo} of the Gazette.",
"MSG.pay_credity2": "A General Demand Note will be issued to you 14 calendar days after the publication of the public notice in the Gazette. Please follow the payment instructions on the Demand Note and settle the payment promptly.",
@@ -625,6 +629,7 @@
"captchaAudioServerError": "Audio CAPTCHA is temporarily unavailable. Please refresh the CAPTCHA.",
"captchaExpired": "CAPTCHA expired. Please refresh and try again.",
"connectionError": "Connection error. Please try again.",
"downloadFailed": "Download failed. Please try again.",

"muiClear": "Clear",
"muiClose": "Close",


+ 5
- 0
src/translations/zh-CN.json Прегледај датотеку

@@ -133,6 +133,10 @@
"MSG.plzSelectPaymentMethod": "请选择付款方式",
"MSG.plzSelectApp": "请选择公共启事。",
"MSG.actionFail": "行动失败",
"applicationNotFound": "找不到该申请。",
"applicationStatusChanged": "申请状态已变更。请刷新后再试。",
"proofStatusChanged": "校对状态已变更。请刷新后再试。",
"proofAlreadyCancelled": "此校对已取消。请刷新后再试。",
"MSG.paymentHolded": "申请编号 {appNo}的付款正在处理中,如相关付款未能成功,请于30分钟后再尝试付款,不便之处,敬请原谅。",
"MSG.pay_credity1": "我们已收到申请编号{appNo}的稿件校对确认及可付印指示,并将安排刊登于宪报期数{year} 年{issueVolume} 卷第{issueNo } 期内。",
"MSG.pay_credity2": "宪报刊登后第十四个历日,发出「一般缴款单」通知缴款。请按照缴款单上的指示,依时缴费。",
@@ -621,6 +625,7 @@
"captchaAudioServerError": "语音验证码暂时不可用,请刷新验证码。",
"captchaExpired": "验证码已过期,请刷新后再试。",
"connectionError": "连接错误,请稍后再试。",
"downloadFailed": "下载失败,请稍后再试。",

"muiClear": "清除",
"muiClose": "关闭",


+ 5
- 0
src/translations/zh-HK.json Прегледај датотеку

@@ -133,6 +133,10 @@
"MSG.plzSelectApp": "請選擇公共啟事。",
"MSG.plzSelectPaymentMethod": "請選擇付款方式",
"MSG.actionFail": "行動失敗",
"applicationNotFound": "找不到該申請。",
"applicationStatusChanged": "申請狀態已變更。請重新整理後再試。",
"proofStatusChanged": "校對狀態已變更。請重新整理後再試。",
"proofAlreadyCancelled": "此校對已取消。請重新整理後再試。",
"MSG.paymentHolded": "申請編號 {appNo}的付款正在處理中,如相關付款未能成功,請於30分鐘後再嘗試付款,不便之處,敬請原諒。",
"MSG.pay_credity1": "我們已收到申請編號{appNo}的稿件校對確認及可付印指示,並將安排刊登於憲報 期數 {year} 年 {issueVolume} 卷 第 {issueNo} 期內。",
"MSG.pay_credity2": "此公共啟事申請的費用將於憲報刊登後第十四個曆日,發出「一般繳款單」通知繳款。請按照繳款單上的指示,依時繳費。",
@@ -622,6 +626,7 @@
"captchaAudioServerError": "語音驗證碼暫時無法使用,請重新整理驗證碼。",
"captchaExpired": "驗證碼已過期,請重新整理並再試。",
"connectionError": "連線錯誤,請稍後再試。",
"downloadFailed": "下載失敗,請稍後再試。",

"muiClear": "清除",
"muiClose": "關閉",


Loading…
Откажи
Сачувај