diff --git a/src/components/iAmSmartButton.js b/src/components/iAmSmartButton.js index 3ae9e0c..532ac25 100644 --- a/src/components/iAmSmartButton.js +++ b/src/components/iAmSmartButton.js @@ -25,7 +25,7 @@ export function IAmSmartButton({ label, onClickFun, fullWidth }) { return ( diff --git a/src/pages/authentication/RegisterCustom.js b/src/pages/authentication/RegisterCustom.js index adfc4e2..3ce91a4 100644 --- a/src/pages/authentication/RegisterCustom.js +++ b/src/pages/authentication/RegisterCustom.js @@ -154,7 +154,7 @@ const RegisterCustom = () => { }, }} > - + @@ -164,7 +164,7 @@ const RegisterCustom = () => { - + diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index bd33fd4..4b61337 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -343,6 +343,10 @@ const BusCustomFormWizard = (props) => { } + if (fileInputRef.current) { + fileInputRef.current.value = ''; + } + }, [updateRows]); const handleBrNo = (brNo) => { @@ -396,6 +400,8 @@ const BusCustomFormWizard = (props) => { setFileListData(saveFileList) setFileList(updatedFileList); + setUpdateRows(saveFileList); + event.target.value = ''; }; useEffect(() => { @@ -815,6 +821,7 @@ const BusCustomFormWizard = (props) => { endAdornment={ { endAdornment={ { - { onCaptchaChange() }}> + { onCaptchaChange() }}> diff --git a/src/pages/authentication/auth-forms/CustomFormWizard.js b/src/pages/authentication/auth-forms/CustomFormWizard.js index 4d624b3..0e31fa3 100644 --- a/src/pages/authentication/auth-forms/CustomFormWizard.js +++ b/src/pages/authentication/auth-forms/CustomFormWizard.js @@ -432,6 +432,10 @@ const CustomFormWizard = (props) => { } + if (fileInputRef.current) { + fileInputRef.current.value = ''; + } + }, [updateRows]); const handleFileUpload = (event) => { @@ -473,6 +477,8 @@ const CustomFormWizard = (props) => { setFileListData(saveFileList) setFileList(updatedFileList); + setUpdateRows(saveFileList); + event.target.value = ''; }; useEffect(() => { @@ -1033,6 +1039,7 @@ const CustomFormWizard = (props) => { endAdornment={ { endAdornment={ { - { onCaptchaChange() }}> + { onCaptchaChange() }}> @@ -2107,6 +2115,7 @@ const CustomFormWizard = (props) => { { setRows(recordList); - // console.log(disableDelete); }, [recordList]); - function NoRowsOverlay() { + const handleCancelClick = (id) => { + setRows((prevRows) => { + const newRows = prevRows.filter((row) => row.id !== id); + setUpdateRows(newRows); + return newRows; + }); + }; + + const formatFileSize = (size) => `${Math.ceil(size / 1024)} KB`; + + if (rows.length === 0) { return ( - + - {/*
(rows={[]})
*/} -
+ ); } - const handleCancelClick = (id) => () => { - setRowModesModel({ - ...rowModesModel, - [id]: { mode: GridRowModes.View, ignoreModifications: true }, - }); - // console.log("Starting Delete") - // const editedRow = rows.find((row) => row.id === id); - // console.log(editedRow) - // console.log(editedRow.isNew) - setUpdateRows(rows.filter((row) => row.id !== id)); - setRows(rows.filter((row) => row.id !== id)); - } - - const columns = [ - { - field: 'actions', - type: 'actions', - headerName: '', - width: 30, - cellClassName: 'actions', - // hide:true, - getActions: ({ id }) => { - return [ - } - label="delete" - className="textPrimary" - onClick={handleCancelClick(id)} - color="error" - />] - }, - }, - { - id: 'name', - field: 'name', - headerName: intl.formatMessage({ id: 'fileName' }), - flex: 4, - }, - { - id: 'size', - field: 'size', - headerName: intl.formatMessage({ id: 'fileSize' }), - valueGetter: (params) => { - // console.log(params) - return Math.ceil(params.value / 1024) + " KB"; - }, - flex: 2, - }, - ]; - return ( - - "auto"} - /> + + + + + + {intl.formatMessage({ id: 'fileName' })} + {intl.formatMessage({ id: 'fileSize' })} + + + + {rows.map((row) => ( + + + handleCancelClick(row.id)} + > + + + + + + {row.name} + + + + {formatFileSize(row.size)} + + + ))} + +
); } diff --git a/src/pages/dashboard/Public/Notice.js b/src/pages/dashboard/Public/Notice.js index c53eae8..2b6e7bb 100644 --- a/src/pages/dashboard/Public/Notice.js +++ b/src/pages/dashboard/Public/Notice.js @@ -32,7 +32,7 @@ const SearchDemandNoteForm = (props) => { listData.map((item, index) => { list.push( - {locale === 'en' ?item.subjectEng:locale === 'zh-HK' ?item.subjectCht:item.subjectChs} + {locale === 'en' ?item.subjectEng:locale === 'zh-HK' ?item.subjectCht:item.subjectChs} {DateUtils.dateValue(item.announceDate)} {locale === 'en' ?item.contentEng:locale === 'zh-HK' ?item.contentCht:item.contentChs} diff --git a/src/translations/en.json b/src/translations/en.json index 194e47f..ee19f9b 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -528,6 +528,7 @@ "submitReply": "Submit", "requiredUploadFix": "Please upload the modified file of the manuscript", "upload": "Upload", + "delete": "Delete", "actionFail": "Action failed: Please check the content and submit the reply again", "issueInvalidMsg": "Application for the selected publication volume has been closed. Please choose another volume to apply again.", "singleCol":"Single Column", diff --git a/src/translations/zh-CN.json b/src/translations/zh-CN.json index 100b61f..2cf4712 100644 --- a/src/translations/zh-CN.json +++ b/src/translations/zh-CN.json @@ -524,6 +524,7 @@ "submitReply": "提交回复", "requiredUploadFix": "请上载稿件修改的档案", "upload": "上载", + "delete": "删除", "actionFail": "行动失败: 请检查内容并再次提交回复", "issueInvalidMsg": "所选刊登期数已截稿,请选择另一期重新申请。", "singleCol":"一格位", diff --git a/src/translations/zh-HK.json b/src/translations/zh-HK.json index 2af3014..d145a57 100644 --- a/src/translations/zh-HK.json +++ b/src/translations/zh-HK.json @@ -525,6 +525,7 @@ "submitReply": "提交回覆", "requiredUploadFix": "請上載稿件修改的檔案", "upload": "上載", + "delete": "刪除", "actionFail": "行動失敗: 請檢查內容並再次提交回覆", "issueInvalidMsg": "所選刊登期數已截稿,請選擇另一期重新申請。", "singleCol":"一格位",