Merge branch 'develop' of https://gitlab.com/witel3/loan-facilities-expert into feature/upload_file
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
"Dashboard": {
|
"Dashboard": {
|
||||||
"dashboard_page": "داشبورد",
|
"dashboard_page": "داشبورد",
|
||||||
"passenger_boss_page": "رئیس مسافر",
|
"passenger_boss_page": "رئیس مسافر",
|
||||||
|
"transportation_assistance": "معاونت حمل و نقل",
|
||||||
"change_password": "تغییر رمز عبور",
|
"change_password": "تغییر رمز عبور",
|
||||||
"province_manager_page": "مدیر کل استانی",
|
"province_manager_page": "مدیر کل استانی",
|
||||||
"passenger_office_page": "اداره مسافر",
|
"passenger_office_page": "اداره مسافر",
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
@@ -118,12 +118,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("ConfirmDialog.button-confirm")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
||||||
@@ -93,12 +93,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("RejectDialog.button-reject")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
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 { useContext } from "react";
|
||||||
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
||||||
import ConfirmForm from "./Form/ConfirmForm";
|
import ConfirmForm from "./Form/ConfirmForm";
|
||||||
import RejectForm from "./Form/RejectForm";
|
import RejectForm from "./Form/RejectForm";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const TableRowActions = ({ row }) => {
|
const TableRowActions = ({ row }) => {
|
||||||
|
const t = useTranslations();
|
||||||
const {
|
const {
|
||||||
openConfirmDialog,
|
openConfirmDialog,
|
||||||
openRejectDialog,
|
openRejectDialog,
|
||||||
@@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => {
|
|||||||
} = useContext(DataTableContext);
|
} = useContext(DataTableContext);
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||||
<IconButton
|
<Tooltip title={t("ConfirmDialog.confirm")}>
|
||||||
color="primary"
|
<IconButton
|
||||||
onClick={() => {
|
color="primary"
|
||||||
handleOpenConfirmDialog(row);
|
onClick={() => {
|
||||||
}}
|
handleOpenConfirmDialog(row);
|
||||||
>
|
}}
|
||||||
<ThumbUpAltIcon />
|
>
|
||||||
</IconButton>
|
<ThumbUpAltIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openConfirmDialog && (
|
{openConfirmDialog && (
|
||||||
<ConfirmForm
|
<ConfirmForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
@@ -36,9 +40,11 @@ const TableRowActions = ({ row }) => {
|
|||||||
confirmData={confirmData}
|
confirmData={confirmData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
<Tooltip title={t("RejectDialog.reject")}>
|
||||||
<ThumbDownIcon />
|
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||||
</IconButton>
|
<ThumbDownIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openRejectDialog && (
|
{openRejectDialog && (
|
||||||
<RejectForm
|
<RejectForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ function DashboardMachinaryOfficeComponent() {
|
|||||||
header: t("MachinaryOffice.state_name"),
|
header: t("MachinaryOffice.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
|
minSize: 300,
|
||||||
// filterFn: "equals",
|
// filterFn: "equals",
|
||||||
// filterSelectOptions: [
|
// filterSelectOptions: [
|
||||||
// ],
|
// ],
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
@@ -120,12 +120,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("ConfirmDialog.button-confirm")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
||||||
@@ -93,12 +93,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("RejectDialog.button-reject")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
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 { useContext } from "react";
|
||||||
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
||||||
import ConfirmForm from "./Form/ConfirmForm";
|
import ConfirmForm from "./Form/ConfirmForm";
|
||||||
import RejectForm from "./Form/RejectForm";
|
import RejectForm from "./Form/RejectForm";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const TableRowActions = ({ row }) => {
|
const TableRowActions = ({ row }) => {
|
||||||
|
const t = useTranslations();
|
||||||
const {
|
const {
|
||||||
openConfirmDialog,
|
openConfirmDialog,
|
||||||
openRejectDialog,
|
openRejectDialog,
|
||||||
@@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => {
|
|||||||
} = useContext(DataTableContext);
|
} = useContext(DataTableContext);
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||||
<IconButton
|
<Tooltip title={t("ConfirmDialog.confirm")}>
|
||||||
color="primary"
|
<IconButton
|
||||||
onClick={() => {
|
color="primary"
|
||||||
handleOpenConfirmDialog(row);
|
onClick={() => {
|
||||||
}}
|
handleOpenConfirmDialog(row);
|
||||||
>
|
}}
|
||||||
<ThumbUpAltIcon />
|
>
|
||||||
</IconButton>
|
<ThumbUpAltIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openConfirmDialog && (
|
{openConfirmDialog && (
|
||||||
<ConfirmForm
|
<ConfirmForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
@@ -36,9 +40,11 @@ const TableRowActions = ({ row }) => {
|
|||||||
confirmData={confirmData}
|
confirmData={confirmData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
<Tooltip title={t("RejectDialog.reject")}>
|
||||||
<ThumbDownIcon />
|
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||||
</IconButton>
|
<ThumbDownIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openRejectDialog && (
|
{openRejectDialog && (
|
||||||
<RejectForm
|
<RejectForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ function DashboardPassengerOfficeComponent() {
|
|||||||
header: t("PassengerBoss.state_name"),
|
header: t("PassengerBoss.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
|
minSize: 300,
|
||||||
// filterFn: "equals",
|
// filterFn: "equals",
|
||||||
// filterSelectOptions: [
|
// filterSelectOptions: [
|
||||||
// ],
|
// ],
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
@@ -91,12 +91,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("ConfirmDialog.button-confirm")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
||||||
@@ -91,12 +91,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("RejectDialog.button-reject")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
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 { useContext } from "react";
|
||||||
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
||||||
import ConfirmForm from "./Form/ConfirmForm";
|
import ConfirmForm from "./Form/ConfirmForm";
|
||||||
import RejectForm from "./Form/RejectForm";
|
import RejectForm from "./Form/RejectForm";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const TableRowActions = ({ row }) => {
|
const TableRowActions = ({ row }) => {
|
||||||
|
const t = useTranslations();
|
||||||
const {
|
const {
|
||||||
openConfirmDialog,
|
openConfirmDialog,
|
||||||
openRejectDialog,
|
openRejectDialog,
|
||||||
@@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => {
|
|||||||
} = useContext(DataTableContext);
|
} = useContext(DataTableContext);
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||||
<IconButton
|
<Tooltip title={t("ConfirmDialog.confirm")}>
|
||||||
color="primary"
|
<IconButton
|
||||||
onClick={() => {
|
color="primary"
|
||||||
handleOpenConfirmDialog(row);
|
onClick={() => {
|
||||||
}}
|
handleOpenConfirmDialog(row);
|
||||||
>
|
}}
|
||||||
<ThumbUpAltIcon />
|
>
|
||||||
</IconButton>
|
<ThumbUpAltIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openConfirmDialog && (
|
{openConfirmDialog && (
|
||||||
<ConfirmForm
|
<ConfirmForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
@@ -36,9 +40,11 @@ const TableRowActions = ({ row }) => {
|
|||||||
confirmData={confirmData}
|
confirmData={confirmData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
<Tooltip title={t("RejectDialog.reject")}>
|
||||||
<ThumbDownIcon />
|
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||||
</IconButton>
|
<ThumbDownIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openRejectDialog && (
|
{openRejectDialog && (
|
||||||
<RejectForm
|
<RejectForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ function DashboardPassengerOfficeComponent() {
|
|||||||
header: t("PassengerOffice.state_name"),
|
header: t("PassengerOffice.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
|
minSize: 300,
|
||||||
// filterFn: "equals",
|
// filterFn: "equals",
|
||||||
// filterSelectOptions: [
|
// filterSelectOptions: [
|
||||||
// ],
|
// ],
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
@@ -89,12 +89,12 @@ const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
|||||||
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("ConfirmDialog.button-confirm")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
||||||
@@ -92,12 +92,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("RejectDialog.button-reject")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
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 { useContext } from "react";
|
||||||
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
||||||
import ConfirmForm from "./Form/ConfirmForm";
|
import ConfirmForm from "./Form/ConfirmForm";
|
||||||
import RejectForm from "./Form/RejectForm";
|
import RejectForm from "./Form/RejectForm";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const TableRowActions = ({ row }) => {
|
const TableRowActions = ({ row }) => {
|
||||||
|
const t = useTranslations();
|
||||||
const {
|
const {
|
||||||
openConfirmDialog,
|
openConfirmDialog,
|
||||||
openRejectDialog,
|
openRejectDialog,
|
||||||
@@ -20,14 +22,16 @@ const TableRowActions = ({ row }) => {
|
|||||||
} = useContext(DataTableContext);
|
} = useContext(DataTableContext);
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||||
<IconButton
|
<Tooltip title={t("ConfirmDialog.confirm")}>
|
||||||
color="primary"
|
<IconButton
|
||||||
onClick={() => {
|
color="primary"
|
||||||
handleOpenConfirmDialog(row);
|
onClick={() => {
|
||||||
}}
|
handleOpenConfirmDialog(row);
|
||||||
>
|
}}
|
||||||
<ThumbUpAltIcon />
|
>
|
||||||
</IconButton>
|
<ThumbUpAltIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openConfirmDialog && (
|
{openConfirmDialog && (
|
||||||
<ConfirmForm
|
<ConfirmForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
@@ -36,9 +40,11 @@ const TableRowActions = ({ row }) => {
|
|||||||
confirmData={confirmData}
|
confirmData={confirmData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
<Tooltip title={t("RejectDialog.reject")}>
|
||||||
<ThumbDownIcon />
|
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||||
</IconButton>
|
<ThumbDownIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openRejectDialog && (
|
{openRejectDialog && (
|
||||||
<RejectForm
|
<RejectForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ function DashboardProvinceManagerComponent() {
|
|||||||
header: t("ProvinceManager.state_name"),
|
header: t("ProvinceManager.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
|
minSize: 300,
|
||||||
// filterFn: "equals",
|
// filterFn: "equals",
|
||||||
// filterSelectOptions: [
|
// filterSelectOptions: [
|
||||||
// ],
|
// ],
|
||||||
|
|||||||
@@ -6,28 +6,56 @@ import {
|
|||||||
DialogContentText,
|
DialogContentText,
|
||||||
DialogActions,
|
DialogActions,
|
||||||
Button,
|
Button,
|
||||||
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
import { useFormik } from "formik";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
const ConfirmForm = ({ open, handleClose, rowId, confirmData }) => {
|
||||||
const t = useTranslations();
|
const t = useTranslations();
|
||||||
const handleConfirm = () => {
|
const [description, setDescription] = useState("");
|
||||||
handleClose();
|
|
||||||
confirmData(CONFIRM_TRANSPORTATION_ASSISTANCE, rowId);
|
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 (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
<DialogTitle>{t("ConfirmDialog.confirm")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
<DialogContentText>{t("ConfirmDialog.context")}</DialogContentText>
|
||||||
|
<TextField
|
||||||
|
name="description"
|
||||||
|
multiline
|
||||||
|
rows={8}
|
||||||
|
placeholder={t("ConfirmDialog.description")}
|
||||||
|
value={description}
|
||||||
|
onChange={handleDescriptionChange}
|
||||||
|
fullWidth
|
||||||
|
variant="outlined"
|
||||||
|
sx={{ mt: 1 }}
|
||||||
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleConfirm} color="primary">
|
|
||||||
{t("ConfirmDialog.button-confirm")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("ConfirmDialog.button-cancel")}
|
{t("ConfirmDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("ConfirmDialog.button-confirm")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onClose={handleClose}>
|
<Dialog open={open}>
|
||||||
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
<DialogTitle>{t("RejectDialog.reject")}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
<DialogContentText>{t("RejectDialog.context")}</DialogContentText>
|
||||||
@@ -91,12 +91,12 @@ const RejectForm = ({ open, handleClose, rowId, rejectData }) => {
|
|||||||
/>
|
/>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={formik.handleSubmit} color="primary">
|
|
||||||
{t("RejectDialog.button-reject")}
|
|
||||||
</Button>
|
|
||||||
<Button onClick={handleClose} color="secondary" autoFocus>
|
<Button onClick={handleClose} color="secondary" autoFocus>
|
||||||
{t("RejectDialog.button-cancel")}
|
{t("RejectDialog.button-cancel")}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button onClick={formik.handleSubmit} color="primary">
|
||||||
|
{t("RejectDialog.button-reject")}
|
||||||
|
</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
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 { useContext } from "react";
|
||||||
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
import { DataTableContext } from "@/lib/app/contexts/DataTableContext";
|
||||||
import ConfirmForm from "./Form/ConfirmForm";
|
import ConfirmForm from "./Form/ConfirmForm";
|
||||||
import RejectForm from "./Form/RejectForm";
|
import RejectForm from "./Form/RejectForm";
|
||||||
|
import { useTranslations } from "next-intl";
|
||||||
|
|
||||||
const TableRowActions = ({ row }) => {
|
const TableRowActions = ({ row }) => {
|
||||||
|
const t = useTranslations();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
openConfirmDialog,
|
openConfirmDialog,
|
||||||
openRejectDialog,
|
openRejectDialog,
|
||||||
@@ -20,14 +23,16 @@ const TableRowActions = ({ row }) => {
|
|||||||
} = useContext(DataTableContext);
|
} = useContext(DataTableContext);
|
||||||
return (
|
return (
|
||||||
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
<Box sx={{ display: "flex", flexWrap: "nowrap", gap: "8px" }}>
|
||||||
<IconButton
|
<Tooltip title={t("ConfirmDialog.confirm")}>
|
||||||
color="primary"
|
<IconButton
|
||||||
onClick={() => {
|
color="primary"
|
||||||
handleOpenConfirmDialog(row);
|
onClick={() => {
|
||||||
}}
|
handleOpenConfirmDialog(row);
|
||||||
>
|
}}
|
||||||
<ThumbUpAltIcon />
|
>
|
||||||
</IconButton>
|
<ThumbUpAltIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openConfirmDialog && (
|
{openConfirmDialog && (
|
||||||
<ConfirmForm
|
<ConfirmForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
@@ -36,9 +41,11 @@ const TableRowActions = ({ row }) => {
|
|||||||
confirmData={confirmData}
|
confirmData={confirmData}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
<Tooltip title={t("RejectDialog.reject")}>
|
||||||
<ThumbDownIcon />
|
<IconButton color="primary" onClick={() => handleOpenRejectDialog(row)}>
|
||||||
</IconButton>
|
<ThumbDownIcon />
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
{openRejectDialog && (
|
{openRejectDialog && (
|
||||||
<RejectForm
|
<RejectForm
|
||||||
rowId={rowId}
|
rowId={rowId}
|
||||||
|
|||||||
@@ -177,6 +177,7 @@ function DashboardTransportationAssistanceComponent() {
|
|||||||
header: t("TransportationAssistance.state_name"),
|
header: t("TransportationAssistance.state_name"),
|
||||||
enableColumnFilter: false,
|
enableColumnFilter: false,
|
||||||
datatype: "numeric",
|
datatype: "numeric",
|
||||||
|
minSize: 300,
|
||||||
// filterFn: "equals",
|
// filterFn: "equals",
|
||||||
// filterSelectOptions: [
|
// filterSelectOptions: [
|
||||||
// ],
|
// ],
|
||||||
|
|||||||
41
src/core/components/notifications/WarningNotification.jsx
Normal file
41
src/core/components/notifications/WarningNotification.jsx
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import ReportIcon from "@mui/icons-material/Report";
|
||||||
|
import { Box, Divider, Typography } from "@mui/material";
|
||||||
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
|
const WarningNotification = (directionApp, t, status) => {
|
||||||
|
toast(
|
||||||
|
({ closeToast }) => (
|
||||||
|
<>
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
alignItems: "start",
|
||||||
|
justifyContent: "start",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box sx={{ display: "flex", alignItems: "center" }}>
|
||||||
|
<ReportIcon color="warning" sx={{ mr: 1.6 }} />
|
||||||
|
<Box sx={{ display: "flex", flexDirection: "column" }}>
|
||||||
|
<Typography color="warning.main" variant="button">
|
||||||
|
{t("warning")} ({t("code")}: {status})
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="caption">
|
||||||
|
{t("warning_static_text")}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
<Divider sx={{ my: 1 }} />
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
{
|
||||||
|
position: directionApp === "ltr" ? "top-left" : "top-right",
|
||||||
|
autoClose: false,
|
||||||
|
closeOnClick: false,
|
||||||
|
draggable: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WarningNotification;
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import ErrorNotification from "./ErrorNotification";
|
import ErrorNotification from "./ErrorNotification";
|
||||||
|
import WarningNotification from "./WarningNotification";
|
||||||
import SuccessNotification from "./successNotification";
|
import SuccessNotification from "./successNotification";
|
||||||
|
|
||||||
const Notifications = async (directionApp, response, t) => {
|
const Notifications = async (directionApp, response, t) => {
|
||||||
|
|||||||
@@ -13,6 +13,15 @@ const theme = {
|
|||||||
dark: "#ad3a07",
|
dark: "#ad3a07",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
MuiBackdrop: {
|
||||||
|
styleOverrides: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#02020226", // Replace with your desired backdrop color and opacity
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { parse } from "next-useragent";
|
|||||||
export default function TransportationAssistance() {
|
export default function TransportationAssistance() {
|
||||||
return (
|
return (
|
||||||
<WithAuthMiddleware>
|
<WithAuthMiddleware>
|
||||||
<TitlePage text="Dashboard.passenger_office_page" />
|
<TitlePage text="Dashboard.transportation_assistance" />
|
||||||
<DashboardTransportationAssistanceComponent />
|
<DashboardTransportationAssistanceComponent />
|
||||||
</WithAuthMiddleware>
|
</WithAuthMiddleware>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user