diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 0a10c68..59c93f7 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -169,7 +169,9 @@ "button-confirm": "تایید", "amount_error": "وارد کردن مقدار پیشنهادی الزامیست", "description_error": "وارد کردن توضیحات الزامی است!", - "description": "توضیحات", + "optional": " (اختیاری)", + "unit": " (ریال)", + "description": "توضیحات خود را وارد نمائید", "choose_file": "انتخاب فایل", "approved_amount": "مبلغ تصویب شده", "approved_amount_error": "وارد کردن مبلغ تصویب شده الزامیست", @@ -180,11 +182,15 @@ "context": "آیا از عدم تایید این آیتم اطمینان دارید؟", "button-cancel": "بستن", "button-reject": "عدم تایید", - "description": "توضیحات", + "description": "توضیحات خود را وارد نمائید", + "optional": " (اختیاری)", "description_error": "وارد کردن توضیحات الزامی است!" }, "UploadSystem": { - "upload_file": "آپلود فایل", + "upload_file": "فایل خود را بارگذاری کنید", + "optional": " (اختیاری)", + "upload_file_unit": "حداکثر 2Mb", + "upload_file_format": "فرمت قابل قبول : png,jpg,pdf", "delete": "پاک کردن", "uploadfile_error": "حجم فایل بیشتر از 2 مگابایت می باشد" } diff --git a/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx b/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx index a0d8017..b77f1a0 100644 --- a/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx +++ b/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx @@ -1,5 +1,13 @@ 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 {useState} from "react"; import {useFormik} from "formik"; @@ -66,67 +74,78 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { } }; return ( - + {t("ConfirmDialog.confirm")} - {t("ConfirmDialog.context")} - - - + + + + {t("ConfirmDialog.description")}{t("ConfirmDialog.optional")}} + value={description} + onChange={handleDescriptionChange} + fullWidth + variant="outlined" + sx={{mt: 1}} + /> + + + + {t("ConfirmDialog.proposed_amount")}{t("ConfirmDialog.unit")}} + type="number" + inputProps={{ + min: 0, + inputMode: "numeric", + pattern: "[0-9]*", + }} + variant="outlined" + value={proposedAmount} + onChange={handleAmountChange} + onBlur={formik.handleBlur("proposed_amount")} + error={ + formik.touched.proposed_amount && + Boolean(formik.errors.proposed_amount) + } + helperText={ + formik.touched.proposed_amount && formik.errors.proposed_amount + } + sx={{mt: 1}} + fullWidth + /> + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default ConfirmForm; +export default ConfirmForm; \ No newline at end of file diff --git a/src/components/dashboard/machinary-office/Form/RejectForm.jsx b/src/components/dashboard/machinary-office/Form/RejectForm.jsx index 06f7292..4c7a8c2 100644 --- a/src/components/dashboard/machinary-office/Form/RejectForm.jsx +++ b/src/components/dashboard/machinary-office/Form/RejectForm.jsx @@ -1,5 +1,14 @@ 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 {useFormik} from "formik"; import * as Yup from "yup"; @@ -59,45 +68,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { }; return ( - + {t("RejectDialog.reject")} - {t("RejectDialog.context")} - - + + + + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - @@ -105,4 +121,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { ); }; -export default RejectForm; +export default RejectForm; \ No newline at end of file diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm.jsx b/src/components/dashboard/passenger-boss/Form/ConfirmForm.jsx index f12c0bc..d560507 100644 --- a/src/components/dashboard/passenger-boss/Form/ConfirmForm.jsx +++ b/src/components/dashboard/passenger-boss/Form/ConfirmForm.jsx @@ -1,5 +1,14 @@ 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 {useState} from "react"; import {useFormik} from "formik"; @@ -11,7 +20,7 @@ import useDirection from "@/lib/app/hooks/useDirection"; const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { const t = useTranslations(); const {directionApp} = useDirection(); - const [proposedAmount, setProposedAmount] = useState(""); + const [approvedAmount, setApprovedAmount] = useState(""); const [description, setDescription] = useState(""); const [selectedImage, setSelectedImage] = useState(""); const [fileType, setfileType] = useState(null); @@ -20,19 +29,19 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { //formik const validationSchema = Yup.object().shape({ - proposed_amount: Yup.string().required( + approved_amount: Yup.string().required( t("ConfirmDialog.approved_amount_error") ), }); const formik = useFormik({ initialValues: { - proposed_amount: "", + approved_amount: "", description: "", }, validationSchema, onSubmit: () => { const formData = new FormData(); - formData.append("approved_amount", proposedAmount); + formData.append("approved_amount", approvedAmount); if (description != "") formData.append("expert_description", description); handleClose(); confirmData(CONFIRM_PASSENGER_BOSS, rowId, formData); @@ -44,7 +53,7 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { }; const handleAmountChange = (event) => { if (/^\d*$/.test(event.target.value)) { - setProposedAmount(event.target.value); + setApprovedAmount(event.target.value); } formik.handleChange(event); }; @@ -68,67 +77,78 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { }; return ( - + {t("ConfirmDialog.confirm")} - {t("ConfirmDialog.context")} - - - + + + + {t("ConfirmDialog.description")}{t("ConfirmDialog.optional")}} + value={description} + onChange={handleDescriptionChange} + fullWidth + variant="outlined" + sx={{mt: 1}} + /> + + + + {t("ConfirmDialog.approved_amount")}{t("ConfirmDialog.unit")}} + type="number" + inputProps={{ + min: 0, + inputMode: "numeric", + pattern: "[0-9]*", + }} + variant="outlined" + value={approvedAmount} + 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}} + fullWidth + /> + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default ConfirmForm; +export default ConfirmForm; \ No newline at end of file diff --git a/src/components/dashboard/passenger-boss/Form/RejectForm.jsx b/src/components/dashboard/passenger-boss/Form/RejectForm.jsx index e8dd93e..acac864 100644 --- a/src/components/dashboard/passenger-boss/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-boss/Form/RejectForm.jsx @@ -1,5 +1,14 @@ 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 {useFormik} from "formik"; import * as Yup from "yup"; @@ -59,45 +68,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { }; return ( - + {t("RejectDialog.reject")} - {t("RejectDialog.context")} - - + + + + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - @@ -105,4 +121,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { ); }; -export default RejectForm; +export default RejectForm; \ No newline at end of file diff --git a/src/components/dashboard/passenger-office/Form/ConfirmForm.jsx b/src/components/dashboard/passenger-office/Form/ConfirmForm.jsx index c5abc13..1f5170b 100644 --- a/src/components/dashboard/passenger-office/Form/ConfirmForm.jsx +++ b/src/components/dashboard/passenger-office/Form/ConfirmForm.jsx @@ -2,7 +2,16 @@ import UploadSystem from "@/core/components/UploadSystem"; import UploadFileNotification from "@/core/components/notifications/UploadFileNotification"; import {CONFIRM_PASSENGER_OFFICE} from "@/core/data/apiRoutes"; 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 {useTranslations} from "next-intl"; import {useState} from "react"; @@ -54,45 +63,54 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { }; return ( - + {t("ConfirmDialog.confirm")} - {t("ConfirmDialog.context")} - - + + + + + {t("ConfirmDialog.description")}{t("ConfirmDialog.optional")}} + value={description} + onChange={handleDescriptionChange} + onBlur={formik.handleBlur("description")} + fullWidth + variant="outlined" + sx={{mt: 1}} + /> + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default ConfirmForm; +export default ConfirmForm; \ No newline at end of file diff --git a/src/components/dashboard/passenger-office/Form/RejectForm.jsx b/src/components/dashboard/passenger-office/Form/RejectForm.jsx index ec3b07a..43c7dd4 100644 --- a/src/components/dashboard/passenger-office/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-office/Form/RejectForm.jsx @@ -1,5 +1,14 @@ 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 {useFormik} from "formik"; import * as Yup from "yup"; @@ -57,45 +66,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { } }; return ( - + {t("RejectDialog.reject")} - {t("RejectDialog.context")} - - + + + + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - @@ -103,4 +119,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { ); }; -export default RejectForm; +export default RejectForm; \ No newline at end of file diff --git a/src/components/dashboard/province-manager/Form/ConfirmForm.jsx b/src/components/dashboard/province-manager/Form/ConfirmForm.jsx index e456631..0d4b435 100644 --- a/src/components/dashboard/province-manager/Form/ConfirmForm.jsx +++ b/src/components/dashboard/province-manager/Form/ConfirmForm.jsx @@ -2,7 +2,16 @@ import UploadSystem from "@/core/components/UploadSystem"; import UploadFileNotification from "@/core/components/notifications/UploadFileNotification"; import {CONFIRM_PROVINCE_MANAGER} from "@/core/data/apiRoutes"; 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 {useTranslations} from "next-intl"; import {useState} from "react"; @@ -54,45 +63,54 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { }; return ( - + {t("ConfirmDialog.confirm")} - {t("ConfirmDialog.context")} - - + + + + + {t("ConfirmDialog.description")}{t("ConfirmDialog.optional")}} + value={description} + onChange={handleDescriptionChange} + onBlur={formik.handleBlur("description")} + fullWidth + variant="outlined" + sx={{mt: 1}} + /> + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default ConfirmForm; +export default ConfirmForm; \ No newline at end of file diff --git a/src/components/dashboard/province-manager/Form/RejectForm.jsx b/src/components/dashboard/province-manager/Form/RejectForm.jsx index a50bcf0..7e9ece6 100644 --- a/src/components/dashboard/province-manager/Form/RejectForm.jsx +++ b/src/components/dashboard/province-manager/Form/RejectForm.jsx @@ -1,5 +1,14 @@ 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 {useFormik} from "formik"; import * as Yup from "yup"; @@ -58,45 +67,52 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { }; return ( - + {t("RejectDialog.reject")} - {t("RejectDialog.context")} - - + + + + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - @@ -104,4 +120,4 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { ); }; -export default RejectForm; +export default RejectForm; \ No newline at end of file diff --git a/src/components/dashboard/transportation-assistance/Form/ConfirmForm.jsx b/src/components/dashboard/transportation-assistance/Form/ConfirmForm.jsx index f7f7b88..2c2ab5c 100644 --- a/src/components/dashboard/transportation-assistance/Form/ConfirmForm.jsx +++ b/src/components/dashboard/transportation-assistance/Form/ConfirmForm.jsx @@ -1,7 +1,16 @@ import UploadSystem from "@/core/components/UploadSystem"; import {CONFIRM_TRANSPORTATION_ASSISTANCE} from "@/core/data/apiRoutes"; 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 {useTranslations} from "next-intl"; import {useState} from "react"; @@ -51,44 +60,52 @@ const ConfirmForm = ({open, handleClose, rowId, confirmData}) => { } }; return ( - + {t("ConfirmDialog.confirm")} - {t("ConfirmDialog.context")} - - + + + + {t("ConfirmDialog.description")}{t("ConfirmDialog.optional")}} + value={description} + onChange={handleDescriptionChange} + fullWidth + variant="outlined" + sx={{mt: 1}} + /> + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default ConfirmForm; +export default ConfirmForm; \ No newline at end of file diff --git a/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx b/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx index f7643ab..a88e795 100644 --- a/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx +++ b/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx @@ -1,5 +1,14 @@ 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 {useFormik} from "formik"; import * as Yup from "yup"; @@ -57,49 +66,56 @@ const RejectForm = ({open, handleClose, rowId, rejectData}) => { } }; return ( - + {t("RejectDialog.reject")} - {t("RejectDialog.context")} - - + + + + + + {t("UploadSystem.upload_file")}{t("UploadSystem.optional")} + + + - - ); }; -export default RejectForm; +export default RejectForm; \ No newline at end of file diff --git a/src/components/login-expert/index.jsx b/src/components/login-expert/index.jsx index 10ac3b6..293f9f9 100644 --- a/src/components/login-expert/index.jsx +++ b/src/components/login-expert/index.jsx @@ -1,5 +1,5 @@ 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 StyledForm from "@/core/components/StyledForm"; import {GET_USER_TOKEN} from "@/core/data/apiRoutes"; @@ -14,13 +14,14 @@ import {useTranslations} from "next-intl"; import Image from "next/image"; import {useSearchParams} from "next/navigation"; import * as Yup from "yup"; +import useDirection from "@/lib/app/hooks/useDirection"; const LoginComponent = () => { 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 - // gettin url query + // getting url query const searchParams = useSearchParams(); const backUrlDecodedPath = searchParams.get("back_url"); @@ -35,7 +36,7 @@ const LoginComponent = () => { setToken(response.data.token); }) .catch(function (error) { - // Notifications(directionApp, error.response, t); + Notifications(directionApp, error.response, t); props.setSubmitting(false); }); };