From 98c815fa353e7cb77280c1f9ff4e1d1e5050abf4 Mon Sep 17 00:00:00 2001 From: amel Date: Mon, 13 Jan 2025 10:50:55 +0800 Subject: [PATCH] rev: batasan maximal upload file Deskripsi: - project, task, dan dokumen divisi maximal 100mb - user profile dan banner desa maximal 10mb nb: di server blm bisa NO Issues --- src/module/banner/ui/create_banner.tsx | 4 ++-- src/module/banner/ui/edit_banner.tsx | 4 ++-- src/module/document/ui/drawer_menu_document_division.tsx | 4 ++-- src/module/project/ui/add_file_detail_project.tsx | 4 ++-- src/module/project/ui/create_project.tsx | 8 ++++---- src/module/task/ui/add_file_detail_task.tsx | 4 ++-- src/module/task/ui/create_task.tsx | 4 ++-- src/module/user/member/ui/create_member.tsx | 4 ++-- src/module/user/member/ui/edit_member.tsx | 4 ++-- src/module/user/profile/ui/edit_profile.tsx | 4 ++-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/module/banner/ui/create_banner.tsx b/src/module/banner/ui/create_banner.tsx index fbd4afe..8331050 100644 --- a/src/module/banner/ui/create_banner.tsx +++ b/src/module/banner/ui/create_banner.tsx @@ -119,10 +119,10 @@ function CreateBanner() { onValidation('image', files[0]) }} activateOnClick={false} - maxSize={1 * 1024 ** 2} + maxSize={10 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic']} onReject={(files) => { - return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') + return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB') }} onClick={() => openRef.current?.()} > diff --git a/src/module/banner/ui/edit_banner.tsx b/src/module/banner/ui/edit_banner.tsx index 30c5d91..346c30d 100644 --- a/src/module/banner/ui/edit_banner.tsx +++ b/src/module/banner/ui/edit_banner.tsx @@ -120,10 +120,10 @@ export default function EditBanner() { onValidation('image', files[0]) }} activateOnClick={false} - maxSize={1 * 1024 ** 2} + maxSize={10 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic']} onReject={(files) => { - return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') + return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB') }} onClick={() => openRef.current?.()} > diff --git a/src/module/document/ui/drawer_menu_document_division.tsx b/src/module/document/ui/drawer_menu_document_division.tsx index f6de9db..a1d67bf 100644 --- a/src/module/document/ui/drawer_menu_document_division.tsx +++ b/src/module/document/ui/drawer_menu_document_division.tsx @@ -148,13 +148,13 @@ export default function DrawerMenuDocumentDivision() { onUploadFile(files[0]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} onReject={(files) => { refresh.set(true) setOpenModal(false) setOpenDrawerDocument(false) - toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') + toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB') }} > openRef.current?.()}> diff --git a/src/module/project/ui/add_file_detail_project.tsx b/src/module/project/ui/add_file_detail_project.tsx index b1ceb76..71f3582 100644 --- a/src/module/project/ui/add_file_detail_project.tsx +++ b/src/module/project/ui/add_file_detail_project.tsx @@ -105,10 +105,10 @@ export default function AddFileDetailProject() { cekFileName(files[0]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} onReject={(files) => { - return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') + return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB') }} > diff --git a/src/module/project/ui/create_project.tsx b/src/module/project/ui/create_project.tsx index 1a09ae0..97a2ef3 100644 --- a/src/module/project/ui/create_project.tsx +++ b/src/module/project/ui/create_project.tsx @@ -412,10 +412,10 @@ export default function CreateProject() { setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} onReject={(files) => { - return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') + return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB') }} > @@ -437,10 +437,10 @@ export default function CreateProject() { setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf']} onReject={(files) => { - return toast.error('File yang diizinkan: .png, .jpg, .heic, .pdf dengan ukuran maksimal 3 MB') + return toast.error('File yang diizinkan: .png, .jpg, .heic, .pdf dengan ukuran maksimal 100 MB') }} > openRef.current?.()}> diff --git a/src/module/task/ui/add_file_detail_task.tsx b/src/module/task/ui/add_file_detail_task.tsx index a992454..25183e3 100644 --- a/src/module/task/ui/add_file_detail_task.tsx +++ b/src/module/task/ui/add_file_detail_task.tsx @@ -106,10 +106,10 @@ export default function AddFileDetailTask() { cekFileName(files[0]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} onReject={(files) => { - return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') + return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB') }} > diff --git a/src/module/task/ui/create_task.tsx b/src/module/task/ui/create_task.tsx index fc24332..70f4c7a 100644 --- a/src/module/task/ui/create_task.tsx +++ b/src/module/task/ui/create_task.tsx @@ -335,10 +335,10 @@ export default function CreateTask() { setListFile([...listFile, { name: files[0].name, extension: files[0].type.split("/")[1] }]) }} activateOnClick={false} - maxSize={3 * 1024 ** 2} + maxSize={100 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic', 'application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']} onReject={(files) => { - return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 3 MB') + return toast.error('File yang diizinkan: .csv, .png, .jpg, .heic, .pdf, .doc, .docx, .xls, .xlsx dengan ukuran maksimal 100 MB') }} > diff --git a/src/module/user/member/ui/create_member.tsx b/src/module/user/member/ui/create_member.tsx index c306312..7c78b48 100644 --- a/src/module/user/member/ui/create_member.tsx +++ b/src/module/user/member/ui/create_member.tsx @@ -283,10 +283,10 @@ export default function CreateMember() { setIMG(buffer) }} activateOnClick={false} - maxSize={1 * 1024 ** 2} + maxSize={10 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic']} onReject={(files) => { - return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') + return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB') }} > diff --git a/src/module/user/member/ui/edit_member.tsx b/src/module/user/member/ui/edit_member.tsx index f9acc2e..d47b630 100644 --- a/src/module/user/member/ui/edit_member.tsx +++ b/src/module/user/member/ui/edit_member.tsx @@ -215,10 +215,10 @@ export default function EditMember({ id }: { id: string }) { setIMG(buffer) }} activateOnClick={false} - maxSize={1 * 1024 ** 2} + maxSize={10 * 1024 ** 2} accept={['image/png', 'image/jpeg', 'image/heic']} onReject={(files) => { - return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB') + return toast.error('File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB') }} > diff --git a/src/module/user/profile/ui/edit_profile.tsx b/src/module/user/profile/ui/edit_profile.tsx index beee85b..e0e6750 100644 --- a/src/module/user/profile/ui/edit_profile.tsx +++ b/src/module/user/profile/ui/edit_profile.tsx @@ -178,11 +178,11 @@ export default function EditProfile() { setIMG(buffer); }} activateOnClick={false} - maxSize={1 * 1024 ** 2} + maxSize={10 * 1024 ** 2} accept={["image/png", "image/jpeg", "image/heic"]} onReject={(files) => { return toast.error( - "File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 1 MB" + "File yang diizinkan: .png, .jpg, dan .heic dengan ukuran maksimal 10 MB" ); }} >