diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index bf81001..b0373e7 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -52,6 +52,7 @@ "Dashboard": { "dashboard_page": "داشبورد", "passenger_boss_page": "رئیس مسافر", + "transportation_assistance": "معاونت حمل و نقل", "change_password": "تغییر رمز عبور", "province_manager_page": "مدیر کل استانی", "passenger_office_page": "اداره مسافر", diff --git a/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx b/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx index 55ae682..08e21b6 100644 --- a/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx +++ b/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx @@ -48,7 +48,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { }; return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} @@ -88,12 +88,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { /> - + ); diff --git a/src/components/dashboard/machinary-office/Form/RejectForm.jsx b/src/components/dashboard/machinary-office/Form/RejectForm.jsx index 723f9a6..8b6192f 100644 --- a/src/components/dashboard/machinary-office/Form/RejectForm.jsx +++ b/src/components/dashboard/machinary-office/Form/RejectForm.jsx @@ -40,7 +40,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -62,12 +62,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { /> - + ); diff --git a/src/components/dashboard/machinary-office/TableRowActions.jsx b/src/components/dashboard/machinary-office/TableRowActions.jsx index e9e815e..c7ee618 100644 --- a/src/components/dashboard/machinary-office/TableRowActions.jsx +++ b/src/components/dashboard/machinary-office/TableRowActions.jsx @@ -1,12 +1,14 @@ import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt"; import ThumbDownIcon from "@mui/icons-material/ThumbDown"; -import { Box, IconButton } from "@mui/material"; +import { Box, IconButton, Tooltip } from "@mui/material"; import { useContext } from "react"; import { DataTableContext } from "@/lib/app/contexts/DataTableContext"; import ConfirmForm from "./Form/ConfirmForm"; import RejectForm from "./Form/RejectForm"; +import { useTranslations } from "next-intl"; const TableRowActions = ({ row }) => { + const t = useTranslations(); const { openConfirmDialog, openRejectDialog, @@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => { } = useContext(DataTableContext); return ( - { - handleOpenConfirmDialog(row); - }} - > - - + + { + handleOpenConfirmDialog(row); + }} + > + + + {openConfirmDialog && ( { confirmData={confirmData} /> )} - handleOpenRejectDialog(row)}> - - + + handleOpenRejectDialog(row)}> + + + {openRejectDialog && ( { }; return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} @@ -90,12 +90,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { /> - + ); diff --git a/src/components/dashboard/passenger-boss/Form/RejectForm.jsx b/src/components/dashboard/passenger-boss/Form/RejectForm.jsx index 18a48a7..e163b5f 100644 --- a/src/components/dashboard/passenger-boss/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-boss/Form/RejectForm.jsx @@ -40,7 +40,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -62,12 +62,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { /> - + ); diff --git a/src/components/dashboard/passenger-boss/TableRowActions.jsx b/src/components/dashboard/passenger-boss/TableRowActions.jsx index e9e815e..c7ee618 100644 --- a/src/components/dashboard/passenger-boss/TableRowActions.jsx +++ b/src/components/dashboard/passenger-boss/TableRowActions.jsx @@ -1,12 +1,14 @@ import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt"; import ThumbDownIcon from "@mui/icons-material/ThumbDown"; -import { Box, IconButton } from "@mui/material"; +import { Box, IconButton, Tooltip } from "@mui/material"; import { useContext } from "react"; import { DataTableContext } from "@/lib/app/contexts/DataTableContext"; import ConfirmForm from "./Form/ConfirmForm"; import RejectForm from "./Form/RejectForm"; +import { useTranslations } from "next-intl"; const TableRowActions = ({ row }) => { + const t = useTranslations(); const { openConfirmDialog, openRejectDialog, @@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => { } = useContext(DataTableContext); return ( - { - handleOpenConfirmDialog(row); - }} - > - - + + { + handleOpenConfirmDialog(row); + }} + > + + + {openConfirmDialog && ( { confirmData={confirmData} /> )} - handleOpenRejectDialog(row)}> - - + + handleOpenRejectDialog(row)}> + + + {openRejectDialog && ( { }; return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} @@ -115,12 +115,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { - + ); diff --git a/src/components/dashboard/passenger-office/Form/RejectForm.jsx b/src/components/dashboard/passenger-office/Form/RejectForm.jsx index 149c480..6840f7c 100644 --- a/src/components/dashboard/passenger-office/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-office/Form/RejectForm.jsx @@ -40,7 +40,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -62,12 +62,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { /> - + ); diff --git a/src/components/dashboard/passenger-office/TableRowActions.jsx b/src/components/dashboard/passenger-office/TableRowActions.jsx index e9e815e..c7ee618 100644 --- a/src/components/dashboard/passenger-office/TableRowActions.jsx +++ b/src/components/dashboard/passenger-office/TableRowActions.jsx @@ -1,12 +1,14 @@ import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt"; import ThumbDownIcon from "@mui/icons-material/ThumbDown"; -import { Box, IconButton } from "@mui/material"; +import { Box, IconButton, Tooltip } from "@mui/material"; import { useContext } from "react"; import { DataTableContext } from "@/lib/app/contexts/DataTableContext"; import ConfirmForm from "./Form/ConfirmForm"; import RejectForm from "./Form/RejectForm"; +import { useTranslations } from "next-intl"; const TableRowActions = ({ row }) => { + const t = useTranslations(); const { openConfirmDialog, openRejectDialog, @@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => { } = useContext(DataTableContext); return ( - { - handleOpenConfirmDialog(row); - }} - > - - + + { + handleOpenConfirmDialog(row); + }} + > + + + {openConfirmDialog && ( { confirmData={confirmData} /> )} - handleOpenRejectDialog(row)}> - - + + handleOpenRejectDialog(row)}> + + + {openRejectDialog && ( { }; return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} @@ -115,12 +115,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { - + ); diff --git a/src/components/dashboard/province-manager/Form/RejectForm.jsx b/src/components/dashboard/province-manager/Form/RejectForm.jsx index 53f3c62..4cd56a5 100644 --- a/src/components/dashboard/province-manager/Form/RejectForm.jsx +++ b/src/components/dashboard/province-manager/Form/RejectForm.jsx @@ -40,7 +40,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -62,12 +62,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { /> - + ); diff --git a/src/components/dashboard/province-manager/TableRowActions.jsx b/src/components/dashboard/province-manager/TableRowActions.jsx index e9e815e..c7ee618 100644 --- a/src/components/dashboard/province-manager/TableRowActions.jsx +++ b/src/components/dashboard/province-manager/TableRowActions.jsx @@ -1,12 +1,14 @@ import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt"; import ThumbDownIcon from "@mui/icons-material/ThumbDown"; -import { Box, IconButton } from "@mui/material"; +import { Box, IconButton, Tooltip } from "@mui/material"; import { useContext } from "react"; import { DataTableContext } from "@/lib/app/contexts/DataTableContext"; import ConfirmForm from "./Form/ConfirmForm"; import RejectForm from "./Form/RejectForm"; +import { useTranslations } from "next-intl"; const TableRowActions = ({ row }) => { + const t = useTranslations(); const { openConfirmDialog, openRejectDialog, @@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => { } = useContext(DataTableContext); return ( - { - handleOpenConfirmDialog(row); - }} - > - - + + { + handleOpenConfirmDialog(row); + }} + > + + + {openConfirmDialog && ( { confirmData={confirmData} /> )} - handleOpenRejectDialog(row)}> - - + + handleOpenRejectDialog(row)}> + + + {openRejectDialog && ( { const t = useTranslations(); - const handleConfirm = () => { - handleClose(); - confirmData(CONFIRM_TRANSPORTATION_ASSISTANCE, rowId); + const [description, setDescription] = useState(""); + + const formik = useFormik({ + initialValues: { + description: "", + }, + onSubmit: () => { + const formData = new FormData(); + if (description != "") formData.append("expert_description", description); + handleClose(); + confirmData(CONFIRM_TRANSPORTATION_ASSISTANCE, rowId, formData); + }, + }); + + const handleDescriptionChange = (event) => { + setDescription(event.target.value); }; + return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} + - + ); diff --git a/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx b/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx index 262f9db..1bd1464 100644 --- a/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx +++ b/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx @@ -40,7 +40,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -62,12 +62,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { /> - + ); diff --git a/src/components/dashboard/transportation-assistance/TableRowActions.jsx b/src/components/dashboard/transportation-assistance/TableRowActions.jsx index e9e815e..ccd5bde 100644 --- a/src/components/dashboard/transportation-assistance/TableRowActions.jsx +++ b/src/components/dashboard/transportation-assistance/TableRowActions.jsx @@ -1,12 +1,15 @@ import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt"; import ThumbDownIcon from "@mui/icons-material/ThumbDown"; -import { Box, IconButton } from "@mui/material"; +import { Box, IconButton, Tooltip } from "@mui/material"; import { useContext } from "react"; import { DataTableContext } from "@/lib/app/contexts/DataTableContext"; import ConfirmForm from "./Form/ConfirmForm"; import RejectForm from "./Form/RejectForm"; +import { useTranslations } from "next-intl"; const TableRowActions = ({ row }) => { + const t = useTranslations(); + const { openConfirmDialog, openRejectDialog, @@ -20,14 +23,16 @@ const TableRowActions = ({ row }) => { } = useContext(DataTableContext); return ( - { - handleOpenConfirmDialog(row); - }} - > - - + + { + handleOpenConfirmDialog(row); + }} + > + + + {openConfirmDialog && ( { confirmData={confirmData} /> )} - handleOpenRejectDialog(row)}> - - + + handleOpenRejectDialog(row)}> + + + {openRejectDialog && ( - + );