From b04f754eaddf04078ada7b011e0a511bfffd87e8 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 09:31:35 +0330 Subject: [PATCH 1/7] TF-104 add province column in loan management page --- public/locales/fa/app.json | 2 ++ .../dashboard/navgan-loan-management/index.jsx | 9 +++++++++ .../dashboard/refahi-loan-management/index.jsx | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index c335958..70f243a 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": "کد ناوگان", 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"), From 039bd3c6e310e04aab1316ddc0c305b78ebb3b7b Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 11:05:18 +0330 Subject: [PATCH 2/7] TF-105 remove require email and city in add and edit form expert management page --- public/locales/fa/app.json | 12 ++++++------ .../Form/CreateForm/CreateContent.jsx | 4 ++-- .../Form/UpdateForm/UpdateContent.jsx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index 70f243a..f4df724 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -389,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": "نام کاربری", @@ -405,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": "ابتدا استان خود را انتخاب کنید", @@ -442,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({ From 274c80130f263caa464d19069a3f27008e3cc327 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 11:06:10 +0330 Subject: [PATCH 3/7] TF-105 fixed bug style top toolbar datatable --- src/core/components/DataTable.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 */ ? ( Date: Sat, 30 Sep 2023 11:07:11 +0330 Subject: [PATCH 4/7] TF-105 remove email and ciry column from datatable expert management page --- .../dashboard/expert-management/index.jsx | 24 ------------------- 1 file changed, 24 deletions(-) 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", From 62ce40fbb2c4bca8ae53a57dee12745c7b390f27 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 11:08:42 +0330 Subject: [PATCH 5/7] TF-105 fixed bug useNetwork --- src/lib/app/hooks/useNetwork.jsx | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) 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; } From d221eea9b3775ede4abbd08cb66712db1b0b001a Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 11:09:15 +0330 Subject: [PATCH 6/7] TF-105 fixed bug logic error 422 --- src/core/utils/errorHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/utils/errorHandler.js b/src/core/utils/errorHandler.js index 9bd18f1..8dbd364 100644 --- a/src/core/utils/errorHandler.js +++ b/src/core/utils/errorHandler.js @@ -48,7 +48,7 @@ const isServerError = status => 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) { From 2596daf1b8369850fa0d410336a129c8ee3c5246 Mon Sep 17 00:00:00 2001 From: AmirHossein Mahmoodi Date: Sat, 30 Sep 2023 12:12:12 +0330 Subject: [PATCH 7/7] change version --- example.env.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"