improve some ui
This commit is contained in:
parent
58c2c2d447
commit
a9ae654957
@ -41,6 +41,7 @@
|
||||
"history": "^5.3.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"mousetrap": "^1.6.5",
|
||||
"openseadragon": "^4.1.1",
|
||||
"pdfjs-dist": "^3.11.174",
|
||||
"process": "^0.11.10",
|
||||
"react": "^18.3.1",
|
||||
|
@ -8,10 +8,9 @@ import { Button, Tag } from 'antd';
|
||||
const FileCard = ({ file, isSelected, onClick }) => {
|
||||
const fileName = file['File Name'];
|
||||
const extensionType = fileName.split('.').pop();
|
||||
let status = true;
|
||||
if (file['Is Required'] && !file['Is Reviewed']) {
|
||||
status = false;
|
||||
}
|
||||
const isRequired = file['Is Required'];
|
||||
const isReviewd = file['Is Reviewed'];
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@ -52,20 +51,29 @@ const FileCard = ({ file, isSelected, onClick }) => {
|
||||
>
|
||||
{fileName
|
||||
? fileName.substring(0, 25).replace('temp_', '')
|
||||
: fileName}
|
||||
{' '}({extensionType})
|
||||
: fileName}{' '}
|
||||
({extensionType})
|
||||
</span>
|
||||
</div>
|
||||
<div style={{display: 'flex', justifyContent: 'space-between', alignItems:'center'}}>
|
||||
<Tag
|
||||
color={status ? 'success' : 'warning'}
|
||||
icon={
|
||||
status ? <CheckCircleOutlined /> : <ExclamationCircleOutlined />
|
||||
}
|
||||
style={{ display: 'inline-block', fontWeight: 'bold' }}
|
||||
color={isRequired ? 'warning' : ''}
|
||||
style={{ display: 'inline-block', fontWeight: 'bold' , textTransform: 'capitalize' }}
|
||||
// bordered={false}
|
||||
>
|
||||
{status ? 'Good' : 'Warning'}{' '}
|
||||
Required: {isRequired.toString()}
|
||||
</Tag>
|
||||
|
||||
|
||||
<Tag
|
||||
color={isReviewd ? 'success' : 'warning'}
|
||||
style={{ display: 'inline-block', fontWeight: 'bold', textTransform: 'capitalize' }}
|
||||
// bordered={false}
|
||||
>
|
||||
Reviewed: {isReviewd.toString()}
|
||||
</Tag>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
style={{
|
||||
|
@ -56,7 +56,7 @@ export const updateRevisedData = async (requestID: any) => {
|
||||
console.log(error);
|
||||
throw error;
|
||||
});
|
||||
if (result.status != 200) {
|
||||
if (!result.ok) {
|
||||
throw new Error('Could not update revised data');
|
||||
}
|
||||
};
|
||||
|
@ -53,6 +53,8 @@ import {
|
||||
} from './const';
|
||||
import FileCard from './FileCard';
|
||||
import RecentRequest from './RecentRequest';
|
||||
import './style.css';
|
||||
|
||||
const ReviewPage = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [fullscreen, setFullscreen] = useState(false);
|
||||
@ -137,14 +139,20 @@ const ReviewPage = () => {
|
||||
SOURCE_OBJECT_NAMES.forEach((name) => {
|
||||
tempData[k][name] = fileContent[name][k];
|
||||
});
|
||||
if (
|
||||
(isEmpty(tempData[k][REVIEWED_RESULT]) ||
|
||||
(tempData[k][REVIEWED_RESULT].length == 1 &&
|
||||
isEmpty(tempData[k][REVIEWED_RESULT][0]))) &&
|
||||
!isEmpty(tempData[k][PREDICTED_RESULT])
|
||||
) {
|
||||
if (!isEmpty(tempData[k][PREDICTED_RESULT])) {
|
||||
let isEmptyResult = false;
|
||||
if (isEmpty(tempData[k][REVIEWED_RESULT])) {
|
||||
isEmptyResult = true;
|
||||
}
|
||||
if (tempData[k][REVIEWED_RESULT].length > 0) {
|
||||
isEmptyResult = tempData[k][REVIEWED_RESULT].every((r: any) =>
|
||||
isEmpty(r),
|
||||
);
|
||||
}
|
||||
if (isEmptyResult) {
|
||||
tempData[k][REVIEWED_RESULT] = tempData[k][PREDICTED_RESULT];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setSelectedFileDataSource(tempData);
|
||||
@ -277,8 +285,8 @@ const ReviewPage = () => {
|
||||
);
|
||||
if (isConfirmed) {
|
||||
try {
|
||||
addRecentRequest(currentRequest?.RequestID);
|
||||
await updateRevisedData(currentRequest?.RequestID);
|
||||
addRecentRequest(currentRequest?.RequestID);
|
||||
setCurrentRequest({
|
||||
...currentRequest,
|
||||
['Is Reviewed']: true,
|
||||
@ -327,6 +335,8 @@ const ReviewPage = () => {
|
||||
// use left/right keys to navigate
|
||||
useHotkeys('left', gotoPreviousRequest);
|
||||
useHotkeys('right', gotoNextRequest);
|
||||
useHotkeys('u', submitRevisedData);
|
||||
useHotkeys('c', handleConfirmReview);
|
||||
|
||||
const fileExtension = selectedFileName
|
||||
? selectedFileName.split('.').pop()
|
||||
@ -527,13 +537,12 @@ const ReviewPage = () => {
|
||||
overflowX: 'visible',
|
||||
}}
|
||||
>
|
||||
<Spin spinning={imageLoading}>
|
||||
<Spin spinning={imageLoading} wrapperClassName='image-spin'>
|
||||
<img
|
||||
style={{
|
||||
maxHeight: '100%',
|
||||
maxWidth: '100%',
|
||||
height: 'auto',
|
||||
width: 'auto',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
objectFit: 'contain',
|
||||
cursor: 'zoom-in',
|
||||
}}
|
||||
src={selectedFileData}
|
||||
@ -666,7 +675,7 @@ const ReviewPage = () => {
|
||||
style={{ minWidth: '120px' }}
|
||||
onClick={handleConfirmReview}
|
||||
>
|
||||
Confirm request
|
||||
(C) Confirm request
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@ -721,7 +730,7 @@ const ReviewPage = () => {
|
||||
}
|
||||
} catch (error) {}
|
||||
return (
|
||||
<div style={{ margin: '0 0 8px' }}>
|
||||
<div style={{ margin: '0 0 8px' }} className='file-input-group'>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
@ -828,7 +837,7 @@ const ReviewPage = () => {
|
||||
}}
|
||||
onClick={submitRevisedData}
|
||||
>
|
||||
Update File
|
||||
(U) Update File
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user