diff --git a/cope2n-fe/src/locales/en/messages.json b/cope2n-fe/src/locales/en/messages.json index 3e23b83..14c51d8 100644 --- a/cope2n-fe/src/locales/en/messages.json +++ b/cope2n-fe/src/locales/en/messages.json @@ -2,6 +2,7 @@ "Are you sure you want to leave without saving?": "Are you sure you want to leave without saving?", "Back": "Back", "Back to Dashboard": "Back to Dashboard", + "Bad image reason:": "Bad image reason:", "Create New Report": "Create New Report", "Dashboard": "Dashboard", "Date (GMT+8)": "Date (GMT+8)", diff --git a/cope2n-fe/src/locales/vi/messages.json b/cope2n-fe/src/locales/vi/messages.json index 62f6947..664a5da 100644 --- a/cope2n-fe/src/locales/vi/messages.json +++ b/cope2n-fe/src/locales/vi/messages.json @@ -2,6 +2,7 @@ "Are you sure you want to leave without saving?": "Bạn có chắc chắn muốn rời đi mà không lưu lại không?", "Back": "", "Back to Dashboard": "", + "Bad image reason:": "", "Create New Report": "", "Dashboard": "", "Date (GMT+8)": "", diff --git a/cope2n-fe/src/pages/reviews2/FileCard.tsx b/cope2n-fe/src/pages/reviews2/FileCard.tsx index 1e76926..15678cf 100644 --- a/cope2n-fe/src/pages/reviews2/FileCard.tsx +++ b/cope2n-fe/src/pages/reviews2/FileCard.tsx @@ -7,6 +7,7 @@ import { Button, Tag } from 'antd'; const FileCard = ({ file, isSelected, onClick, setIsReasonModalOpen }) => { const fileName = file['File Name']; + const extensionType = fileName.split('.').pop(); let status = true; if (file['Is Required'] && !file['Is Reviewed']) { status = false; @@ -52,6 +53,7 @@ const FileCard = ({ file, isSelected, onClick, setIsReasonModalOpen }) => { {fileName ? fileName.substring(0, 25).replace('temp_', '') : fileName} + {' '}({extensionType}) { const [solution, setSolution] = useState(''); const [otherSolution, setOtherSolution] = useState(''); const [imageLoading, setImageLoading] = useState(false); - + const defaultLayoutPluginInstance = defaultLayoutPlugin(); useEffect(() => { if (reason) { setSolution(counter_measure_map[reason]); @@ -137,8 +137,8 @@ const ReviewPage = () => { setSelectedFileData(fileURL); } else { setSelectedFileData('FAILED_TO_LOAD_FILE'); - setImageLoading(false); } + setImageLoading(false); }; const loadCurrentRequest = (requestIndex) => { @@ -283,10 +283,8 @@ const ReviewPage = () => { }); notification.success({ message: 'Update file success' }); - const requestData = await fetchRequest( - currentRequest?.RequestID, - ); - setCurrentRequest(requestData) + const requestData = await fetchRequest(currentRequest?.RequestID); + setCurrentRequest(requestData); } catch (error) { notification.error({ message: getErrorMessage(error), @@ -472,48 +470,57 @@ const ReviewPage = () => { ))} )} -
- - {selectedFileData === 'FAILED_TO_LOAD_FILE' ? ( -

Failed to load file.

- ) : fileExtension === 'pdf' ? ( - - ) : ( - <> - file setLightBox(true)} - onLoad={() => { - setImageLoading(false); - }} - /> + {selectedFileData === 'FAILED_TO_LOAD_FILE' ? ( +

Failed to load file.

+ ) : fileExtension === 'pdf' ? ( +
+ setImageLoading(false)} + /> +
+ ) : ( +
+ file setLightBox(true)} + onLoad={() => { + setImageLoading(false); + }} + /> - {lightBox && ( - setLightBox(false)} - > - )} - + {lightBox && ( + setLightBox(false)} + > )} - -
+
+ )} +
{ type='primary' shape='default' size='middle' - disabled={currentRequest && currentRequest['Is Reviewed'] } + disabled={currentRequest && currentRequest['Is Reviewed']} style={{ minWidth: '120px', alignSelf: 'flex-end' }} onClick={handleConfirmReview} > @@ -717,7 +724,9 @@ const ReviewPage = () => { style={{ background: shouldRevised ? 'yellow' : '' }} size='small' value={selectedFileDataSource[data]?.[REVIEWED_RESULT]} - onChange={(e) =>handleUpdateFileInField(data, e.target.value)} + onChange={(e) => + handleUpdateFileInField(data, e.target.value) + } />
);