Merge branch 'feature/debug_final_changes' into 'develop'
start a new branch and moved the changes See merge request witel3/loan-facilities-expert!61
This commit is contained in:
@@ -169,7 +169,9 @@
|
|||||||
"button-confirm": "تایید",
|
"button-confirm": "تایید",
|
||||||
"amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
|
"amount_error": "وارد کردن مقدار پیشنهادی الزامیست",
|
||||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||||
"description": "توضیحات",
|
"optional": " (اختیاری)",
|
||||||
|
"unit": " (ریال)",
|
||||||
|
"description": "توضیحات خود را وارد نمائید",
|
||||||
"choose_file": "انتخاب فایل",
|
"choose_file": "انتخاب فایل",
|
||||||
"approved_amount": "مبلغ تصویب شده",
|
"approved_amount": "مبلغ تصویب شده",
|
||||||
"approved_amount_error": "وارد کردن مبلغ تصویب شده الزامیست",
|
"approved_amount_error": "وارد کردن مبلغ تصویب شده الزامیست",
|
||||||
@@ -180,11 +182,15 @@
|
|||||||
"context": "آیا از عدم تایید این آیتم اطمینان دارید؟",
|
"context": "آیا از عدم تایید این آیتم اطمینان دارید؟",
|
||||||
"button-cancel": "بستن",
|
"button-cancel": "بستن",
|
||||||
"button-reject": "عدم تایید",
|
"button-reject": "عدم تایید",
|
||||||
"description": "توضیحات",
|
"description": "توضیحات خود را وارد نمائید",
|
||||||
|
"optional": " (اختیاری)",
|
||||||
"description_error": "وارد کردن توضیحات الزامی است!"
|
"description_error": "وارد کردن توضیحات الزامی است!"
|
||||||
},
|
},
|
||||||
"UploadSystem": {
|
"UploadSystem": {
|
||||||
"upload_file": "آپلود فایل",
|
"upload_file": "فایل خود را بارگذاری کنید",
|
||||||
|
"optional": " (اختیاری)",
|
||||||
|
"upload_file_unit": "حداکثر 2Mb",
|
||||||
|
"upload_file_format": "فرمت قابل قبول : png,jpg,pdf",
|
||||||
"delete": "پاک کردن",
|
"delete": "پاک کردن",
|
||||||
"uploadfile_error": "حجم فایل بیشتر از 2 مگابایت می باشد"
|
"uploadfile_error": "حجم فایل بیشتر از 2 مگابایت می باشد"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import {CONFIRM_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
import {CONFIRM_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
@@ -66,67 +74,78 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("ConfirmDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={<>
|
||||||
onChange={handleDescriptionChange}
|
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||||
fullWidth
|
value={description}
|
||||||
variant="outlined"
|
onChange={handleDescriptionChange}
|
||||||
sx={{mt: 1}}
|
fullWidth
|
||||||
/>
|
variant="outlined"
|
||||||
<TextField
|
sx={{mt: 1}}
|
||||||
name="proposed_amount"
|
/>
|
||||||
label={t("ConfirmDialog.proposed_amount")}
|
</Stack>
|
||||||
type="number"
|
<Stack>
|
||||||
inputProps={{
|
<TextField
|
||||||
min: 0,
|
name="proposed_amount"
|
||||||
inputMode: "numeric",
|
label={<>
|
||||||
pattern: "[0-9]*",
|
<span>{t("ConfirmDialog.proposed_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||||
}}
|
type="number"
|
||||||
variant="outlined"
|
inputProps={{
|
||||||
value={proposedAmount}
|
min: 0,
|
||||||
onChange={handleAmountChange}
|
inputMode: "numeric",
|
||||||
onBlur={formik.handleBlur("proposed_amount")}
|
pattern: "[0-9]*",
|
||||||
error={
|
}}
|
||||||
formik.touched.proposed_amount &&
|
variant="outlined"
|
||||||
Boolean(formik.errors.proposed_amount)
|
value={proposedAmount}
|
||||||
}
|
onChange={handleAmountChange}
|
||||||
helperText={
|
onBlur={formik.handleBlur("proposed_amount")}
|
||||||
formik.touched.proposed_amount && formik.errors.proposed_amount
|
error={
|
||||||
}
|
formik.touched.proposed_amount &&
|
||||||
sx={{mt: 1}}
|
Boolean(formik.errors.proposed_amount)
|
||||||
fullWidth
|
}
|
||||||
/>
|
helperText={
|
||||||
<UploadSystem
|
formik.touched.proposed_amount && formik.errors.proposed_amount
|
||||||
selectedImage={selectedImage}
|
}
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
sx={{mt: 1}}
|
||||||
setselectedImage={setSelectedImage}
|
fullWidth
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
/>
|
||||||
fieldname="confirm_img"
|
</Stack>
|
||||||
fileType={fileType}
|
<Stack>
|
||||||
fileName={fileName}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
imageAlt={t("app_name")}
|
<UploadSystem
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
selectedImage={selectedImage}
|
||||||
setShowAddIcon={setShowAddIcon}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
showAddIcon={showAddIcon}
|
setselectedImage={setSelectedImage}
|
||||||
/>
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
|
fieldname="confirm_img"
|
||||||
|
fileType={fileType}
|
||||||
|
fileName={fileName}
|
||||||
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("ConfirmDialog.button-confirm")}
|
{t("ConfirmDialog.button-confirm")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ConfirmForm;
|
export default ConfirmForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {REJECT_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
import {REJECT_MACHINARY_OFFICE} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -59,45 +68,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("RejectDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={t("RejectDialog.description")}
|
||||||
onChange={handleDescriptionChange}
|
value={description}
|
||||||
onBlur={formik.handleBlur("description")}
|
onChange={handleDescriptionChange}
|
||||||
error={
|
onBlur={formik.handleBlur("description")}
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
error={
|
||||||
}
|
formik.touched.description && Boolean(formik.errors.description)
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
}
|
||||||
fullWidth
|
helperText={formik.touched.description && formik.errors.description}
|
||||||
variant="outlined"
|
fullWidth
|
||||||
sx={{mt: 1}}
|
variant="outlined"
|
||||||
/>
|
sx={{mt: 1}}
|
||||||
<UploadSystem
|
/>
|
||||||
selectedImage={selectedImage}
|
</Stack>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
<Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<UploadSystem
|
||||||
fieldname="reject_img"
|
selectedImage={selectedImage}
|
||||||
fileType={fileType}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
fileName={fileName}
|
setselectedImage={setSelectedImage}
|
||||||
imageAlt={t("app_name")}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
fieldname="reject_img"
|
||||||
setShowAddIcon={setShowAddIcon}
|
fileType={fileType}
|
||||||
showAddIcon={showAddIcon}
|
fileName={fileName}
|
||||||
/>
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("RejectDialog.button-reject")}
|
{t("RejectDialog.button-reject")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -105,4 +121,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default RejectForm;
|
export default RejectForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {CONFIRM_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
import {CONFIRM_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
@@ -11,7 +20,7 @@ import useDirection from "@/lib/app/hooks/useDirection";
|
|||||||
const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const {directionApp} = useDirection();
|
const {directionApp} = useDirection();
|
||||||
const [proposedAmount, setProposedAmount] = useState("");
|
const [approvedAmount, setApprovedAmount] = useState("");
|
||||||
const [description, setDescription] = useState("");
|
const [description, setDescription] = useState("");
|
||||||
const [selectedImage, setSelectedImage] = useState("");
|
const [selectedImage, setSelectedImage] = useState("");
|
||||||
const [fileType, setfileType] = useState(null);
|
const [fileType, setfileType] = useState(null);
|
||||||
@@ -20,19 +29,19 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
|
|
||||||
//formik
|
//formik
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
proposed_amount: Yup.string().required(
|
approved_amount: Yup.string().required(
|
||||||
t("ConfirmDialog.approved_amount_error")
|
t("ConfirmDialog.approved_amount_error")
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
const formik = useFormik({
|
const formik = useFormik({
|
||||||
initialValues: {
|
initialValues: {
|
||||||
proposed_amount: "",
|
approved_amount: "",
|
||||||
description: "",
|
description: "",
|
||||||
},
|
},
|
||||||
validationSchema,
|
validationSchema,
|
||||||
onSubmit: () => {
|
onSubmit: () => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("approved_amount", proposedAmount);
|
formData.append("approved_amount", approvedAmount);
|
||||||
if (description != "") formData.append("expert_description", description);
|
if (description != "") formData.append("expert_description", description);
|
||||||
handleClose();
|
handleClose();
|
||||||
confirmData(CONFIRM_PASSENGER_BOSS, rowId, formData);
|
confirmData(CONFIRM_PASSENGER_BOSS, rowId, formData);
|
||||||
@@ -44,7 +53,7 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
};
|
};
|
||||||
const handleAmountChange = (event) => {
|
const handleAmountChange = (event) => {
|
||||||
if (/^\d*$/.test(event.target.value)) {
|
if (/^\d*$/.test(event.target.value)) {
|
||||||
setProposedAmount(event.target.value);
|
setApprovedAmount(event.target.value);
|
||||||
}
|
}
|
||||||
formik.handleChange(event);
|
formik.handleChange(event);
|
||||||
};
|
};
|
||||||
@@ -68,67 +77,78 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("ConfirmDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={<>
|
||||||
onChange={handleDescriptionChange}
|
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||||
fullWidth
|
value={description}
|
||||||
variant="outlined"
|
onChange={handleDescriptionChange}
|
||||||
sx={{mt: 1}}
|
fullWidth
|
||||||
/>
|
variant="outlined"
|
||||||
<TextField
|
sx={{mt: 1}}
|
||||||
name="proposed_amount"
|
/>
|
||||||
label={t("ConfirmDialog.approved_amount")}
|
</Stack>
|
||||||
type="number"
|
<Stack>
|
||||||
inputProps={{
|
<TextField
|
||||||
min: 0,
|
name="approved_amount"
|
||||||
inputMode: "numeric",
|
label={<>
|
||||||
pattern: "[0-9]*",
|
<span>{t("ConfirmDialog.approved_amount")}</span><small>{t("ConfirmDialog.unit")}</small></>}
|
||||||
}}
|
type="number"
|
||||||
variant="outlined"
|
inputProps={{
|
||||||
value={proposedAmount}
|
min: 0,
|
||||||
onChange={handleAmountChange}
|
inputMode: "numeric",
|
||||||
onBlur={formik.handleBlur("proposed_amount")}
|
pattern: "[0-9]*",
|
||||||
error={
|
}}
|
||||||
formik.touched.proposed_amount &&
|
variant="outlined"
|
||||||
Boolean(formik.errors.proposed_amount)
|
value={approvedAmount}
|
||||||
}
|
onChange={handleAmountChange}
|
||||||
helperText={
|
onBlur={formik.handleBlur("approved_amount")}
|
||||||
formik.touched.proposed_amount && formik.errors.proposed_amount
|
error={
|
||||||
}
|
formik.touched.approved_amount &&
|
||||||
sx={{mt: 1}}
|
Boolean(formik.errors.approved_amount)
|
||||||
fullWidth
|
}
|
||||||
/>
|
helperText={
|
||||||
<UploadSystem
|
formik.touched.approved_amount && formik.errors.approved_amount
|
||||||
selectedImage={selectedImage}
|
}
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
sx={{mt: 1}}
|
||||||
setselectedImage={setSelectedImage}
|
fullWidth
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
/>
|
||||||
fieldname="confirm_img"
|
</Stack>
|
||||||
fileType={fileType}
|
<Stack>
|
||||||
fileName={fileName}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
imageAlt={t("app_name")}
|
<UploadSystem
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
selectedImage={selectedImage}
|
||||||
setShowAddIcon={setShowAddIcon}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
showAddIcon={showAddIcon}
|
setselectedImage={setSelectedImage}
|
||||||
/>
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
|
fieldname="confirm_img"
|
||||||
|
fileType={fileType}
|
||||||
|
fileName={fileName}
|
||||||
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("ConfirmDialog.button-confirm")}
|
{t("ConfirmDialog.button-confirm")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ConfirmForm;
|
export default ConfirmForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {REJECT_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
import {REJECT_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -59,45 +68,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("RejectDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={t("RejectDialog.description")}
|
||||||
onChange={handleDescriptionChange}
|
value={description}
|
||||||
onBlur={formik.handleBlur("description")}
|
onChange={handleDescriptionChange}
|
||||||
error={
|
onBlur={formik.handleBlur("description")}
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
error={
|
||||||
}
|
formik.touched.description && Boolean(formik.errors.description)
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
}
|
||||||
fullWidth
|
helperText={formik.touched.description && formik.errors.description}
|
||||||
variant="outlined"
|
fullWidth
|
||||||
sx={{mt: 1}}
|
variant="outlined"
|
||||||
/>
|
sx={{mt: 1}}
|
||||||
<UploadSystem
|
/>
|
||||||
selectedImage={selectedImage}
|
</Stack>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
<Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<UploadSystem
|
||||||
fieldname="reject_img"
|
selectedImage={selectedImage}
|
||||||
fileType={fileType}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
fileName={fileName}
|
setselectedImage={setSelectedImage}
|
||||||
imageAlt={t("app_name")}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
fieldname="reject_img"
|
||||||
setShowAddIcon={setShowAddIcon}
|
fileType={fileType}
|
||||||
showAddIcon={showAddIcon}
|
fileName={fileName}
|
||||||
/>
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("RejectDialog.button-reject")}
|
{t("RejectDialog.button-reject")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -105,4 +121,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default RejectForm;
|
export default RejectForm;
|
||||||
@@ -2,7 +2,16 @@ import UploadSystem from "@/core/components/UploadSystem";
|
|||||||
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
||||||
import {CONFIRM_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
import {CONFIRM_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
||||||
import useDirection from "@/lib/app/hooks/useDirection";
|
import useDirection from "@/lib/app/hooks/useDirection";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
@@ -54,45 +63,54 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
|
||||||
multiline
|
<TextField
|
||||||
rows={8}
|
name="description"
|
||||||
placeholder={t("ConfirmDialog.description")}
|
multiline
|
||||||
value={description}
|
rows={8}
|
||||||
onChange={handleDescriptionChange}
|
label={<>
|
||||||
onBlur={formik.handleBlur("description")}
|
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||||
fullWidth
|
value={description}
|
||||||
variant="outlined"
|
onChange={handleDescriptionChange}
|
||||||
sx={{mt: 1}}
|
onBlur={formik.handleBlur("description")}
|
||||||
/>
|
fullWidth
|
||||||
<UploadSystem
|
variant="outlined"
|
||||||
selectedImage={selectedImage}
|
sx={{mt: 1}}
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
/>
|
||||||
setselectedImage={setSelectedImage}
|
</Stack>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<Stack>
|
||||||
fieldname="confirm_img"
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
fileType={fileType}
|
<UploadSystem
|
||||||
fileName={fileName}
|
selectedImage={selectedImage}
|
||||||
imageAlt={t("app_name")}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
setselectedImage={setSelectedImage}
|
||||||
setShowAddIcon={setShowAddIcon}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
showAddIcon={showAddIcon}
|
fieldname="confirm_img"
|
||||||
/>
|
fileType={fileType}
|
||||||
|
fileName={fileName}
|
||||||
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("ConfirmDialog.button-confirm")}
|
{t("ConfirmDialog.button-confirm")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ConfirmForm;
|
export default ConfirmForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {REJECT_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
import {REJECT_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -57,45 +66,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("RejectDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={t("RejectDialog.description")}
|
||||||
onChange={handleDescriptionChange}
|
value={description}
|
||||||
onBlur={formik.handleBlur("description")}
|
onChange={handleDescriptionChange}
|
||||||
error={
|
onBlur={formik.handleBlur("description")}
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
error={
|
||||||
}
|
formik.touched.description && Boolean(formik.errors.description)
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
}
|
||||||
fullWidth
|
helperText={formik.touched.description && formik.errors.description}
|
||||||
variant="outlined"
|
fullWidth
|
||||||
sx={{mt: 1}}
|
variant="outlined"
|
||||||
/>
|
sx={{mt: 1}}
|
||||||
<UploadSystem
|
/>
|
||||||
selectedImage={selectedImage}
|
</Stack>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
<Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<UploadSystem
|
||||||
fieldname="reject_img"
|
selectedImage={selectedImage}
|
||||||
fileType={fileType}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
fileName={fileName}
|
setselectedImage={setSelectedImage}
|
||||||
imageAlt={t("app_name")}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
fieldname="reject_img"
|
||||||
setShowAddIcon={setShowAddIcon}
|
fileType={fileType}
|
||||||
showAddIcon={showAddIcon}
|
fileName={fileName}
|
||||||
/>
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("RejectDialog.button-reject")}
|
{t("RejectDialog.button-reject")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -103,4 +119,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default RejectForm;
|
export default RejectForm;
|
||||||
@@ -2,7 +2,16 @@ import UploadSystem from "@/core/components/UploadSystem";
|
|||||||
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
||||||
import {CONFIRM_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
import {CONFIRM_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||||
import useDirection from "@/lib/app/hooks/useDirection";
|
import useDirection from "@/lib/app/hooks/useDirection";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
@@ -54,45 +63,54 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
|
||||||
multiline
|
<TextField
|
||||||
rows={8}
|
name="description"
|
||||||
placeholder={t("ConfirmDialog.description")}
|
multiline
|
||||||
value={description}
|
rows={8}
|
||||||
onChange={handleDescriptionChange}
|
label={<>
|
||||||
onBlur={formik.handleBlur("description")}
|
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||||
fullWidth
|
value={description}
|
||||||
variant="outlined"
|
onChange={handleDescriptionChange}
|
||||||
sx={{mt: 1}}
|
onBlur={formik.handleBlur("description")}
|
||||||
/>
|
fullWidth
|
||||||
<UploadSystem
|
variant="outlined"
|
||||||
selectedImage={selectedImage}
|
sx={{mt: 1}}
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
/>
|
||||||
setselectedImage={setSelectedImage}
|
</Stack>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<Stack>
|
||||||
fieldname="confirm_img"
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
fileType={fileType}
|
<UploadSystem
|
||||||
fileName={fileName}
|
selectedImage={selectedImage}
|
||||||
imageAlt={t("app_name")}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
setselectedImage={setSelectedImage}
|
||||||
setShowAddIcon={setShowAddIcon}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
showAddIcon={showAddIcon}
|
fieldname="confirm_img"
|
||||||
/>
|
fileType={fileType}
|
||||||
|
fileName={fileName}
|
||||||
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("ConfirmDialog.button-confirm")}
|
{t("ConfirmDialog.button-confirm")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ConfirmForm;
|
export default ConfirmForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {REJECT_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
import {REJECT_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -58,45 +67,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("RejectDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={t("RejectDialog.description")}
|
||||||
onChange={handleDescriptionChange}
|
value={description}
|
||||||
onBlur={formik.handleBlur("description")}
|
onChange={handleDescriptionChange}
|
||||||
error={
|
onBlur={formik.handleBlur("description")}
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
error={
|
||||||
}
|
formik.touched.description && Boolean(formik.errors.description)
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
}
|
||||||
fullWidth
|
helperText={formik.touched.description && formik.errors.description}
|
||||||
variant="outlined"
|
fullWidth
|
||||||
sx={{mt: 1}}
|
variant="outlined"
|
||||||
/>
|
sx={{mt: 1}}
|
||||||
<UploadSystem
|
/>
|
||||||
selectedImage={selectedImage}
|
</Stack>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
<Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<UploadSystem
|
||||||
fieldname="reject_img"
|
selectedImage={selectedImage}
|
||||||
fileType={fileType}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
fileName={fileName}
|
setselectedImage={setSelectedImage}
|
||||||
imageAlt={t("app_name")}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
fieldname="reject_img"
|
||||||
setShowAddIcon={setShowAddIcon}
|
fileType={fileType}
|
||||||
showAddIcon={showAddIcon}
|
fileName={fileName}
|
||||||
/>
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("RejectDialog.button-reject")}
|
{t("RejectDialog.button-reject")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
@@ -104,4 +120,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default RejectForm;
|
export default RejectForm;
|
||||||
@@ -1,7 +1,16 @@
|
|||||||
import UploadSystem from "@/core/components/UploadSystem";
|
import UploadSystem from "@/core/components/UploadSystem";
|
||||||
import {CONFIRM_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes";
|
import {CONFIRM_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes";
|
||||||
import useDirection from "@/lib/app/hooks/useDirection";
|
import useDirection from "@/lib/app/hooks/useDirection";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
@@ -51,44 +60,52 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("ConfirmDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={<>
|
||||||
onChange={handleDescriptionChange}
|
<span>{t("ConfirmDialog.description")}</span><small>{t("ConfirmDialog.optional")}</small></>}
|
||||||
fullWidth
|
value={description}
|
||||||
variant="outlined"
|
onChange={handleDescriptionChange}
|
||||||
sx={{mt: 1}}
|
fullWidth
|
||||||
/>
|
variant="outlined"
|
||||||
<UploadSystem
|
sx={{mt: 1}}
|
||||||
selectedImage={selectedImage}
|
/>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
</Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Stack>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
fieldname="confirm_img"
|
<UploadSystem
|
||||||
fileType={fileType}
|
selectedImage={selectedImage}
|
||||||
fileName={fileName}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
imageAlt={t("app_name")}
|
setselectedImage={setSelectedImage}
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
setShowAddIcon={setShowAddIcon}
|
fieldname="confirm_img"
|
||||||
showAddIcon={showAddIcon}
|
fileType={fileType}
|
||||||
/>
|
fileName={fileName}
|
||||||
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("ConfirmDialog.button-confirm")}
|
{t("ConfirmDialog.button-confirm")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default ConfirmForm;
|
export default ConfirmForm;
|
||||||
@@ -1,5 +1,14 @@
|
|||||||
import {REJECT_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes";
|
import {REJECT_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes";
|
||||||
import {Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, TextField,} from "@mui/material";
|
import {
|
||||||
|
Button,
|
||||||
|
Dialog,
|
||||||
|
DialogActions,
|
||||||
|
DialogContent,
|
||||||
|
DialogContentText,
|
||||||
|
DialogTitle,
|
||||||
|
Stack,
|
||||||
|
TextField, Typography,
|
||||||
|
} from "@mui/material";
|
||||||
import {useTranslations} from "next-intl";
|
import {useTranslations} from "next-intl";
|
||||||
import {useFormik} from "formik";
|
import {useFormik} from "formik";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
@@ -57,49 +66,56 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open}>
|
<Dialog fullWidth open={open}
|
||||||
|
PaperProps={{sx: {boxShadow: 'rgba(60, 64, 67, 0.3) 0px 1px 16px 0px, rgba(60, 64, 67, 0.15) 0px 1px 10px 0px'}}}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<Stack spacing={2}>
|
||||||
<TextField
|
<Stack>
|
||||||
name="description"
|
<TextField
|
||||||
multiline
|
name="description"
|
||||||
rows={8}
|
multiline
|
||||||
placeholder={t("RejectDialog.description")}
|
rows={8}
|
||||||
value={description}
|
label={t("RejectDialog.description")}
|
||||||
onChange={handleDescriptionChange}
|
value={description}
|
||||||
onBlur={formik.handleBlur("description")}
|
onChange={handleDescriptionChange}
|
||||||
error={
|
onBlur={formik.handleBlur("description")}
|
||||||
formik.touched.description && Boolean(formik.errors.description)
|
error={
|
||||||
}
|
formik.touched.description && Boolean(formik.errors.description)
|
||||||
helperText={formik.touched.description && formik.errors.description}
|
}
|
||||||
fullWidth
|
helperText={formik.touched.description && formik.errors.description}
|
||||||
variant="outlined"
|
fullWidth
|
||||||
sx={{mt: 1}}
|
variant="outlined"
|
||||||
/>
|
sx={{mt: 1}}
|
||||||
<UploadSystem
|
/>
|
||||||
selectedImage={selectedImage}
|
</Stack>
|
||||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
<Stack>
|
||||||
setselectedImage={setSelectedImage}
|
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
<UploadSystem
|
||||||
fieldname="reject_img"
|
selectedImage={selectedImage}
|
||||||
fileType={fileType}
|
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||||
fileName={fileName}
|
setselectedImage={setSelectedImage}
|
||||||
imageAlt={t("app_name")}
|
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
fieldname="reject_img"
|
||||||
setShowAddIcon={setShowAddIcon}
|
fileType={fileType}
|
||||||
showAddIcon={showAddIcon}
|
fileName={fileName}
|
||||||
/>
|
imageAlt={t("app_name")}
|
||||||
|
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||||
|
setShowAddIcon={setShowAddIcon}
|
||||||
|
showAddIcon={showAddIcon}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} variant="outlined" color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
<Button onClick={formik.handleSubmit} variant="contained" color="primary">
|
||||||
{t("RejectDialog.button-reject")}
|
{t("RejectDialog.button-reject")}
|
||||||
</Button>
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default RejectForm;
|
export default RejectForm;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import LinkRouting from "@/core/components/LinkRouting";
|
import LinkRouting from "@/core/components/LinkRouting";
|
||||||
// import Notifications from "@/core/components/notifications";
|
import Notifications from "@/core/components/notifications";
|
||||||
import PasswordField from "@/core/components/PasswordField";
|
import PasswordField from "@/core/components/PasswordField";
|
||||||
import StyledForm from "@/core/components/StyledForm";
|
import StyledForm from "@/core/components/StyledForm";
|
||||||
import {GET_USER_TOKEN} from "@/core/data/apiRoutes";
|
import {GET_USER_TOKEN} from "@/core/data/apiRoutes";
|
||||||
@@ -14,13 +14,14 @@ import {useTranslations} from "next-intl";
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import {useSearchParams} from "next/navigation";
|
import {useSearchParams} from "next/navigation";
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
import useDirection from "@/lib/app/hooks/useDirection";
|
||||||
|
|
||||||
const LoginComponent = () => {
|
const LoginComponent = () => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
// const { directionApp } = useDirection(); // should delete because we dont have direction anymore
|
const {directionApp} = useDirection(); // should delete because we don't have direction anymore
|
||||||
const {setToken} = useUser(); // pass token to set token
|
const {setToken} = useUser(); // pass token to set token
|
||||||
|
|
||||||
// gettin url query
|
// getting url query
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const backUrlDecodedPath = searchParams.get("back_url");
|
const backUrlDecodedPath = searchParams.get("back_url");
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ const LoginComponent = () => {
|
|||||||
setToken(response.data.token);
|
setToken(response.data.token);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
// Notifications(directionApp, error.response, t);
|
Notifications(directionApp, error.response, t);
|
||||||
props.setSubmitting(false);
|
props.setSubmitting(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user