From b22d27d10996ee6a01cadad24f69de67d3212152 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 28 Jun 2025 10:55:37 +0330 Subject: [PATCH 1/4] fixed bug --- src/lib/contexts/DataTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/contexts/DataTable.js b/src/lib/contexts/DataTable.js index 8409ba8..a772799 100644 --- a/src/lib/contexts/DataTable.js +++ b/src/lib/contexts/DataTable.js @@ -85,7 +85,7 @@ const DataTableProvider = ({ children, user_id, page_name, table_name, columns, } else { acc[column.id] = { id: column.id, - value: storeFilter?.value || "", + value: storeFilter?.value ?? "", filterMode: storeFilter?.filterMode || column.filterMode, datatype: column.datatype, }; From 575a88c6059109bea6fc84cd2205a4af6a366148 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 28 Jun 2025 16:43:01 +0330 Subject: [PATCH 2/4] fixed bug --- .../NotificationDesign/AskForKeepData.jsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/core/components/NotificationDesign/AskForKeepData.jsx b/src/core/components/NotificationDesign/AskForKeepData.jsx index 118ccc2..e6fa9f3 100644 --- a/src/core/components/NotificationDesign/AskForKeepData.jsx +++ b/src/core/components/NotificationDesign/AskForKeepData.jsx @@ -7,10 +7,27 @@ import { toast } from "react-toastify"; import useTableSetting from "@/lib/hooks/useTableSetting"; import { flattenObjectOfObjects } from "@/core/utils/flattenObjectOfObjects"; +function filterFalseValues(obj) { + const result = {}; + + for (const [key, value] of Object.entries(obj)) { + if (value === false) { + result[key] = false; + } else if (typeof value === 'object' && value !== null && !Array.isArray(value)) { + const nested = filterFalseValues(value); + if (Object.keys(nested).length > 0) { + result[key] = nested; + } + } + } + + return result; +} + function AskForKeepData({ filterData, sortData, hideData, user_id, page_name, table_name, columns }) { const { filterAction, sortAction, hideAction } = useTableSetting(); - const filteredHideData = Object.fromEntries(Object.entries(hideData).filter(([key, value]) => value === false)); + const filteredHideData = filterFalseValues(hideData); const flattenHideData = flattenObjectOfObjects(filteredHideData); From 93335b1f742367c00bb9706545a09df34980cef6 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Tue, 8 Jul 2025 10:53:51 +0330 Subject: [PATCH 3/4] fixed bug --- .../dashboard/road-missions/control/page.js | 9 +++++---- .../dashboard/road-missions/operator/page.js | 8 ++++---- .../road-missions/transportation/page.js | 9 +++++---- .../Form/GetItemInfo/MissionDates/index.jsx | 4 ++-- .../Actions/Create/Form/GetItemInfo/index.jsx | 4 ++-- .../Actions/Create/Form/Rahdaran/Form/index.jsx | 2 ++ .../Create/Form/RequestMachines/Form/index.jsx | 6 +++--- .../Actions/Create/Form/Verify/index.jsx | 4 ++-- .../operator/Actions/Create/Form/index.jsx | 4 ++-- .../operator/Actions/Create/index.jsx | 16 ++++++++-------- .../RowActions/Edit/EditController/index.jsx | 16 ++++++++-------- .../Form/MachinesDialog/MachineList/index.jsx | 1 + src/core/utils/pageMenuDev.js | 6 +++--- 13 files changed, 47 insertions(+), 42 deletions(-) diff --git a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/control/page.js b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/control/page.js index 1fd96ba..e22ce33 100644 --- a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/control/page.js +++ b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/control/page.js @@ -1,4 +1,5 @@ import ControlPage from "@/components/dashboard/roadMissions/control"; +import WithPermission from "@/core/middlewares/withPermission"; export const metadata = { title: "کارتابل کنترل", @@ -6,10 +7,10 @@ export const metadata = { const Page = () => { return ( <> - {/* */} - - {/* */} - {/* */} + + + {/* */} + ); }; diff --git a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/operator/page.js b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/operator/page.js index 55f3975..a788616 100644 --- a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/operator/page.js +++ b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/operator/page.js @@ -7,10 +7,10 @@ export const metadata = { const Page = () => { return ( <> - {/* */} - - {/* */} - {/* */} + + + {/* */} + ); }; diff --git a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/transportation/page.js b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/transportation/page.js index 187f888..ff62cff 100644 --- a/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/transportation/page.js +++ b/src/app/(withAuth)/(dashboardLayout)/dashboard/road-missions/transportation/page.js @@ -1,4 +1,5 @@ import TransportationPage from "@/components/dashboard/roadMissions/transportation"; +import WithPermission from "@/core/middlewares/withPermission"; export const metadata = { title: "کارتابل نقلیه", @@ -6,10 +7,10 @@ export const metadata = { const Page = () => { return ( <> - {/* */} - - {/* */} - {/* */} + + + {/* */} + ); }; diff --git a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/GetItemInfo/MissionDates/index.jsx b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/GetItemInfo/MissionDates/index.jsx index 5e6717f..9cf2029 100644 --- a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/GetItemInfo/MissionDates/index.jsx +++ b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/GetItemInfo/MissionDates/index.jsx @@ -26,7 +26,7 @@ const MissionDates = ({ control }) => { }} /> - {type == 2 && ( + {type == 1 && ( { }} /> - {type == 2 && ( + {type == 1 && ( schema.required("زمان شروع ماموریت را مشخص کنید!"), otherwise: (schema) => schema.notRequired(), }), end_date: string().required("تاریخ پایان ماموریت را مشخص کنید!"), end_time: string().when("type", { - is: "2", + is: "1", then: (schema) => schema.required("زمان شروع ماموریت را مشخص کنید!"), otherwise: (schema) => schema.notRequired(), }), diff --git a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Rahdaran/Form/index.jsx b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Rahdaran/Form/index.jsx index 83c23af..5b29ca0 100644 --- a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Rahdaran/Form/index.jsx +++ b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Rahdaran/Form/index.jsx @@ -1,6 +1,7 @@ import RahdarCode from "@/core/components/RahdarCode"; import StyledForm from "@/core/components/StyledForm"; import { yupResolver } from "@hookform/resolvers/yup"; +import { Add } from "@mui/icons-material"; import { Button, Stack } from "@mui/material"; import { Controller, useForm } from "react-hook-form"; import { object } from "yup"; @@ -53,6 +54,7 @@ const RahdaranForm = ({ setRahdaran }) => { type="submit" sx={{ textWrap: "nowrap", px: 3 }} disabled={isSubmitting || !isValid} + startIcon={} > افزودن راهدار diff --git a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/RequestMachines/Form/index.jsx b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/RequestMachines/Form/index.jsx index b6682a8..7d80762 100644 --- a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/RequestMachines/Form/index.jsx +++ b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/RequestMachines/Form/index.jsx @@ -54,7 +54,7 @@ const RequestMachinesForm = ({ requests, setRequests }) => { )} /> - + { )} /> - + diff --git a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Verify/index.jsx b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Verify/index.jsx index c131573..41a652a 100644 --- a/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Verify/index.jsx +++ b/src/components/dashboard/roadMissions/operator/Actions/Create/Form/Verify/index.jsx @@ -42,7 +42,7 @@ const Verify = ({ types, regions, allData, handlePrev, submitForm, submitting }) تاریخ شروع ماموریت - {allData.type == 2 ? ( + {allData.type == 1 ? ( تاریخ پایان ماموریت - {allData.type == 2 ? ( + {allData.type == 1 ? ( { type: result.type, zone: result.region, end_point: result.end_point, - ...(result.type == 2 + ...(result.type == 1 ? { - start_date: `${result.start_date} ${moment(result.start_time).format("HH:mm")}`, - end_date: `${result.end_date} ${moment(result.end_time).format("HH:mm")}`, - } + start_date: `${result.start_date} ${moment(result.start_time).format("HH:mm")}`, + end_date: `${result.end_date} ${moment(result.end_time).format("HH:mm")}`, + } : { - start_date: result.start_date, - end_date: result.end_date, - }), + start_date: result.start_date, + end_date: result.end_date, + }), }, hasSidebarUpdate: true, }) @@ -46,7 +46,7 @@ const Create = ({ mutate }) => { mutate(); setOpen(false); }) - .catch((error) => {}) + .catch((error) => { }) .finally(() => { setSubmitting(false); }); diff --git a/src/components/dashboard/roadMissions/operator/RowActions/Edit/EditController/index.jsx b/src/components/dashboard/roadMissions/operator/RowActions/Edit/EditController/index.jsx index 40adcc5..612bac4 100644 --- a/src/components/dashboard/roadMissions/operator/RowActions/Edit/EditController/index.jsx +++ b/src/components/dashboard/roadMissions/operator/RowActions/Edit/EditController/index.jsx @@ -38,15 +38,15 @@ const EditController = ({ row, mutate, openEditDialog, setOpenEditDialog }) => { type: result.type, zone: result.region, end_point: result.end_point, - ...(result.type == 2 + ...(result.type == 1 ? { - start_date: `${result.start_date} ${moment(result.start_time).format("HH:mm")}`, - end_date: `${result.end_date} ${moment(result.end_time).format("HH:mm")}`, - } + start_date: `${result.start_date} ${moment(result.start_time).format("HH:mm")}`, + end_date: `${result.end_date} ${moment(result.end_time).format("HH:mm")}`, + } : { - start_date: result.start_date, - end_date: result.end_date, - }), + start_date: result.start_date, + end_date: result.end_date, + }), }, hasSidebarUpdate: true, notificationSuccess: true, @@ -55,7 +55,7 @@ const EditController = ({ row, mutate, openEditDialog, setOpenEditDialog }) => { mutate(); setOpenEditDialog(false); }) - .catch((error) => {}) + .catch((error) => { }) .finally(() => { setSubmitting(false); }); diff --git a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx index 3e48a20..fd7a643 100644 --- a/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx +++ b/src/components/dashboard/roadMissions/transportation/RowActions/Allocation/Form/MachinesDialog/MachineList/index.jsx @@ -38,6 +38,7 @@ const MachinesList = ({ request, dispatch, setOpenMachinesDialog }) => { Date: Tue, 8 Jul 2025 10:57:27 +0330 Subject: [PATCH 4/4] change to version 1.4.2 --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index eb0a3f0..89127cb 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ HOST="rms.witel.ir" -NEXT_PUBLIC_VERSION="1.4.0" +NEXT_PUBLIC_VERSION="1.4.2" NEXT_PUBLIC_API_URL="https://rms.witel.ir" NEXT_PUBLIC_MAPTILE_ENDPOINT="https://rmsmap.rmto.ir/141map" \ No newline at end of file