From 5fabccf339c2a10dd52f174da94cec7f734b90b4 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Tue, 7 Nov 2023 14:04:49 +0330 Subject: [PATCH 1/2] LFFE-18 upload file jpeg --- public/locales/fa/app.json | 4 ++-- .../machinary-office/Form/ConfirmForm/ConfirmContent.jsx | 2 +- .../Form/ConfirmForm/ConfirmContent.jsx | 4 ++-- .../passenger-boss/Form/ConfirmForm/ConfirmContent.jsx | 2 +- .../passenger-office/Form/ConfirmForm/ConfirmContent.jsx | 2 +- .../Form/ConfirmForm/ConfirmContent.jsx | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/locales/fa/app.json b/public/locales/fa/app.json index f3effaf..70fb49e 100644 --- a/public/locales/fa/app.json +++ b/public/locales/fa/app.json @@ -324,10 +324,10 @@ "updated_at": "تاریخ بروزرسانی" }, "ConfirmDialog": { - "confirm": "تایید", + "confirm": "ارجاع", "context": "آیا از تایید این آیتم اطمینان دارید؟", "button-cancel": "بستن", - "button-confirm": "تایید", + "button-confirm": "ارجاع", "description_error": "وارد کردن توضیحات الزامی است!", "optional": " (اختیاری)", "unit": " (ریال)", diff --git a/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx index 75dd563..ea8687d 100644 --- a/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/machinary-office/Form/ConfirmForm/ConfirmContent.jsx @@ -33,7 +33,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { }) .test('fileType', `${t("MachinaryOffice.upload_file_format")}`, (value) => { // if (!value) return true; // Skip if no file is provided - const allowedTypes = ['image/jpg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }); diff --git a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx index 8ca532e..44106b4 100644 --- a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx @@ -25,7 +25,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { }) .test('fileType', `${t("NavganProvinceManager.upload_file_format")}`, (value) => { if (!value) return true - const allowedTypes = ['image/jpg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpeg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }) @@ -71,7 +71,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { setShowAddIcon(false); } }; - + console.log(formik.values.confirm_img) return ( <> diff --git a/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx index e51d01c..d86a0e6 100644 --- a/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/passenger-boss/Form/ConfirmForm/ConfirmContent.jsx @@ -31,7 +31,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { return value.size <= 2 * 1024 * 1024; }) .test('fileType', `${t("PassengerBoss.upload_file_format")}`, (value) => { - const allowedTypes = ['image/jpg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }); diff --git a/src/components/dashboard/passenger-office/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/passenger-office/Form/ConfirmForm/ConfirmContent.jsx index 458f8b5..d86c4f2 100644 --- a/src/components/dashboard/passenger-office/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/passenger-office/Form/ConfirmForm/ConfirmContent.jsx @@ -25,7 +25,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { }) .test('fileType', `${t("PassengerOffice.upload_file_format")}`, (value) => { if (!value) return true - const allowedTypes = ['image/jpg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }) diff --git a/src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx index 949dd04..0dcec2a 100644 --- a/src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/transportation-assistance/Form/ConfirmForm/ConfirmContent.jsx @@ -25,7 +25,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { }) .test('fileType', `${t("TransportationAssistance.upload_file_format")}`, (value) => { if (!value) return true - const allowedTypes = ['image/jpg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }) From 354632f171454273e59ffc475d7338094dbaf740 Mon Sep 17 00:00:00 2001 From: AminGhasempoor Date: Tue, 7 Nov 2023 14:10:27 +0330 Subject: [PATCH 2/2] LFFE-18 debuging --- .../Form/ConfirmForm/ConfirmContent.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx b/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx index 44106b4..daa4df9 100644 --- a/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx +++ b/src/components/dashboard/navgan-province-manager/Form/ConfirmForm/ConfirmContent.jsx @@ -25,7 +25,7 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { }) .test('fileType', `${t("NavganProvinceManager.upload_file_format")}`, (value) => { if (!value) return true - const allowedTypes = ['image/jpeg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types + const allowedTypes = ['image/jpg', 'image/jpeg', 'image/png', 'application/pdf']; // Define your allowed file types return allowedTypes.includes(value.type); }) }) @@ -71,7 +71,6 @@ const ConfirmContent = ({rowId, mutate, setOpenConfirmDialog}) => { setShowAddIcon(false); } }; - console.log(formik.values.confirm_img) return ( <>