From 00c7604c63420b20af97bff9f776d03e28d54f8a Mon Sep 17 00:00:00 2001 From: Hossein Rahmani Date: Wed, 17 Jul 2024 11:39:31 +0330 Subject: [PATCH] Bugs of meeting fixed --- components/AttachmentsDialog.tsx | 109 +++++++++++++++++++---------- components/CitizenLogin.tsx | 5 +- components/ComplainsDetails.tsx | 47 +++++++------ components/FollowUp.tsx | 7 +- components/InspectorOperations.tsx | 7 +- components/ProfileDropDown.tsx | 7 +- components/RequestResult.tsx | 2 +- components/RequestStep1.tsx | 2 +- components/RequestStep2.tsx | 62 +++++++++++----- components/SubmitRequest.tsx | 8 +-- components/TabController.tsx | 2 +- components/TableController.tsx | 2 +- components/printPage.tsx | 4 +- components/ui/select.tsx | 68 +++++++++--------- constants/index.tsx | 2 +- 15 files changed, 202 insertions(+), 132 deletions(-) diff --git a/components/AttachmentsDialog.tsx b/components/AttachmentsDialog.tsx index 98e4233..a8c393b 100644 --- a/components/AttachmentsDialog.tsx +++ b/components/AttachmentsDialog.tsx @@ -7,6 +7,19 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog"; + +import { + AlertDialog, + AlertDialogAction, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, + AlertDialogTrigger, +} from "@/components/ui/alert-dialog"; + import { X } from "lucide-react"; import { Button } from "./ui/button"; export default function AttachmentsDialog({ @@ -24,48 +37,68 @@ export default function AttachmentsDialog({ {children} - - پیوست‌ها - - {attachments.length != 0 && ( - - )} + + + پیوست‌ها + + {attachments.length != 0 && ( + + {" "} + + )} - {attachments.length == 0 ? ( -
هیج پیوستی وجود ندارد.
- ) : ( -
- {attachments?.map((item, index) => { - return ( -
-
- {index + 1} -
-
-
-

{item.name}

+ {attachments.length == 0 ? ( +
هیج پیوستی وجود ندارد.
+ ) : ( +
+ {attachments?.map((item, index) => { + return ( +
+
+ {index + 1}
+
+
+

+ {item.name} +

+
- deleteFile(item.name)} - className=" cursor-pointer hover:drop-shadow-md" - /> + deleteFile(item.name)} + className=" cursor-pointer hover:drop-shadow-md" + /> +
-
- ); - })} -
- )} - - + ); + })} +
+ )} + + + + آیا میخواهید همه ی فایلها را حذف کنید؟ + + + + + + لغو + deleteAllAttachmentsFiles()} + > + تایید + + + + + +
); diff --git a/components/CitizenLogin.tsx b/components/CitizenLogin.tsx index ed28661..f5f4e5d 100644 --- a/components/CitizenLogin.tsx +++ b/components/CitizenLogin.tsx @@ -139,7 +139,10 @@ export default function CitizenLogin() { رمز عبور */} - + diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx index 120c48e..bee0ac1 100644 --- a/components/ComplainsDetails.tsx +++ b/components/ComplainsDetails.tsx @@ -47,7 +47,11 @@ export default function ComplainsDetails({ const storeData = useData((state) => state.data); let data; - const openFileInNewTab = (base64Data: any, fileType: any) => { + const openFileInNewTab = ( + base64Data: any, + fileType: any, + fileName?: string + ) => { const blob = b64toBlob(base64Data, fileType); const blobUrl = URL.createObjectURL(blob); const newTab = window.open(); @@ -66,9 +70,7 @@ export default function ComplainsDetails({ `` ); } else { - newTab.document.write( - `Open in New Tab` - ); + downloadFile(base64Data, fileName, fileType); } newTab.document.write(""); @@ -160,7 +162,7 @@ export default function ComplainsDetails({ رمز عبور - برای مشاهده درخواست رمز عبور خود را وارد نمایید. + برای مشاهده گزارش رمز عبور خود را وارد نمایید.
@@ -248,7 +250,7 @@ export default function ComplainsDetails({

- دستگاه مربوطه:{" "} + واحد مرتبط:{" "} {data?.complaintOrganization ? data?.complaintOrganization.title @@ -256,7 +258,7 @@ export default function ComplainsDetails({

- فرد مربوطه:{" "} + فرد مرتبط:{" "} {data.complaining ? data.complaining : "-"} @@ -288,7 +290,7 @@ export default function ComplainsDetails({

- دستگاه مربوطه:{" "} + دستگاه مرتبط:{" "} {data?.complaintOrganization ? data?.complaintOrganization.title @@ -296,7 +298,7 @@ export default function ComplainsDetails({

- فرد مربوطه:{" "} + فرد مرتبط:{" "} {data.complaining ? data.complaining : "-"} @@ -346,7 +348,7 @@ export default function ComplainsDetails({

- روند شکایت + روند رسیدگی گزارش

+ openFileInNewTab( + item.data, + item.mimeType, + item.title + ) + } > - - openFileInNewTab( - item.data, - item.mimeType - ) - } - className="flex items-center gap-2 truncate cursor-pointer " - > + -

+

{item.title}

- downloadFile( @@ -416,7 +417,7 @@ export default function ComplainsDetails({ item.mimeType ) } - /> + /> */}
); })} diff --git a/components/FollowUp.tsx b/components/FollowUp.tsx index b65374d..c999b1a 100644 --- a/components/FollowUp.tsx +++ b/components/FollowUp.tsx @@ -85,7 +85,7 @@ export default function FollowUp() {

- لطفا جهت پیگیری درخواست و مشاهده وضعیت آن کد رهگیری و رمز عبور خود را + لطفا جهت پیگیری گزارش و مشاهده وضعیت آن کد رهگیری و رمز عبور خود را وارد نمایید.

@@ -93,6 +93,7 @@ export default function FollowUp() {
@@ -125,6 +127,7 @@ export default function FollowUp() { @@ -154,7 +157,7 @@ export default function FollowUp() { />
) : ( - "پیگیری درخواست" + "پیگیری گزارش" )}
diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx index a62013b..8fb97b2 100644 --- a/components/InspectorOperations.tsx +++ b/components/InspectorOperations.tsx @@ -150,6 +150,11 @@ export default function InspectorOperations({ OperationMutation.mutate(formData); } + const deleteAllAttachmentsFiles = () => { + setfirst([]); + form.setValue("media", []); + }; + const deleteFileFromAttachments = (file: any) => { const filtered = first?.filter((item) => item.name !== file); setfirst(filtered); @@ -218,9 +223,9 @@ export default function InspectorOperations({
console.log("1")} attachments={first} deleteFile={(item) => deleteFileFromAttachments(item)} + deleteAllAttachmentsFiles={deleteAllAttachmentsFiles} > diff --git a/components/ProfileDropDown.tsx b/components/ProfileDropDown.tsx index 3343098..611fe9a 100644 --- a/components/ProfileDropDown.tsx +++ b/components/ProfileDropDown.tsx @@ -74,7 +74,10 @@ export default function ProfileDropDown() { className=" max-sm:-mr-8 max-sm:text-xs w-12" asChild > -