Merge branch 'feature/debug_navgan_cartable' into 'develop'
Feature/debug navgan cartable See merge request witel3/loan-facilities-expert!73
This commit is contained in:
@@ -82,10 +82,10 @@
|
||||
"transportation_assistance": "معاونت حمل و نقل",
|
||||
"change_password": "تغییر رمز عبور",
|
||||
"province_manager_page": "مدیر کل استانی",
|
||||
"province_head_expert": "کارشناس ستادی",
|
||||
"passenger_office_page": "اداره مسافر",
|
||||
"machinary_office_page": "ماشین آلات",
|
||||
"development_assistant": "معاون توسعه",
|
||||
"development_assistant": "معاون توسعه",
|
||||
"development_assistant_page": "معاون توسعه",
|
||||
"inspector_expert_page": "بازدید کارشناس",
|
||||
"commercial_chief_page": "رئیس اداره بازرگانی",
|
||||
"edit_profile": "ویرایش پروفایل"
|
||||
@@ -268,11 +268,11 @@
|
||||
"proposed_amount_positive": "مقدار پیشنهادی باید مثبت باشد"
|
||||
},
|
||||
"ReviseDialog": {
|
||||
"confirm": "تایید",
|
||||
"button-cancel": "بستن",
|
||||
"button-confirm": "تایید",
|
||||
"revise": "ویرایش",
|
||||
"description_error": "وارد کردن توضیحات الزامی است!",
|
||||
"optional": " (اختیاری)",
|
||||
"button-cancel": "بستن",
|
||||
"button-revise": "ویرایش",
|
||||
"description": "توضیحات خود را وارد نمائید"
|
||||
},
|
||||
"RejectDialog": {
|
||||
|
||||
@@ -35,7 +35,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_COMMERCIAL_CHIEF}/${rowId}`, 'post', {
|
||||
|
||||
@@ -17,7 +17,6 @@ import * as Yup from "yup";
|
||||
import {useState} from "react";
|
||||
import UploadSystem from "@/core/components/UploadSystem";
|
||||
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
||||
import useDirection from "@/lib/app/hooks/useDirection";
|
||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
|
||||
@@ -27,7 +26,6 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
const [fileName, setfileName] = useState(null);
|
||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
||||
const t = useTranslations();
|
||||
const {directionApp} = useDirection();
|
||||
const [openRejectDialog, setOpenRejectDialog] = useState(false);
|
||||
const requestServer = useRequest({auth: true})
|
||||
|
||||
@@ -43,7 +41,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_COMMERCIAL_CHIEF}/${rowId}`, 'post', {
|
||||
|
||||
@@ -160,47 +160,12 @@ function DashboardCommercialChiefComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// accessorFn: (row) => row.navgan_id,
|
||||
// id: "navgan_id",
|
||||
// header: t("CommercialChief.navgan_id"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// columnFilterModeOptions: [
|
||||
// "equals",
|
||||
// "notEquals",
|
||||
// "contains",
|
||||
// "lessThan",
|
||||
// "greaterThan",
|
||||
// "between",
|
||||
// ],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// accessorFn: (row) => row.vehicle_type,
|
||||
// id: "vehicle_type",
|
||||
// header: t("CommercialChief.vehicle_type"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "text",
|
||||
// filterFn: "contains",
|
||||
// columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("CommercialChief.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_DEVELOPMENT_ASSISTANT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -41,7 +41,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_DEVELOPMENT_ASSISTANT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -161,47 +161,12 @@ function DashboardDevelopmentAssistantComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// accessorFn: (row) => row.navgan_id,
|
||||
// id: "navgan_id",
|
||||
// header: t("DevelopmentAssistant.navgan_id"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// columnFilterModeOptions: [
|
||||
// "equals",
|
||||
// "notEquals",
|
||||
// "contains",
|
||||
// "lessThan",
|
||||
// "greaterThan",
|
||||
// "between",
|
||||
// ],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// accessorFn: (row) => row.vehicle_type,
|
||||
// id: "vehicle_type",
|
||||
// header: t("DevelopmentAssistant.vehicle_type"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "text",
|
||||
// filterFn: "contains",
|
||||
// columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("DevelopmentAssistant.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_INSPECTOR_EXPERT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -43,7 +43,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_INSPECTOR_EXPERT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -9,40 +9,31 @@ import {
|
||||
Stack,
|
||||
TextField,
|
||||
Tooltip,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import {useTranslations} from "next-intl";
|
||||
import {useFormik} from "formik";
|
||||
import * as Yup from "yup";
|
||||
import {useState} from "react";
|
||||
import UploadSystem from "@/core/components/UploadSystem";
|
||||
import UploadFileNotification from "@/core/components/notifications/UploadFileNotification";
|
||||
import ThumbDownIcon from "@mui/icons-material/ThumbDown";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import EditIcon from "@mui/icons-material/Edit";
|
||||
|
||||
const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
const [selectedImage, setSelectedImage] = useState("");
|
||||
const [fileType, setfileType] = useState(null);
|
||||
const [fileName, setfileName] = useState(null);
|
||||
const [showAddIcon, setShowAddIcon] = useState(true);
|
||||
const t = useTranslations();
|
||||
const [openRejectDialog, setOpenRejectDialog] = useState(false);
|
||||
const requestServer = useRequest({auth: true})
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
description: Yup.string().required(t("RejectDialog.description_error")),
|
||||
description: Yup.string().required(t("ReviseDialog.description_error")),
|
||||
});
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
reject_img: null
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
formData.append("description", values.description);
|
||||
|
||||
requestServer(`${REVISE_INSPECTOR_EXPERT}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -59,34 +50,17 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
formik.setFieldValue("description", event.target.value);
|
||||
formik.handleChange(event);
|
||||
};
|
||||
const handleUploadChange = (event) => {
|
||||
const uploadedFile = event.target?.files?.[0];
|
||||
if (uploadedFile) {
|
||||
const maxFileSize = 2 * 1024 * 1024;
|
||||
if (uploadedFile.size > maxFileSize) {
|
||||
UploadFileNotification(t);
|
||||
event.target.value = "";
|
||||
return;
|
||||
}
|
||||
const fileType = event.target?.files?.[0].type;
|
||||
const fileName = event.target?.files?.[0].name;
|
||||
setSelectedImage(URL.createObjectURL(uploadedFile));
|
||||
setfileType(fileType);
|
||||
setfileName(fileName);
|
||||
formik.setFieldValue("reject_img", uploadedFile);
|
||||
setShowAddIcon(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={t("RejectDialog.reject")}>
|
||||
<Tooltip title={t("ReviseDialog.revise")}>
|
||||
<IconButton color="primary" onClick={() => setOpenRejectDialog(true)}>
|
||||
<ThumbDownIcon/>
|
||||
<EditIcon/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog fullWidth open={openRejectDialog}
|
||||
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("ReviseDialog.revise")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
@@ -94,7 +68,7 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
name="description"
|
||||
multiline
|
||||
rows={8}
|
||||
label={t("RejectDialog.description")}
|
||||
label={t("ReviseDialog.description")}
|
||||
value={formik.values.description}
|
||||
onChange={handleDescriptionChange}
|
||||
onBlur={formik.handleBlur("description")}
|
||||
@@ -107,32 +81,16 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
sx={{mt: 1}}
|
||||
/>
|
||||
</Stack>
|
||||
<Stack>
|
||||
<Typography>{t("UploadSystem.upload_file")}{t("UploadSystem.optional")}</Typography>
|
||||
<UploadSystem
|
||||
selectedImage={selectedImage}
|
||||
handleUploadChange={handleUploadChange} // Pass the updated function directly
|
||||
setselectedImage={setSelectedImage}
|
||||
setFieldValue={formik.setFieldValue} // Remove props.setFieldValue, use formik.setFieldValue
|
||||
fieldname="reject_img"
|
||||
fileType={fileType}
|
||||
fileName={fileName}
|
||||
imageAlt={t("app_name")}
|
||||
imageSize={[250 /*width*/, 150 /*height*/]}
|
||||
setShowAddIcon={setShowAddIcon}
|
||||
showAddIcon={showAddIcon}
|
||||
/>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={() => setOpenRejectDialog(false)} variant="outlined" color="secondary"
|
||||
disabled={formik.isSubmitting} autoFocus>
|
||||
{t("RejectDialog.button-cancel")}
|
||||
{t("ReviseDialog.button-cancel")}
|
||||
</Button>
|
||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
||||
disabled={formik.isSubmitting}>
|
||||
{t("RejectDialog.button-reject")}
|
||||
{t("ReviseDialog.button-revise")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
@@ -160,47 +160,12 @@ function DashboardInspectorExpertComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// accessorFn: (row) => row.navgan_id,
|
||||
// id: "navgan_id",
|
||||
// header: t("InspectorExpert.navgan_id"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// columnFilterModeOptions: [
|
||||
// "equals",
|
||||
// "notEquals",
|
||||
// "contains",
|
||||
// "lessThan",
|
||||
// "greaterThan",
|
||||
// "between",
|
||||
// ],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// accessorFn: (row) => row.vehicle_type,
|
||||
// id: "vehicle_type",
|
||||
// header: t("InspectorExpert.vehicle_type"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "text",
|
||||
// filterFn: "contains",
|
||||
// columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("InspectorExpert.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -197,10 +197,6 @@ function DashboardMachinaryOfficeComponent() {
|
||||
header: t("MachinaryOffice.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {REJECT_NAVGAV_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||
import {REJECT_NAVGAN_PROVINCE_MANAGER} from "@/core/data/apiRoutes";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
@@ -46,7 +46,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
formData.append("expert_description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_NAVGAV_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
requestServer(`${REJECT_NAVGAN_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
}).then((response) => {
|
||||
mutate(fetchUrl)
|
||||
|
||||
@@ -198,10 +198,6 @@ function DashboardNavganProvinceManagerComponent() {
|
||||
header: t("NavganProvinceManager.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -2,7 +2,7 @@ import DashboardLayouts from "@/layouts/dashboardLayouts";
|
||||
import {Box, IconButton, Typography} from "@mui/material";
|
||||
import ClearIcon from "@mui/icons-material/Clear";
|
||||
import {useMemo} from "react";
|
||||
import {GET_PASSENGER_BOSS, GET_PASSENGER_OFFICE} from "@/core/data/apiRoutes";
|
||||
import {GET_PASSENGER_BOSS} from "@/core/data/apiRoutes";
|
||||
import {useTranslations} from "next-intl";
|
||||
import TableRowActions from "./TableRowActions";
|
||||
import {LocalizationProvider, MobileDateTimePicker,} from "@mui/x-date-pickers";
|
||||
@@ -198,10 +198,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
header: t("PassengerBoss.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -199,10 +199,6 @@ function DashboardPassengerOfficeComponent() {
|
||||
header: t("PassengerOffice.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_PROVINCE_HEAD_EXPERT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -43,7 +43,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_PROVINCE_HEAD_EXPERT}/${rowId}`, 'post', {
|
||||
|
||||
@@ -11,23 +11,29 @@ import {
|
||||
TextField,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import ThumbUpAltIcon from "@mui/icons-material/ThumbUpAlt";
|
||||
import EditIcon from '@mui/icons-material/Edit';
|
||||
import {useFormik} from "formik";
|
||||
import {REVISE_PROVINCE_HEAD_EXPERT} from "@/core/data/apiRoutes";
|
||||
import useRequest from "@/lib/app/hooks/useRequest";
|
||||
import * as Yup from "yup";
|
||||
|
||||
const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
const t = useTranslations();
|
||||
const [openConfirmDialog, setOpenConfirmDialog] = useState(false);
|
||||
const requestServer = useRequest({auth: true})
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
description: Yup.string().required(t("RejectDialog.description_error")),
|
||||
});
|
||||
|
||||
const formik = useFormik({
|
||||
initialValues: {
|
||||
description: "",
|
||||
},
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
|
||||
requestServer(`${REVISE_PROVINCE_HEAD_EXPERT}/${rowId}`, 'post', {
|
||||
data: formData,
|
||||
@@ -46,19 +52,19 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={t("ReviseDialog.confirm")}>
|
||||
<Tooltip title={t("ReviseDialog.revise")}>
|
||||
<IconButton
|
||||
color="primary"
|
||||
onClick={() => {
|
||||
setOpenConfirmDialog(true)
|
||||
}}
|
||||
>
|
||||
<ThumbUpAltIcon/>
|
||||
<EditIcon/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Dialog fullWidth open={openConfirmDialog}
|
||||
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("ReviseDialog.confirm")}</DialogTitle>
|
||||
<DialogTitle>{t("ReviseDialog.revise")}</DialogTitle>
|
||||
<DialogContent>
|
||||
<Stack spacing={2}>
|
||||
<Stack>
|
||||
@@ -66,10 +72,14 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
name="description"
|
||||
multiline
|
||||
rows={8}
|
||||
label={<>
|
||||
<span>{t("ReviseDialog.description")}</span><small>{t("ReviseDialog.optional")}</small></>}
|
||||
label={t("ReviseDialog.description")}
|
||||
value={formik.values.description}
|
||||
onChange={handleDescriptionChange}
|
||||
onBlur={formik.handleBlur("description")}
|
||||
error={
|
||||
formik.touched.description && Boolean(formik.errors.description)
|
||||
}
|
||||
helperText={formik.touched.description && formik.errors.description}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
sx={{mt: 1}}
|
||||
@@ -84,7 +94,7 @@ const Revise = ({rowId, fetchUrl, mutate}) => {
|
||||
</Button>
|
||||
<Button onClick={formik.handleSubmit} variant="contained" color="primary"
|
||||
disabled={formik.isSubmitting}>
|
||||
{t("ReviseDialog.button-confirm")}
|
||||
{t("ReviseDialog.button-revise")}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
@@ -161,47 +161,12 @@ function DashboardProvinceHeadExpertComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.navgan_id,
|
||||
id: "navgan_id",
|
||||
header: t("ProvinceHeadExpert.navgan_id"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "numeric",
|
||||
filterFn: "equals",
|
||||
columnFilterModeOptions: [
|
||||
"equals",
|
||||
"notEquals",
|
||||
"contains",
|
||||
"lessThan",
|
||||
"greaterThan",
|
||||
"between",
|
||||
],
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.vehicle_type,
|
||||
id: "vehicle_type",
|
||||
header: t("ProvinceHeadExpert.vehicle_type"),
|
||||
enableColumnFilter: true,
|
||||
datatype: "text",
|
||||
filterFn: "contains",
|
||||
columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("ProvinceHeadExpert.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -37,7 +37,7 @@ const Confirm = ({rowId, fetchUrl, mutate}) => {
|
||||
},
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
if (values.description != "") formData.append("expert_description", values.description);
|
||||
if (values.description != "") formData.append("description", values.description);
|
||||
if (values.confirm_img != null) formData.append("attachment", values.confirm_img);
|
||||
|
||||
requestServer(`${CONFIRM_REFAHI_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
|
||||
@@ -43,7 +43,7 @@ const Reject = ({rowId, fetchUrl, mutate}) => {
|
||||
validationSchema,
|
||||
onSubmit: (values, {setSubmitting}) => {
|
||||
const formData = new FormData();
|
||||
formData.append("expert_description", values.description);
|
||||
formData.append("description", values.description);
|
||||
if (values.reject_img != null) formData.append("attachment", values.reject_img);
|
||||
|
||||
requestServer(`${REJECT_REFAHI_PROVINCE_MANAGER}/${rowId}`, 'post', {
|
||||
|
||||
@@ -162,47 +162,12 @@ function DashboardRefahiProvinceManagerComponent() {
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
},
|
||||
// {
|
||||
// accessorFn: (row) => row.navgan_id,
|
||||
// id: "navgan_id",
|
||||
// header: t("RefahiProvinceManager.navgan_id"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// columnFilterModeOptions: [
|
||||
// "equals",
|
||||
// "notEquals",
|
||||
// "contains",
|
||||
// "lessThan",
|
||||
// "greaterThan",
|
||||
// "between",
|
||||
// ],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
// {
|
||||
// accessorFn: (row) => row.vehicle_type,
|
||||
// id: "vehicle_type",
|
||||
// header: t("RefahiProvinceManager.vehicle_type"),
|
||||
// enableColumnFilter: true,
|
||||
// datatype: "text",
|
||||
// filterFn: "contains",
|
||||
// columnFilterModeOptions: ["contains", "equals", "notEquals"],
|
||||
// Cell: ({renderedCellValue}) => (
|
||||
// <Typography variant="body2">{renderedCellValue}</Typography>
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
accessorFn: (row) => row.state_name,
|
||||
id: "state_id",
|
||||
header: t("RefahiProvinceManager.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
@@ -227,7 +192,7 @@ function DashboardRefahiProvinceManagerComponent() {
|
||||
enableHiding={true}
|
||||
enableFullScreenToggle={false}
|
||||
enableGlobalFilter={false}
|
||||
enableColumnResizing={false} // if you want true this you shold change renderRowActions props ** see https://www.material-react-table.com/docs/guides/row-actions
|
||||
enableColumnResizing={false} // if you want true this you should change renderRowActions props ** see https://www.material-react-table.com/docs/guides/row-actions
|
||||
enableRowActions={true}
|
||||
TableRowAction={TableRowActions}
|
||||
/>
|
||||
|
||||
@@ -198,10 +198,6 @@ function DashboardTransportationAssistanceComponent() {
|
||||
header: t("TransportationAssistance.state_name"),
|
||||
enableColumnFilter: false,
|
||||
datatype: "numeric",
|
||||
// filterFn: "equals",
|
||||
// filterSelectOptions: [
|
||||
// ],
|
||||
// filterVariant: "select",
|
||||
Cell: ({renderedCellValue}) => (
|
||||
<Typography variant="body2">{renderedCellValue}</Typography>
|
||||
),
|
||||
|
||||
@@ -54,7 +54,7 @@ export const CONFIRM_MACHINARY_OFFICE =
|
||||
|
||||
export const REJECT_MACHINARY_OFFICE =
|
||||
BASE_URL + "/dashboard/machinery_expert/reject";
|
||||
//passenger office
|
||||
//machinary office
|
||||
|
||||
//commercial chief
|
||||
export const GET_COMMERCIAL_CHIEF =
|
||||
@@ -88,29 +88,6 @@ export const CONFIRM_REFAHI_PROVINCE_MANAGER =
|
||||
export const REJECT_REFAHI_PROVINCE_MANAGER =
|
||||
BASE_URL + "/dashboard/refahi_province_manager/reject";
|
||||
//refahi province manager
|
||||
//navgan province manager
|
||||
|
||||
// refahi province manager
|
||||
export const GET_REFAHI_PROVINCE_MANAGER =
|
||||
BASE_URL + "/dashboard/refahi_province_manager/show";
|
||||
|
||||
export const CONFIRM_REFAHI_PROVINCE_MANAGER =
|
||||
BASE_URL + "/dashboard/refahi_province_manager/confirm";
|
||||
|
||||
export const REJECT_REFAHI_PROVINCE_MANAGER =
|
||||
BASE_URL + "/dashboard/refahi_province_manager/reject";
|
||||
//refahi province manager
|
||||
|
||||
// development assistant
|
||||
export const GET_DEVELOPMENT_ASSISTANT =
|
||||
BASE_URL + "/dashboard/development_assistant/show";
|
||||
|
||||
export const CONFIRM_DEVELOPMENT_ASSISTANT =
|
||||
BASE_URL + "/dashboard/development_assistant/confirm";
|
||||
|
||||
export const REJECT_DEVELOPMENT_ASSISTANT =
|
||||
BASE_URL + "/dashboard/development_assistant/reject";
|
||||
//development assistant
|
||||
|
||||
// development assistant
|
||||
export const GET_DEVELOPMENT_ASSISTANT =
|
||||
@@ -148,6 +125,6 @@ export const REJECT_PROVINCE_HEAD_EXPERT =
|
||||
BASE_URL + "/dashboard/province_head_expert/reject";
|
||||
|
||||
export const REVISE_PROVINCE_HEAD_EXPERT =
|
||||
BASE_URL + "/dashboard/province_head_expert/edit";
|
||||
BASE_URL + "/dashboard/province_head_expert/revise";
|
||||
//province head expert
|
||||
|
||||
|
||||
@@ -4,6 +4,11 @@ import AirlineSeatReclineNormalIcon from "@mui/icons-material/AirlineSeatRecline
|
||||
import DirectionsRailwayIcon from "@mui/icons-material/DirectionsRailway";
|
||||
import AssignmentIndIcon from "@mui/icons-material/AssignmentInd";
|
||||
import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
|
||||
import GavelIcon from '@mui/icons-material/Gavel';
|
||||
import BusinessCenterIcon from '@mui/icons-material/BusinessCenter';
|
||||
import GradingIcon from '@mui/icons-material/Grading';
|
||||
import SupervisedUserCircleIcon from '@mui/icons-material/SupervisedUserCircle';
|
||||
import Diversity3Icon from '@mui/icons-material/Diversity3';
|
||||
|
||||
const sidebarMenu = [
|
||||
[
|
||||
@@ -41,14 +46,7 @@ const sidebarMenu = [
|
||||
selected: false,
|
||||
role: "passenger_office_chief",
|
||||
},
|
||||
{
|
||||
key: "sidebar.commercial-chief",
|
||||
type: "page",
|
||||
route: "/dashboard/commercial-chief",
|
||||
icon: <AssignmentIndIcon/>,
|
||||
selected: false,
|
||||
role: "commercial_chief",
|
||||
},
|
||||
|
||||
{
|
||||
key: "sidebar.transportation-assistant",
|
||||
type: "page",
|
||||
@@ -67,45 +65,45 @@ const sidebarMenu = [
|
||||
role: "province_manager",
|
||||
},
|
||||
{
|
||||
key: "sidebar.refahi-province-manager",
|
||||
secondary: "secondary.refahi-province-manager",
|
||||
key: "sidebar.province-head-expert",
|
||||
type: "page",
|
||||
route: "/dashboard/refahi-province-manager",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
route: "/dashboard/province-head-expert",
|
||||
icon: <GavelIcon/>,
|
||||
selected: false,
|
||||
role: "province_manager",
|
||||
},
|
||||
{
|
||||
key: "sidebar.development-assistant",
|
||||
type: "page",
|
||||
route: "/dashboard/development-assistant",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
selected: false,
|
||||
role: "development_assistant",
|
||||
},
|
||||
{
|
||||
key: "sidebar.development-assistant",
|
||||
type: "page",
|
||||
route: "/dashboard/development-assistant",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
selected: false,
|
||||
role: "development_assistant",
|
||||
role: "province_head_expert",
|
||||
},
|
||||
{
|
||||
key: "sidebar.inspector-expert",
|
||||
type: "page",
|
||||
route: "/dashboard/inspector-expert",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
icon: <GradingIcon/>,
|
||||
selected: false,
|
||||
role: "inspector_expert",
|
||||
},
|
||||
{
|
||||
key: "sidebar.province-head-expert",
|
||||
key: "sidebar.commercial-chief",
|
||||
type: "page",
|
||||
route: "/dashboard/province-head-expert",
|
||||
icon: <DesktopWindowsIcon/>,
|
||||
route: "/dashboard/commercial-chief",
|
||||
icon: <BusinessCenterIcon/>,
|
||||
selected: false,
|
||||
role: "province_head_expert",
|
||||
role: "commercial_chief",
|
||||
},
|
||||
{
|
||||
key: "sidebar.development-assistant",
|
||||
type: "page",
|
||||
route: "/dashboard/development-assistant",
|
||||
icon: <Diversity3Icon/>,
|
||||
selected: false,
|
||||
role: "development_assistant",
|
||||
},
|
||||
{
|
||||
key: "sidebar.refahi-province-manager",
|
||||
secondary: "secondary.refahi-province-manager",
|
||||
type: "page",
|
||||
route: "/dashboard/refahi-province-manager",
|
||||
icon: <SupervisedUserCircleIcon/>,
|
||||
selected: false,
|
||||
role: "province_manager",
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
@@ -4,7 +4,7 @@ import {parse} from "next-useragent";
|
||||
import DashboardCommercialChiefComponent from "@/components/dashboard/commercial-chief";
|
||||
|
||||
const requiredPermissions = ["commercial_chief"];
|
||||
export default function PassengerBoss() {
|
||||
export default function CommercialChief() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {parse} from "next-useragent";
|
||||
import DashboardDevelopmentAssistantComponent from "@/components/dashboard/development-assistant";
|
||||
|
||||
const requiredPermissions = ["development_assistant"];
|
||||
export default function PassengerBoss() {
|
||||
export default function DevelopmentAssistant() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
@@ -19,7 +19,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
return {
|
||||
props: {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.development_assistant",
|
||||
title: "Dashboard.development_assistant_page",
|
||||
isBot,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import {parse} from "next-useragent";
|
||||
import DashboardInspectorExpertComponent from "@/components/dashboard/inspector-expert";
|
||||
|
||||
const requiredPermissions = ["inspector_expert"];
|
||||
export default function PassengerOffice() {
|
||||
export default function InspectorExpert() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {parse} from "next-useragent";
|
||||
import DashboardProvinceHeadExpertComponent from "@/components/dashboard/province-head-expert";
|
||||
|
||||
const requiredPermissions = ["province_head_expert"];
|
||||
export default function PassengerOffice() {
|
||||
export default function ProvinceHeadExpertOffice() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
@@ -19,7 +19,7 @@ export async function getServerSideProps({req, locale}) {
|
||||
return {
|
||||
props: {
|
||||
messages: (await import(`&/locales/${locale}/app.json`)).default,
|
||||
title: "Dashboard.province_manager_page",
|
||||
title: "Dashboard.province_head_expert",
|
||||
isBot,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import {parse} from "next-useragent";
|
||||
import DashboardRefahiProvinceManagerComponent from "@/components/dashboard/refahi-province-manager";
|
||||
|
||||
const requiredPermissions = ["province_manager"];
|
||||
export default function PassengerOffice() {
|
||||
export default function RefahiProvinceManager() {
|
||||
return (
|
||||
<WithAuthMiddleware>
|
||||
<RolePermissionMiddleware requiredPermissions={requiredPermissions}>
|
||||
|
||||
Reference in New Issue
Block a user