From e1b62373188699ea107aed7bbbee98bec417a127 Mon Sep 17 00:00:00 2001 From: YasamanKahdooei Date: Sun, 14 Jul 2024 13:03:45 +0330 Subject: [PATCH] a Bug Fixed --- components/ComplainsDetails.tsx | 32 ++++++++++++++++------ components/InspectorOperations.tsx | 8 +++--- components/RequestStep2.tsx | 44 ++++++++++++++---------------- components/printPage.tsx | 9 ++++-- components/ui/select.tsx | 2 +- 5 files changed, 55 insertions(+), 40 deletions(-) diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx index 1a480a0..120c48e 100644 --- a/components/ComplainsDetails.tsx +++ b/components/ComplainsDetails.tsx @@ -207,7 +207,11 @@ export default function ComplainsDetails({ {/* Editt */}
{/* 1 */} -
+
{/* ***** */}

@@ -225,7 +229,11 @@ export default function ComplainsDetails({

{/* 2 */} -
+
{data?.user == null ? ( <> @@ -344,19 +352,25 @@ export default function ComplainsDetails({ className="flex flex-col mt-4 gap-y-4 overflow-auto scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 " > - {data.contents?.map((item: any) => { + {data.contents?.map((item: any, index: any, array: any) => { return (
-

- - {item.operationWithDescription.description} توسط{" "} - {item.sender == 0 ? "شهروند" : "بازرس"} - -

+
+ + {array.length - index} + +

+ + {item.operationWithDescription.description}{" "} + توسط {item.sender == 0 ? "شهروند" : "بازرس"} + +

+
+

{convertFullTime(item.dateTime)} diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx index bfba09a..a62013b 100644 --- a/components/InspectorOperations.tsx +++ b/components/InspectorOperations.tsx @@ -184,7 +184,6 @@ export default function InspectorOperations({ className="resize-none bg-white lg:min-h-[20em]" {...field} readOnly={possibleOperations.length == 0} - onChange={(e) => { const currentValue = e.target.value; if (currentValue.length <= data?.maxTextLength) { @@ -192,10 +191,11 @@ export default function InspectorOperations({ handleTextChange(e); } else { // Truncate the value to the allowed limit - field.onChange(currentValue.substring(0, data?.maxTextLength)); + field.onChange( + currentValue.substring(0, data?.maxTextLength) + ); } }} - /> {!error ? ( @@ -264,7 +264,7 @@ export default function InspectorOperations({ حجم هر فایل حداکثر می بایست {formatSize(data?.maxFileSize)}{" "} - مگابایت باشد + باشد {" "} و{" "} {`تعداد فایل های پیوست شده می بایست حداکثر ${data?.maxFileCount} تا باشد.`} diff --git a/components/RequestStep2.tsx b/components/RequestStep2.tsx index 5110847..89bf8fb 100644 --- a/components/RequestStep2.tsx +++ b/components/RequestStep2.tsx @@ -82,13 +82,14 @@ export default function RequestStep2() { OrganizationId: z.string({ required_error: "لطفا دستگاه مربوطه را انتخاب نمایید.", }), - person: z.string() - .min(1, { - message: "لطفا نام فرد مورد نظر را بنویسید.", - }) - .max(50, { - message: "تعداد کاراکترها بیشتر از حد مجاز میباشد.", - }), + person: z + .string() + .min(1, { + message: "لطفا نام فرد مورد نظر را بنویسید.", + }) + .max(50, { + message: "تعداد کاراکترها بیشتر از حد مجاز میباشد.", + }), description: z .string() .min(1, { @@ -292,7 +293,7 @@ export default function RequestStep2() {

)} /> -
+
@@ -424,7 +420,7 @@ export default function RequestStep2() { )} /> -
+
{/* Select Option */}
- {/* {!error ? ( + {!error ? ( حجم هر فایل حداکثر می بایست{" "} - {formatSize(optionsData?.maxFileSize)} مگابایت باشد - {" "} - و{" "} + {formatSize(optionsData?.maxFileSize)} باشد + + و {" "} {`تعداد فایل های پیوست شده می بایست حداکثر ${optionsData?.maxFileCount} تا باشد.`} ) : ( - )} */} - + )} + {/* */} ); }} @@ -598,10 +594,10 @@ export default function RequestStep2() { )}
-
+