diff --git a/example.env.local b/example.env.local index 6a02763..24d5b8e 100644 --- a/example.env.local +++ b/example.env.local @@ -1,5 +1,5 @@ NEXT_PUBLIC_API_NAME = "Loan Facilities Dashboard" -NEXT_PUBLIC_API_VERSION = "1.7.5" +NEXT_PUBLIC_API_VERSION = "1.8.6" NEXT_PUBLIC_DEFAULT_LANGUAGE = "fa" NEXT_PUBLIC_DEFAULT_DIRECTION = "rtl" diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index c335958..f4df724 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -210,6 +210,7 @@ "id": "کد یکتا", "national_id": "کد ملی", "phone_number": "موبایل", + "province_name": "استان", "created_at": "تاریخ درخواست", "updated_at": "تاریخ بروزرسانی", "navgan_id": "کد ناوگان", @@ -221,6 +222,7 @@ "id": "کد یکتا", "national_id": "کد ملی", "phone_number": "موبایل", + "province_name": "استان", "created_at": "تاریخ درخواست", "updated_at": "تاریخ بروزرسانی", "navgan_id": "کد ناوگان", @@ -387,11 +389,11 @@ "button_submit": "افزودن کارشناس", "button_close": "بستن", "button_delete": "حذف", - "add": "افزودن کارشناس", + "add": "افزودن", "button-cancel": "بستن", "button-confirm": "ثبت", - "create": "افزودن کارشناس", - "update": "ویرایش کارشناس", + "create": "افزودن", + "update": "ویرایش", "change_password": "تغییر رمز عبور", "text_field_name": "نام", "text_field_username": "نام کاربری", @@ -403,8 +405,8 @@ "text_field_province_id": "استان", "text_field_city_id": "شهر", "text_field_role_id": "نقش", - "text_field_loading_provinces_list": "درحال دریافت شهر ها", - "text_field_error_fetching_provinces": "خطا در دریافت شهر ها", + "text_field_loading_provinces_list": "درحال دریافت استان ها", + "text_field_error_fetching_provinces": "خطا در دریافت استان ها", "text_field_loading_roles_list": "درحال دریافت نقش ها", "text_field_error_fetching_roles": "خطا در دریافت نقش ها", "text_field_please_select_province": "ابتدا استان خود را انتخاب کنید", @@ -440,7 +442,7 @@ "button-delete": "حذف کردن" }, "AddDialog": { - "add": "افزودن کاربر جدید", + "add": "افزودن", "name": "نام انگلیسی", "name_error": "وارد کردن نام انگلیسی الزامیست", "name_fa": "نام فارسی", diff --git a/src/components/dashboard/expert-management/Form/CreateForm/CreateContent.jsx b/src/components/dashboard/expert-management/Form/CreateForm/CreateContent.jsx index 14e0032..dc9e62f 100644 --- a/src/components/dashboard/expert-management/Form/CreateForm/CreateContent.jsx +++ b/src/components/dashboard/expert-management/Form/CreateForm/CreateContent.jsx @@ -61,7 +61,7 @@ const CreateContent = ({setOpenCreateDialog, mutate, fetchUrl}) => { const validationSchema = Yup.object().shape({ name: Yup.string().required(t("ExpertMangement.error_message_name")), username: Yup.string().required(t("ExpertMangement.error_message_username")), - email: Yup.string().required(t("ExpertMangement.error_message_email")), + email: Yup.string(), phone_number: Yup.string().required(t("ExpertMangement.error_message_phone_number")), national_id: Yup.string().required(t("ExpertMangement.error_message_national_id")), password: Yup.string() @@ -72,7 +72,7 @@ const CreateContent = ({setOpenCreateDialog, mutate, fetchUrl}) => { ), position: Yup.string().required(t("ExpertMangement.error_message_position")), province_id: Yup.string().required(t("ExpertMangement.error_message_province_id")), - city_id: Yup.string().required(t("ExpertMangement.error_message_city_id")), + city_id: Yup.string(), role_id: Yup.string().required(t("ExpertMangement.error_message_role_id")) }); diff --git a/src/components/dashboard/expert-management/Form/UpdateForm/UpdateContent.jsx b/src/components/dashboard/expert-management/Form/UpdateForm/UpdateContent.jsx index a18dd01..dc6864c 100644 --- a/src/components/dashboard/expert-management/Form/UpdateForm/UpdateContent.jsx +++ b/src/components/dashboard/expert-management/Form/UpdateForm/UpdateContent.jsx @@ -54,12 +54,12 @@ const UpdateContent = ({row, fetchUrl, mutate, setOpenUpdateDialog}) => { const validationSchema = Yup.object().shape({ name: Yup.string().required(t("ExpertMangement.error_message_name")), username: Yup.string().required(t("ExpertMangement.error_message_username")), - email: Yup.string().required(t("ExpertMangement.error_message_email")), + email: Yup.string(), phone_number: Yup.string().required(t("ExpertMangement.error_message_phone_number")), national_id: Yup.string().required(t("ExpertMangement.error_message_national_id")), position: Yup.string().required(t("ExpertMangement.error_message_position")), province_id: Yup.string().required(t("ExpertMangement.error_message_province_id")), - city_id: Yup.string().required(t("ExpertMangement.error_message_city_id")), + city_id: Yup.string(), role_id: Yup.string().required(t("ExpertMangement.error_message_role_id")) }); const formik = useFormik({ diff --git a/src/components/dashboard/expert-management/index.jsx b/src/components/dashboard/expert-management/index.jsx index a87cab0..2c711c5 100644 --- a/src/components/dashboard/expert-management/index.jsx +++ b/src/components/dashboard/expert-management/index.jsx @@ -56,18 +56,6 @@ function DashboardExpertManagementComponent() { {renderedCellValue} ), }, - { - accessorFn: (row) => row.email, - id: "email", - header: t("ExpertMangement.email"), - enableColumnFilter: true, - datatype: "text", - filterFn: "contains", - columnFilterModeOptions: ["contains", "equals", "notEquals"], - Cell: ({renderedCellValue}) => ( - {renderedCellValue} - ), - }, { accessorFn: (row) => row.phone_number, id: "phone_number", @@ -116,18 +104,6 @@ function DashboardExpertManagementComponent() { {renderedCellValue} ), }, - { - accessorFn: (row) => row.city_name, - id: "city_name", - header: t("ExpertMangement.city_name"), - enableColumnFilter: false, - datatype: "text", - filterFn: "contains", - columnFilterModeOptions: ["contains", "equals", "notEquals"], - Cell: ({renderedCellValue}) => ( - {renderedCellValue} - ), - }, { accessorFn: (row) => row.roles[0].name_fa, id: "roles[0].name_fa", diff --git a/src/components/dashboard/navgan-loan-management/index.jsx b/src/components/dashboard/navgan-loan-management/index.jsx index 97879be..27cf5c0 100644 --- a/src/components/dashboard/navgan-loan-management/index.jsx +++ b/src/components/dashboard/navgan-loan-management/index.jsx @@ -82,6 +82,15 @@ function DashboardNavganLoanManagementComponent() { {renderedCellValue} ), }, + { + accessorFn: (row) => row.province_name, + id: "province_name", + header: t("NavganLoanManagement.province_name"), + enableColumnFilter: false, + Cell: ({renderedCellValue}) => ( + {renderedCellValue} + ), + }, { accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"), diff --git a/src/components/dashboard/refahi-loan-management/index.jsx b/src/components/dashboard/refahi-loan-management/index.jsx index 6bb3753..4ae7238 100644 --- a/src/components/dashboard/refahi-loan-management/index.jsx +++ b/src/components/dashboard/refahi-loan-management/index.jsx @@ -82,6 +82,15 @@ function DashboardRefahiLoanManagementComponent() { {renderedCellValue} ), }, + { + accessorFn: (row) => row.province_name, + id: "province_name", + header: t("RefahiLoanManagement.province_name"), + enableColumnFilter: false, + Cell: ({renderedCellValue}) => ( + {renderedCellValue} + ), + }, { accessorFn: (row) => moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"), diff --git a/src/core/components/DataTable.jsx b/src/core/components/DataTable.jsx index 1ec20b4..b41f19f 100644 --- a/src/core/components/DataTable.jsx +++ b/src/core/components/DataTable.jsx @@ -105,7 +105,8 @@ function DataTable(props) { positionToolbarAlertBanner="bottom" renderTopToolbarCustomActions={({table}) => (<> {props.enableCustomToolbar /* send condition */ ? - /* send component */ : ""} + /* send component */ : } )} renderBottomToolbarCustomActions={({table}) => (<> {props.enableLastUpdate /* send condition */ ? ( status >= 500 && status <= 599; const isClientError = status => status >= 400 && status <= 499; const errorLogic = (response, t, notification) => { - if (notification) ErrorNotification(t, response.status) + if (notification) ErrorNotification(t, response.status, response.data.message) } const errorValidation = (response, t, notification) => { if (notification) { diff --git a/src/lib/app/hooks/useNetwork.jsx b/src/lib/app/hooks/useNetwork.jsx index 84e2950..9c436a5 100644 --- a/src/lib/app/hooks/useNetwork.jsx +++ b/src/lib/app/hooks/useNetwork.jsx @@ -1,29 +1,5 @@ import {useEffect, useState} from "react"; -function getNetworkConnection() { - return ( - navigator.connection || - navigator.mozConnection || - navigator.webkitConnection || - null - ); -} - -function getNetworkConnectionInfo() { - const connection = getNetworkConnection(); - if (!connection) { - return {}; - } - return { - rtt: connection.rtt, - type: connection.type, - saveData: connection.saveData, - downLink: connection.downLink, - downLinkMax: connection.downLinkMax, - effectiveType: connection.effectiveType, - }; -} - function useNetwork() { const [state, setState] = useState(() => { return { @@ -51,7 +27,7 @@ function useNetwork() { window.removeEventListener("offline", handleOffline); }; }, []); - + return state; }