diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 2a80338..a4791a5 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 d5d415b..f868aa0 100644 --- a/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx +++ b/src/components/dashboard/machinary-office/Form/ConfirmForm.jsx @@ -65,7 +65,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => { } }; return ( - + {t("ConfirmDialog.confirm")} {t("ConfirmDialog.context")} @@ -118,12 +118,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 757fb47..69f7e61 100644 --- a/src/components/dashboard/machinary-office/Form/RejectForm.jsx +++ b/src/components/dashboard/machinary-office/Form/RejectForm.jsx @@ -58,7 +58,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -93,12 +93,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")} @@ -120,12 +120,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 bb350f8..d430af5 100644 --- a/src/components/dashboard/passenger-boss/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-boss/Form/RejectForm.jsx @@ -58,7 +58,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -93,12 +93,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")} @@ -91,12 +91,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 7190af7..5ee55f1 100644 --- a/src/components/dashboard/passenger-office/Form/RejectForm.jsx +++ b/src/components/dashboard/passenger-office/Form/RejectForm.jsx @@ -56,7 +56,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { } }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -91,12 +91,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")} @@ -89,12 +89,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 c1b91d9..ec95a1b 100644 --- a/src/components/dashboard/province-manager/Form/RejectForm.jsx +++ b/src/components/dashboard/province-manager/Form/RejectForm.jsx @@ -57,7 +57,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -92,12 +92,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 5e35c77..abf8f74 100644 --- a/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx +++ b/src/components/dashboard/transportation-assistance/Form/RejectForm.jsx @@ -56,7 +56,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => { } }; return ( - + {t("RejectDialog.reject")} {t("RejectDialog.context")} @@ -91,12 +91,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 && ( { + toast( + ({ closeToast }) => ( + <> + + + + + + {t("warning")} ({t("code")}: {status}) + + + {t("warning_static_text")} + + + + + + + ), + { + position: directionApp === "ltr" ? "top-left" : "top-right", + autoClose: false, + closeOnClick: false, + draggable: false, + } + ); +}; + +export default WarningNotification; diff --git a/src/core/components/notifications/index.jsx b/src/core/components/notifications/index.jsx index f9eb82c..ddef384 100644 --- a/src/core/components/notifications/index.jsx +++ b/src/core/components/notifications/index.jsx @@ -1,4 +1,5 @@ import ErrorNotification from "./ErrorNotification"; +import WarningNotification from "./WarningNotification"; import SuccessNotification from "./successNotification"; const Notifications = async (directionApp, response, t) => { diff --git a/src/core/utils/theme.jsx b/src/core/utils/theme.jsx index 0a36eee..1d6d9a8 100644 --- a/src/core/utils/theme.jsx +++ b/src/core/utils/theme.jsx @@ -13,6 +13,15 @@ const theme = { dark: "#ad3a07", }, }, + components: { + MuiBackdrop: { + styleOverrides: { + root: { + backgroundColor: "#02020226", // Replace with your desired backdrop color and opacity + }, + }, + }, + }, }; export default theme; diff --git a/src/pages/dashboard/transportation-assistance/index.jsx b/src/pages/dashboard/transportation-assistance/index.jsx index 9c089ad..ef9a661 100644 --- a/src/pages/dashboard/transportation-assistance/index.jsx +++ b/src/pages/dashboard/transportation-assistance/index.jsx @@ -6,7 +6,7 @@ import { parse } from "next-useragent"; export default function TransportationAssistance() { return ( - + );