|
|
@@ -5,7 +5,8 @@ import { |
|
|
|
Grid, |
|
|
|
Typography, FormLabel, |
|
|
|
OutlinedInput, |
|
|
|
Stack |
|
|
|
Stack, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
|
} from '@mui/material'; |
|
|
|
const MainCard = Loadable(lazy(() => import('components/MainCard'))); |
|
|
|
import { useForm } from "react-hook-form"; |
|
|
@@ -43,6 +44,9 @@ const ApplicationDetailCard = ( |
|
|
|
|
|
|
|
const { register } = useForm() |
|
|
|
|
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = useState(false); |
|
|
|
const [warningText, setWarningText] = useState(""); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
//if user data from parent are not null |
|
|
|
// console.log(applicationDetailData) |
|
|
@@ -94,8 +98,14 @@ const ApplicationDetailCard = ( |
|
|
|
}; |
|
|
|
|
|
|
|
const onProofClick = () => { |
|
|
|
window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer"); |
|
|
|
window.addEventListener("focus", onFocus) |
|
|
|
if (applicationDetailData.data.groupNo) { |
|
|
|
window.open("/proof/create/" + currentApplicationDetailData.id, "_blank", "noreferrer"); |
|
|
|
window.addEventListener("focus", onFocus) |
|
|
|
}else{ |
|
|
|
setWarningText("Please generate Gazette Code before Create Proof."); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const onFocus = () => { |
|
|
@@ -145,14 +155,14 @@ const ApplicationDetailCard = ( |
|
|
|
spacing={2} |
|
|
|
mb={2} |
|
|
|
> |
|
|
|
{currentApplicationDetailData.status == "submitted"||currentApplicationDetailData.status == "reviewed" ? |
|
|
|
{currentApplicationDetailData.status == "submitted" || currentApplicationDetailData.status == "reviewed" ? |
|
|
|
<> |
|
|
|
<Button |
|
|
|
// size="large" |
|
|
|
variant="contained" |
|
|
|
onClick={reSubmitClick()} |
|
|
|
color="orange" |
|
|
|
> |
|
|
|
> |
|
|
|
<ReplayIcon /> |
|
|
|
<Typography ml={1}> Re-submit</Typography> |
|
|
|
</Button> |
|
|
@@ -481,6 +491,17 @@ const ApplicationDetailCard = ( |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</form> |
|
|
|
<div> |
|
|
|
<Dialog open={isWarningPopUp} onClose={() => setIsWarningPopUp(false)} > |
|
|
|
<DialogTitle>Warning</DialogTitle> |
|
|
|
<DialogContent style={{ display: 'flex', }}> |
|
|
|
<Typography variant="h3" style={{ padding: '16px' }}>{warningText}</Typography> |
|
|
|
</DialogContent> |
|
|
|
<DialogActions> |
|
|
|
<Button onClick={() => setIsWarningPopUp(false)}>OK</Button> |
|
|
|
</DialogActions> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|
</MainCard> |
|
|
|
); |
|
|
|
}; |
|
|
|