add warning msg
This commit is contained in:
parent
e7e61bfce3
commit
7501863cfd
@ -26,7 +26,7 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { isEmpty } from 'lodash-es';
|
import { isEmpty } from 'lodash-es';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import Lightbox from 'react-awesome-lightbox';
|
import Lightbox from 'react-awesome-lightbox';
|
||||||
import 'react-awesome-lightbox/build/style.css';
|
import 'react-awesome-lightbox/build/style.css';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
@ -303,7 +303,6 @@ const ReviewPage = () => {
|
|||||||
throw new Error(await res.text());
|
throw new Error(await res.text());
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('🚀 ~ handleConfirmRequest ~ error:', error);
|
|
||||||
addRecentRequest(currentRequest?.RequestID, error, false);
|
addRecentRequest(currentRequest?.RequestID, error, false);
|
||||||
notification.error({
|
notification.error({
|
||||||
message: getErrorMessage(error),
|
message: getErrorMessage(error),
|
||||||
@ -385,6 +384,16 @@ const ReviewPage = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isSafeToConfirm = useMemo(() => {
|
||||||
|
let isSafe = true;
|
||||||
|
isSafe = !currentRequest?.Files.some((file) => {
|
||||||
|
const isRequired = file['Is Required'];
|
||||||
|
const isReviewed = file['Is Reviewed'];
|
||||||
|
return isRequired && !isReviewed;
|
||||||
|
});
|
||||||
|
return isSafe;
|
||||||
|
}, [currentRequest]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={
|
style={
|
||||||
@ -1030,6 +1039,11 @@ const ReviewPage = () => {
|
|||||||
setIsOpenConfirmRequest(false);
|
setIsOpenConfirmRequest(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
{!isSafeToConfirm && (
|
||||||
|
<p style={{ fontWeight: 'bold', color: 'red' }}>
|
||||||
|
There is still at least 1 photo need to be reviewed!{' '}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<p>Are you sure you want to confirm this request is reviewed?</p>
|
<p>Are you sure you want to confirm this request is reviewed?</p>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user