|
|
@@ -6,6 +6,7 @@ import { |
|
|
|
Stack, |
|
|
|
Typography, FormLabel, |
|
|
|
OutlinedInput, |
|
|
|
Dialog, DialogTitle, DialogContent, DialogActions, |
|
|
|
} from '@mui/material'; |
|
|
|
import MainCard from "../../components/MainCard"; |
|
|
|
import * as React from "react"; |
|
|
@@ -41,6 +42,9 @@ const GazetteDetailCard = ( |
|
|
|
const [verified, setVerified] = useState(null); |
|
|
|
const [currentStatus, setCurrentStatus] = useState({}); |
|
|
|
|
|
|
|
const [isWarningPopUp, setIsWarningPopUp] = useState(false); |
|
|
|
const [warningText, setWarningText] = useState(""); |
|
|
|
|
|
|
|
const {register, |
|
|
|
// getValues |
|
|
|
} = useForm() |
|
|
@@ -68,9 +72,19 @@ const GazetteDetailCard = ( |
|
|
|
}, [issueNum]); |
|
|
|
|
|
|
|
const groupDetailClick = () => () => { |
|
|
|
setStatus("genGazetteCode") |
|
|
|
if(gazetteCode==null){ |
|
|
|
setStatus("genGazetteCode"); |
|
|
|
return; |
|
|
|
} |
|
|
|
setWarningText("Gazette Code is already generated, are you sure to re-generate?"); |
|
|
|
setIsWarningPopUp(true); |
|
|
|
}; |
|
|
|
|
|
|
|
const callback =()=>{ |
|
|
|
setIsWarningPopUp(false); |
|
|
|
setStatus("genGazetteCode"); |
|
|
|
} |
|
|
|
|
|
|
|
// useEffect(() => { |
|
|
|
// //upload latest data to parent |
|
|
|
// const values = getValues(); |
|
|
@@ -242,6 +256,18 @@ const GazetteDetailCard = ( |
|
|
|
</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)}>No</Button> |
|
|
|
<Button color="success" onClick={()=>callback()}>Yes</Button> |
|
|
|
</DialogActions> |
|
|
|
</Dialog> |
|
|
|
</div> |
|
|
|
</MainCard> |
|
|
|
); |
|
|
|
}; |
|
|
|