From 2d2c775e7cfcd7de80b72a1217d6cec42110055c Mon Sep 17 00:00:00 2001 From: Amin Ghasempoor Date: Wed, 12 Mar 2025 22:33:58 +0000 Subject: [PATCH 1/2] Feature/permission check --- public/locales/fa/app.json | 1 + .../Form/UserInfoForm/BuildTableUserInfo.jsx | 24 +-- .../Form/RevertForm/index.jsx | 2 +- .../Form/UserInfoForm/BuildTableUserInfo.jsx | 24 +-- .../Form/UserInfoForm/LegalTableContent.jsx | 157 +++++++++--------- .../Form/UserInfoForm/RealTableContent.jsx | 150 ++++++++--------- .../Form/UserInfoForm/index.jsx | 3 + .../Form/UserInfoForm/BuildTableUserInfo.jsx | 24 +-- .../refahi/transportation-assistant/index.jsx | 2 +- 9 files changed, 196 insertions(+), 191 deletions(-) diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 696e89d..cc320fd 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -238,6 +238,7 @@ "vehicle_type": "نوع ماشین", "state_name": "وضعیت درخواست", "revert": "بازگشت به معاون حمل و نقل", + "revert_refahi": "بازگشت به معاون توسعه", "confirm": "تایید نهایی و ارجاع به بانک", "upload_file_unit": "فایل بارگذاری شده باید حداکثر 5Mb باشد", "upload_file_format": "فرمت قابل قبول : png,jpg,pdf", diff --git a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx index 80ef334..4c754bb 100644 --- a/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/passenger-boss/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => { return( <> - + @@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => { - + @@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => { - - - - - - {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} - - - @@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => { + + + + + + + {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} + + + + ) } diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx index 0d78227..1f45c5c 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/RevertForm/index.jsx @@ -23,7 +23,7 @@ const Revert = ({ rowId, mutate }) => { }, }} > - {t("NavganProvinceManager.revert")} + {t("NavganProvinceManager.revert_refahi")} diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx index 80ef334..4c754bb 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => { return( <> - + @@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => { - + @@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => { - - - - - - {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} - - - @@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => { + + + + + + + {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} + + + + ) } diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx index 8c01afb..02f7e97 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/LegalTableContent.jsx @@ -1,6 +1,16 @@ -import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; +import { + Chip, + DialogContent, + DialogTitle, + Divider, + Grid, + Stack, + Typography +} from "@mui/material"; import { useTranslations } from "next-intl"; import moment from "jalali-moment"; +import BuildTableUserInfo from "./BuildTableUserInfo"; +import RestoreTableUserInfo from "./RestoreTableUserInfo"; const LegalTableContent = ({ rowId, row }) => { const t = useTranslations(); @@ -27,19 +37,19 @@ const LegalTableContent = ({ rowId, row }) => { - + - {row.original.project_title || t("UserInfoDialog.no_info")} + {row.original.activity_category_name || t("UserInfoDialog.no_info")} - + - {row.original.activity_category_name || t("UserInfoDialog.no_info")} + {row.original.project_title || t("UserInfoDialog.no_info")} @@ -217,26 +227,6 @@ const LegalTableContent = ({ rowId, row }) => { - - - - - - - {row.original.navgan_id || t("UserInfoDialog.no_info")} - - - - - - - - - {row.original.navgan_type || t("UserInfoDialog.no_info")} - - - - @@ -260,26 +250,44 @@ const LegalTableContent = ({ rowId, row }) => { - + - {row.original.vehicle_type || t("UserInfoDialog.no_info")} + {row.original.project_province_name || t("UserInfoDialog.no_info")} - + + + {row.original.project_city_name} + + + + + + + {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} + + + + + + {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")} + + + @@ -289,11 +297,11 @@ const LegalTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -329,53 +337,46 @@ const LegalTableContent = ({ rowId, row }) => { + + + + + + + {row.original.project_axis || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_direction || t("UserInfoDialog.no_info")} + + + + + {row.original.refahi_type === 1 ? () : () } - + - - - {row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")} - - - - {row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")} - - - {row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")} - - - {row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")} - - - + + {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_address || t("UserInfoDialog.no_info")} + @@ -394,4 +395,4 @@ const LegalTableContent = ({ rowId, row }) => { ); }; -export default LegalTableContent; +export default LegalTableContent; \ No newline at end of file diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx index 34e4223..20b3038 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/RealTableContent.jsx @@ -1,6 +1,9 @@ -import { Chip, DialogContent, DialogTitle, Divider, Grid, Stack, Typography } from "@mui/material"; +import { Button, Chip, DialogContent, DialogTitle, Divider, Grid, Link, Stack, Typography } from "@mui/material"; import { useTranslations } from "next-intl"; import moment from "jalali-moment"; +import DownloadIcon from "@mui/icons-material/Download"; +import BuildTableUserInfo from "./BuildTableUserInfo"; +import RestoreTableUserInfo from "./RestoreTableUserInfo"; const RealTableContent = ({ rowId, row }) => { const t = useTranslations(); @@ -27,19 +30,19 @@ const RealTableContent = ({ rowId, row }) => { - + - {row.original.project_title || t("UserInfoDialog.no_info")} + {row.original.activity_category_name || t("UserInfoDialog.no_info")} - + - {row.original.activity_category_name || t("UserInfoDialog.no_info")} + {row.original.project_title || t("UserInfoDialog.no_info")} @@ -193,26 +196,6 @@ const RealTableContent = ({ rowId, row }) => { - - - - - - - {row.original.navgan_id || t("UserInfoDialog.no_info")} - - - - - - - - - {row.original.navgan_type || t("UserInfoDialog.no_info")} - - - - @@ -236,26 +219,44 @@ const RealTableContent = ({ rowId, row }) => { - + - {row.original.vehicle_type || t("UserInfoDialog.no_info")} + {row.original.project_province_name || t("UserInfoDialog.no_info")} - + + + {row.original.project_city_name} + + + + + + + {row.original.investment_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.investment_amount / 1000000000, - }) + value: row.original.investment_amount / 1000000000, + }) : t("UserInfoDialog.toman", { value: row.original.investment_amount / 1000000 })} + + + + + + {row.original.welfare_complex_degree || t("UserInfoDialog.no_info")} + + + @@ -265,11 +266,11 @@ const RealTableContent = ({ rowId, row }) => { {row.original.requested_facility_amount / 1000000 >= 1000 ? t("UserInfoDialog.milyard", { - value: row.original.requested_facility_amount / 1000000000, - }) + value: row.original.requested_facility_amount / 1000000000, + }) : t("UserInfoDialog.toman", { - value: row.original.requested_facility_amount / 1000000, - })} + value: row.original.requested_facility_amount / 1000000, + })} @@ -285,53 +286,46 @@ const RealTableContent = ({ rowId, row }) => { + + + + + + + {row.original.project_axis || t("UserInfoDialog.no_info")} + + + + + + + + + {row.original.project_direction || t("UserInfoDialog.no_info")} + + + + + {row.original.refahi_type === 1 ? () : () } - + - - - {row.original.plate_number.split("-")[3] || t("UserInfoDialog.no_info")} - - - - {row.original.plate_number.split("-")[2] || t("UserInfoDialog.no_info")} - - - {row.original.plate_number.split("-")[1] || t("UserInfoDialog.no_info")} - - - {row.original.plate_number.split("-")[0] || t("UserInfoDialog.no_info")} - - - + + {row.original.project_kilometer_marker || t("UserInfoDialog.no_info")} + + + + + + + + + + + {row.original.project_address || t("UserInfoDialog.no_info")} + @@ -350,4 +344,4 @@ const RealTableContent = ({ rowId, row }) => { ); }; -export default RealTableContent; +export default RealTableContent; \ No newline at end of file diff --git a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx index aa67e15..90de161 100644 --- a/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx +++ b/src/components/dashboard/refahi/refahi-province-manager/Form/UserInfoForm/index.jsx @@ -39,6 +39,9 @@ const UserInfoForm = ({ rowId, row }) => { + diff --git a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx index 80ef334..4c754bb 100644 --- a/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx +++ b/src/components/dashboard/refahi/transportation-assistance/Form/UserInfoForm/BuildTableUserInfo.jsx @@ -7,7 +7,7 @@ const BuildTableUserInfo = ({row}) => { return( <> - + @@ -16,7 +16,7 @@ const BuildTableUserInfo = ({row}) => { - + @@ -25,15 +25,6 @@ const BuildTableUserInfo = ({row}) => { - - - - - - {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} - - - @@ -73,6 +64,17 @@ const BuildTableUserInfo = ({row}) => { + + + + + + + {row.original.basic_approval_renewal_date || t("UserInfoDialog.no_info")} + + + + ) } diff --git a/src/pages/dashboard/refahi/transportation-assistant/index.jsx b/src/pages/dashboard/refahi/transportation-assistant/index.jsx index df0564e..b4495c9 100644 --- a/src/pages/dashboard/refahi/transportation-assistant/index.jsx +++ b/src/pages/dashboard/refahi/transportation-assistant/index.jsx @@ -13,7 +13,7 @@ export async function getServerSideProps({ req, locale }) { title: "Dashboard.transportation_assistance", isBot, locale, - layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_navgan"] } }, //پرمیشن باید عوض بشه + layout: { name: "DashboardLayout", props: { permissions: ["manage_transportation_refahi"] } }, //پرمیشن باید عوض بشه }, }; } From 5fa72d6422325454293f99628a92bcd486400785 Mon Sep 17 00:00:00 2001 From: Amirhossein Mahmoodi Date: Thu, 13 Mar 2025 02:08:03 +0330 Subject: [PATCH 2/2] change version --- .env.local.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.local.example b/.env.local.example index 8fbb380..fdfd94d 100644 --- a/.env.local.example +++ b/.env.local.example @@ -1,5 +1,5 @@ NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard" -NEXT_PUBLIC_API_VERSION = "2.9.0" +NEXT_PUBLIC_API_VERSION = "2.10.0" NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa" NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl"