Merge branch 'feature/yasi_add_confirmation_check' into 'develop'
Feature/yasi add confirmation check See merge request witel-front-end/loan-facilities/expert!121
This commit is contained in:
@@ -296,7 +296,8 @@
|
||||
"confirm": "ارجاع به مدیر کل",
|
||||
"upload_file_unit": "فایل بارگذاری شده باید حداکثر 2Mb باشد",
|
||||
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||
"excel_report": "گزارش اکسل"
|
||||
"excel_report": "گزارش اکسل",
|
||||
"confirm_text": "فرم الف و ب به رویت و تایید رسید."
|
||||
},
|
||||
"InspectorExpert": {
|
||||
"name": "نام",
|
||||
|
||||
@@ -2,9 +2,10 @@ import UploadSystem from "@/core/components/UploadSystem";
|
||||
import useNotification from "@/lib/app/hooks/useNotification";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import {
|
||||
Button,
|
||||
Box,
|
||||
Button, Checkbox,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
DialogContent, FormControlLabel,
|
||||
FormHelperText,
|
||||
Grid,
|
||||
LinearProgress,
|
||||
@@ -36,6 +37,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
||||
const [detailsList, setDetailsData] = useState(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [isSkeleton, setIsSkeleton] = useState(false);
|
||||
const [checked, setChecked] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
requestServer(`${GET_TRANSPORTATION_ASSISTANCE_DETAILS}/${rowId}`, 'get')
|
||||
@@ -126,6 +128,9 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
||||
setShowAddIcon(false);
|
||||
}
|
||||
};
|
||||
const handleCheckboxChange = (event) => {
|
||||
setChecked(event.target.checked);
|
||||
};
|
||||
|
||||
const renderCustomAccordions = () => {
|
||||
if (detailsList && detailsList.data && detailsList.data.attachment_files) {
|
||||
@@ -214,6 +219,18 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
||||
{formik.touched.confirm_img && formik.errors.confirm_img}
|
||||
</FormHelperText>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={checked}
|
||||
onChange={handleCheckboxChange}
|
||||
color="primary"
|
||||
/>
|
||||
}
|
||||
label={t("TransportationAssistance.confirm_text")}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
@@ -235,7 +252,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, handleSizeChangeCl
|
||||
</Button>
|
||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
||||
disabled={formik.isSubmitting || !formik.isValid ||
|
||||
hasAccordionOpened.some((opened) => !opened)}
|
||||
hasAccordionOpened.some((opened) => !opened) || !checked}
|
||||
>
|
||||
{t("ConfirmDialog.button-confirm")}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user