Merge branch 'release/v1.8.6'

This commit is contained in:
AmirHossein Mahmoodi
2023-09-30 12:12:36 +03:30
10 changed files with 35 additions and 62 deletions

View File

@@ -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"

View File

@@ -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": "نام فارسی",

View File

@@ -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"))
});

View File

@@ -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({

View File

@@ -56,18 +56,6 @@ function DashboardExpertManagementComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) => row.email,
id: "email",
header: t("ExpertMangement.email"),
enableColumnFilter: true,
datatype: "text",
filterFn: "contains",
columnFilterModeOptions: ["contains", "equals", "notEquals"],
Cell: ({renderedCellValue}) => (
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) => row.phone_number,
id: "phone_number",
@@ -116,18 +104,6 @@ function DashboardExpertManagementComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
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}) => (
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) => row.roles[0].name_fa,
id: "roles[0].name_fa",

View File

@@ -82,6 +82,15 @@ function DashboardNavganLoanManagementComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) => row.province_name,
id: "province_name",
header: t("NavganLoanManagement.province_name"),
enableColumnFilter: false,
Cell: ({renderedCellValue}) => (
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) =>
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),

View File

@@ -82,6 +82,15 @@ function DashboardRefahiLoanManagementComponent() {
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) => row.province_name,
id: "province_name",
header: t("RefahiLoanManagement.province_name"),
enableColumnFilter: false,
Cell: ({renderedCellValue}) => (
<Typography variant="body2">{renderedCellValue}</Typography>
),
},
{
accessorFn: (row) =>
moment(row.created_at).locale("fa").format("HH:mm | yyyy/MM/DD"),

View File

@@ -105,7 +105,8 @@ function DataTable(props) {
positionToolbarAlertBanner="bottom"
renderTopToolbarCustomActions={({table}) => (<>
{props.enableCustomToolbar /* send condition */ ?
<props.CustomToolbar fetchUrl={fetchUrl} mutate={mutate}/> /* send component */ : ""}
<props.CustomToolbar fetchUrl={fetchUrl}
mutate={mutate}/> /* send component */ : <span></span>}
</>)}
renderBottomToolbarCustomActions={({table}) => (<>
{props.enableLastUpdate /* send condition */ ? (<Typography

View File

@@ -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) {

View File

@@ -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;
}