Merge branch 'release/v2.5.0'
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard"
|
||||
NEXT_PUBLIC_API_VERSION = "2.4.1"
|
||||
NEXT_PUBLIC_API_VERSION = "2.5.0"
|
||||
NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa"
|
||||
NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"
|
||||
|
||||
NEXT_PUBLIC_PRIMARY_MAIN = "#084070"
|
||||
NEXT_PUBLIC_SECONDARY_MAIN = "#FF4E00"
|
||||
|
||||
NEXT_PUBLIC_FACILITY_BANK = 33
|
||||
NEXT_PUBLIC_FACILITY_PERSON = 10
|
||||
|
||||
NEXT_PUBLIC_BASE_URL = "https://loan-v2.witel.ir"
|
||||
NEXT_PUBLIC_POWERED_BY_URL = "https://witel.ir"
|
||||
|
||||
|
||||
@@ -1,85 +1,72 @@
|
||||
import UploadSystem from "@/core/components/UploadSystem";
|
||||
import useNotification from "@/lib/app/hooks/useNotification";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import {
|
||||
Button,
|
||||
DialogActions,
|
||||
DialogContent,
|
||||
FormHelperText,
|
||||
Stack,
|
||||
TextField,
|
||||
Typography
|
||||
} from "@mui/material"
|
||||
import {useFormik} from "formik";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {CONFIRM_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
||||
import {useState} from "react";
|
||||
import { Button, DialogActions, DialogContent, FormHelperText, Stack, TextField, Typography } from "@mui/material";
|
||||
import { useFormik } from "formik";
|
||||
import { useTranslations } from "next-intl";
|
||||
import { CONFIRM_PASSENGER_BOSS } from "@/core/data/apiRoutes";
|
||||
import { useState } from "react";
|
||||
import PriceField from "@/core/components/PriceField";
|
||||
import * as Yup from "yup";
|
||||
import SelectBox from "@/core/components/SelectBox";
|
||||
import {useConfig} from "@/lib/app/hooks/useConfig";
|
||||
import { useConfig } from "@/lib/app/hooks/useConfig";
|
||||
|
||||
const vehicle_amount = {
|
||||
"اتوبوس": 7000,
|
||||
اتوبوس: 7000,
|
||||
"مینی بوس": 2000,
|
||||
}
|
||||
};
|
||||
|
||||
const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) => {
|
||||
const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog, vehicle_type }) => {
|
||||
const t = useTranslations();
|
||||
const [expertImg, setExpertImg] = useState("");
|
||||
const [expertFileType, setExpertFileType] = useState(null);
|
||||
const [expertFileName, setExpertFileName] = useState(null);
|
||||
const [showExpertAddIcon, setShowExpertAddIcon] = useState(true);
|
||||
const requestServer = useRequest({auth: true, notification: false})
|
||||
const {update_notification} = useNotification();
|
||||
const {config} = useConfig()
|
||||
const requestServer = useRequest({ auth: true, notification: false });
|
||||
const { update_notification } = useNotification();
|
||||
const { config } = useConfig();
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
approved_amount: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.approved_amount_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("max-amount", `${t("PassengerBoss.max_amount", {value: parseInt(vehicle_amount[vehicle_type]).toLocaleString('en')})}`,
|
||||
(value) => value <= vehicle_amount[vehicle_type])
|
||||
approved_amount: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.approved_amount_number")}`, (value) => !isNaN(value))
|
||||
.test(
|
||||
"max-amount",
|
||||
`${t("PassengerBoss.max_amount", {
|
||||
value: parseInt(vehicle_amount[vehicle_type]).toLocaleString("en"),
|
||||
})}`,
|
||||
(value) => value <= vehicle_amount[vehicle_type]
|
||||
)
|
||||
.test("positive", `${t("ConfirmDialog.approved_amount_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.approved_amount_error")),
|
||||
repayment_period: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.repayment_period_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
|
||||
repayment_period: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.repayment_period_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("ConfirmDialog.repayment_period_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.repayment_period_error")),
|
||||
committed_employment: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.committed_employment_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
|
||||
committed_employment: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.committed_employment_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("ConfirmDialog.committed_employment_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.committed_employment_error")),
|
||||
existing_employment: Yup.mixed().test(
|
||||
"is-number",
|
||||
`${t("ConfirmDialog.existing_employment_number")}`,
|
||||
(value) => !isNaN(value)
|
||||
).test("positive", `${t("ConfirmDialog.existing_employment_positive")}`, (value) => value >= 0)
|
||||
existing_employment: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.existing_employment_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("ConfirmDialog.existing_employment_positive")}`, (value) => value >= 0)
|
||||
.required(t("ConfirmDialog.existing_employment_error")),
|
||||
sakht_period: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.sakht_period_number")}`,
|
||||
(value) => !isNaN(value))
|
||||
.test("is-number", `${t("ConfirmDialog.sakht_period_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("ConfirmDialog.sakht_period_positive")}`, (value) => value > 0)
|
||||
.required(t("ConfirmDialog.sakht_period_error")),
|
||||
tanafos_period: Yup.mixed()
|
||||
.test("is-number", `${t("ConfirmDialog.tanafos_period_number")}`,
|
||||
(value) => !isNaN(value))
|
||||
.test("is-number", `${t("ConfirmDialog.tanafos_period_number")}`, (value) => !isNaN(value))
|
||||
.test("positive", `${t("ConfirmDialog.tanafos_period_positive")}`, (value) => value > 0)
|
||||
.required(t("ConfirmDialog.tanafos_period_error")),
|
||||
expert_img: Yup.mixed()
|
||||
.required(t("PassengerBoss.upload_expert_file_required"))
|
||||
.test('fileSize', `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
|
||||
.test("fileSize", `${t("PassengerBoss.upload_expert_file_unit")}`, (value) => {
|
||||
return value.size <= 5 * 1024 * 1024;
|
||||
})
|
||||
.test('fileType', `${t("PassengerBoss.upload_expert_file_format")}`, (value) => {
|
||||
const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf'];
|
||||
.test("fileType", `${t("PassengerBoss.upload_expert_file_format")}`, (value) => {
|
||||
const allowedTypes = ["image/jpg", "image/jpeg", "image/png", "application/pdf"];
|
||||
return allowedTypes.includes(value.type);
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
const formik = useFormik({
|
||||
@@ -96,8 +83,9 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
tanafos_period: "",
|
||||
existing_employment: "",
|
||||
expert_img: null,
|
||||
}, validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, { setSubmitting }) => {
|
||||
const formData = new FormData();
|
||||
formData.append("approved_amount", Number(values.approved_amount) * 1000000);
|
||||
formData.append("facility_bank", Number(values.facility_bank) * 1000000);
|
||||
@@ -115,8 +103,8 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
const attachments = [
|
||||
{
|
||||
title: "فایل ضمیمه گزارش کارشناس",
|
||||
file: values.expert_img
|
||||
}
|
||||
file: values.expert_img,
|
||||
},
|
||||
];
|
||||
attachments.forEach((attachment, index) => {
|
||||
formData.append(`attachment[${index}][title]`, attachment.title);
|
||||
@@ -124,17 +112,19 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
});
|
||||
}
|
||||
|
||||
requestServer(`${CONFIRM_PASSENGER_BOSS}/${rowId}`, 'post', {
|
||||
requestServer(`${CONFIRM_PASSENGER_BOSS}/${rowId}`, "post", {
|
||||
notification: true,
|
||||
data: formData,
|
||||
}).then((response) => {
|
||||
setOpenConfirmDialog(false)
|
||||
mutate()
|
||||
update_notification()
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
setSubmitting(false);
|
||||
});
|
||||
})
|
||||
.then((response) => {
|
||||
setOpenConfirmDialog(false);
|
||||
mutate();
|
||||
update_notification();
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
setSubmitting(false);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -148,19 +138,28 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
setExpertFileName(fileName);
|
||||
formik.setFieldValue("expert_img", uploadedFile).then(() => {
|
||||
formik.setFieldTouched("expert_img", true);
|
||||
})
|
||||
});
|
||||
setShowExpertAddIcon(false);
|
||||
}
|
||||
};
|
||||
const handleAmountChange = (event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("approved_amount", event.target.value).then(() => {
|
||||
formik.setFieldValue("facility_bank", parseInt((config.facility_bank / 100) * event.target.value, 10))
|
||||
formik.setFieldValue("facility_gov", parseInt((config.facility_gov / 100) * event.target.value, 10))
|
||||
formik.setFieldValue("facility_person", parseInt((config.facility_person / 100) * event.target.value, 10))
|
||||
})
|
||||
formik.setFieldValue(
|
||||
"facility_bank",
|
||||
parseInt((parseInt(process.env.NEXT_PUBLIC_FACILITY_BANK) / 100) * event.target.value, 10)
|
||||
);
|
||||
formik.setFieldValue(
|
||||
"facility_gov",
|
||||
parseInt(((100 - parseInt(process.env.NEXT_PUBLIC_FACILITY_BANK)) / 100) * event.target.value, 10)
|
||||
);
|
||||
formik.setFieldValue(
|
||||
"facility_person",
|
||||
parseInt((parseInt(process.env.NEXT_PUBLIC_FACILITY_PERSON) / 100) * event.target.value, 10)
|
||||
);
|
||||
});
|
||||
} else {
|
||||
formik.setFieldValue("approved_amount", formik.values.approved_amount)
|
||||
formik.setFieldValue("approved_amount", formik.values.approved_amount);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -173,20 +172,28 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
name="description"
|
||||
multiline
|
||||
rows={8}
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.description")}</span>
|
||||
<small>{t("ConfirmDialog.optional")}</small>
|
||||
</>
|
||||
}
|
||||
value={formik.values.description}
|
||||
onChange={formik.handleChange}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{mt: 1}}
|
||||
sx={{ mt: 1 }}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="approved_amount"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.approved_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.approved_amount")}</span>
|
||||
<small>{t("ConfirmDialog.unit")}</small>
|
||||
</>
|
||||
}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
@@ -197,22 +204,21 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
value={formik.values.approved_amount}
|
||||
onChange={handleAmountChange}
|
||||
onBlur={formik.handleBlur("approved_amount")}
|
||||
error={
|
||||
formik.touched.approved_amount &&
|
||||
Boolean(formik.errors.approved_amount)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.approved_amount && formik.errors.approved_amount
|
||||
}
|
||||
sx={{mt: 1}}
|
||||
error={formik.touched.approved_amount && Boolean(formik.errors.approved_amount)}
|
||||
helperText={formik.touched.approved_amount && formik.errors.approved_amount}
|
||||
sx={{ mt: 1 }}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="facility_bank"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.facility_bank")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.facility_bank")}</span>
|
||||
<small>{t("ConfirmDialog.unit")}</small>
|
||||
</>
|
||||
}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
@@ -228,8 +234,12 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="facility_gov"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.facility_gov")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.facility_gov")}</span>
|
||||
<small>{t("ConfirmDialog.unit")}</small>
|
||||
</>
|
||||
}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
@@ -245,8 +255,12 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
<Stack>
|
||||
<PriceField
|
||||
name="facility_person"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.facility_person")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.facility_person")}</span>
|
||||
<small>{t("ConfirmDialog.unit")}</small>
|
||||
</>
|
||||
}
|
||||
variant="outlined"
|
||||
value={formik.values.facility_person}
|
||||
disabled
|
||||
@@ -256,8 +270,12 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
<Stack>
|
||||
<TextField
|
||||
name="physical_progress"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.physical_progress")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.physical_progress")}</span>
|
||||
<small>{t("ConfirmDialog.optional")}</small>
|
||||
</>
|
||||
}
|
||||
type="text"
|
||||
inputProps={{
|
||||
inputMode: "number",
|
||||
@@ -268,9 +286,9 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
value={formik.values.physical_progress}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("physical_progress", event.target.value)
|
||||
formik.setFieldValue("physical_progress", event.target.value);
|
||||
} else {
|
||||
formik.setFieldValue("physical_progress", formik.values.physical_progress)
|
||||
formik.setFieldValue("physical_progress", formik.values.physical_progress);
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("physical_progress")}
|
||||
@@ -280,17 +298,21 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
<Stack>
|
||||
<SelectBox
|
||||
name="repayment_period"
|
||||
label={<>
|
||||
<span>{t("ConfirmDialog.repayment_period")}</span> <small>{t("ConfirmDialog.month")}</small></>}
|
||||
label={
|
||||
<>
|
||||
<span>{t("ConfirmDialog.repayment_period")}</span>{" "}
|
||||
<small>{t("ConfirmDialog.month")}</small>
|
||||
</>
|
||||
}
|
||||
selectType="repayment_period"
|
||||
selectors={[
|
||||
{id : 0, value : "12", name : "12 ماه"},
|
||||
{id : 1, value : "24", name : "24 ماه"},
|
||||
{id : 2, value : "36", name : "36 ماه"},
|
||||
{id : 3, value : "48", name : "48 ماه"},
|
||||
{id : 4, value : "60", name : "60 ماه"}
|
||||
{ id: 0, value: "12", name: "12 ماه" },
|
||||
{ id: 1, value: "24", name: "24 ماه" },
|
||||
{ id: 2, value: "36", name: "36 ماه" },
|
||||
{ id: 3, value: "48", name: "48 ماه" },
|
||||
{ id: 4, value: "60", name: "60 ماه" },
|
||||
]}
|
||||
schema={{value: "value", name: "name"}}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
select={formik.values.repayment_period}
|
||||
value={formik.values.repayment_period}
|
||||
handleChange={(event) => {
|
||||
@@ -313,38 +335,38 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
{
|
||||
id: 1,
|
||||
value: "1",
|
||||
name: "1 ماه"
|
||||
name: "1 ماه",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "2",
|
||||
name: "2 ماه"
|
||||
name: "2 ماه",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "3",
|
||||
name: "3 ماه"
|
||||
name: "3 ماه",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
value: "4",
|
||||
name: "4 ماه"
|
||||
name: "4 ماه",
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: "5",
|
||||
name: "5 ماه"
|
||||
name: "5 ماه",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
value: "6",
|
||||
name: "6 ماه"
|
||||
}
|
||||
name: "6 ماه",
|
||||
},
|
||||
]}
|
||||
schema={{value: 'value', name: 'name'}}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
select={formik.values.sakht_period}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue('sakht_period', event.target.value)
|
||||
formik.setFieldValue("sakht_period", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.sakht_period && Boolean(formik.errors.sakht_period)}
|
||||
@@ -363,28 +385,28 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
{
|
||||
id: 1,
|
||||
value: "1",
|
||||
name: "1 ماه"
|
||||
name: "1 ماه",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: "2",
|
||||
name: "2 ماه"
|
||||
name: "2 ماه",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: "3",
|
||||
name: "3 ماه"
|
||||
name: "3 ماه",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
value: "4",
|
||||
name: "4 ماه"
|
||||
}
|
||||
name: "4 ماه",
|
||||
},
|
||||
]}
|
||||
schema={{value: 'value', name: 'name'}}
|
||||
schema={{ value: "value", name: "name" }}
|
||||
select={formik.values.tanafos_period}
|
||||
handleChange={(event) => {
|
||||
formik.setFieldValue('tanafos_period', event.target.value)
|
||||
formik.setFieldValue("tanafos_period", event.target.value);
|
||||
}}
|
||||
setFieldTouched={formik.setFieldTouched}
|
||||
error={formik.touched.tanafos_period && Boolean(formik.errors.tanafos_period)}
|
||||
@@ -406,19 +428,14 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
value={formik.values.committed_employment}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("committed_employment", event.target.value)
|
||||
formik.setFieldValue("committed_employment", event.target.value);
|
||||
} else {
|
||||
formik.setFieldValue("committed_employment", formik.values.committed_employment)
|
||||
formik.setFieldValue("committed_employment", formik.values.committed_employment);
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("committed_employment")}
|
||||
error={
|
||||
formik.touched.committed_employment &&
|
||||
Boolean(formik.errors.committed_employment)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.committed_employment && formik.errors.committed_employment
|
||||
}
|
||||
error={formik.touched.committed_employment && Boolean(formik.errors.committed_employment)}
|
||||
helperText={formik.touched.committed_employment && formik.errors.committed_employment}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
@@ -436,19 +453,14 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
value={formik.values.existing_employment}
|
||||
onChange={(event) => {
|
||||
if (!isNaN(event.target.value)) {
|
||||
formik.setFieldValue("existing_employment", event.target.value)
|
||||
formik.setFieldValue("existing_employment", event.target.value);
|
||||
} else {
|
||||
formik.setFieldValue("existing_employment", formik.values.existing_employment)
|
||||
formik.setFieldValue("existing_employment", formik.values.existing_employment);
|
||||
}
|
||||
}}
|
||||
onBlur={formik.handleBlur("existing_employment")}
|
||||
error={
|
||||
formik.touched.existing_employment &&
|
||||
Boolean(formik.errors.existing_employment)
|
||||
}
|
||||
helperText={
|
||||
formik.touched.existing_employment && formik.errors.existing_employment
|
||||
}
|
||||
error={formik.touched.existing_employment && Boolean(formik.errors.existing_employment)}
|
||||
helperText={formik.touched.existing_employment && formik.errors.existing_employment}
|
||||
fullWidth
|
||||
/>
|
||||
</Stack>
|
||||
@@ -465,32 +477,36 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog, vehicle_type}) =>
|
||||
imageAlt={t("app_name")}
|
||||
imageSize={[250, 150]}
|
||||
onBlur={formik.handleBlur("expert_img")}
|
||||
error={
|
||||
formik.touched.expert_img &&
|
||||
Boolean(formik.errors.expert_img)
|
||||
}
|
||||
error={formik.touched.expert_img && Boolean(formik.errors.expert_img)}
|
||||
setShowAddIcon={setShowExpertAddIcon}
|
||||
showAddIcon={showExpertAddIcon}
|
||||
/>
|
||||
<FormHelperText
|
||||
error={Boolean(formik.errors.expert_img)}
|
||||
>
|
||||
<FormHelperText error={Boolean(formik.errors.expert_img)}>
|
||||
{formik.touched.expert_img && formik.errors.expert_img}
|
||||
</FormHelperText>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenConfirmDialog(false)} variant="outlined" color="secondary"
|
||||
disabled={formik.isSubmitting} autoFocus>
|
||||
<Button
|
||||
onClick={() => setOpenConfirmDialog(false)}
|
||||
variant="outlined"
|
||||
color="secondary"
|
||||
disabled={formik.isSubmitting}
|
||||
autoFocus
|
||||
>
|
||||
{t("ConfirmDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}>
|
||||
<Button
|
||||
onClick={formik.handleSubmit}
|
||||
variant="contained"
|
||||
color="primary"
|
||||
disabled={formik.isSubmitting || !formik.dirty || !formik.isValid}
|
||||
>
|
||||
{t("ConfirmDialog.button-confirm")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default ConfirmContent
|
||||
);
|
||||
};
|
||||
export default ConfirmContent;
|
||||
|
||||
Reference in New Issue
Block a user