a Bug Fixed

Kahdooei
YasamanKahdooei 2024-07-14 13:03:45 +03:30
parent a5a3c48a61
commit e1b6237318
5 changed files with 55 additions and 40 deletions

View File

@ -207,7 +207,11 @@ export default function ComplainsDetails({
{/* Editt */} {/* Editt */}
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col lg:h-[80vh] mb-10"> <div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col lg:h-[80vh] mb-10">
{/* 1 */} {/* 1 */}
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3"> <div
className={`flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3 ${
possibleOperations.length == 0 && "hidden"
}`}
>
{/* ***** */} {/* ***** */}
<div className=" bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full"> <div className=" bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full">
<p className="text-[#464646] text-base font-bold mb-1"> <p className="text-[#464646] text-base font-bold mb-1">
@ -225,7 +229,11 @@ export default function ComplainsDetails({
</div> </div>
{/* 2 */} {/* 2 */}
<div className="flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 "> <div
className={`flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 ${
possibleOperations.length == 0 && "lg:w-full"
}`}
>
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col md:flex-row gap-2 items-center justify-center"> <div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col md:flex-row gap-2 items-center justify-center">
{data?.user == null ? ( {data?.user == null ? (
<> <>
@ -344,19 +352,25 @@ export default function ComplainsDetails({
className="flex flex-col mt-4 gap-y-4 overflow-auto className="flex flex-col mt-4 gap-y-4 overflow-auto
scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 " 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 ( return (
<div <div
key={item.id} key={item.id}
className="p-4 bg-white rounded-lg shadow-md " className="p-4 bg-white rounded-lg shadow-md "
> >
<div className="flex items-center gap-4 justify-between"> <div className="flex items-center gap-4 justify-between">
<div>
<span className=" flex items-center justify-center w-8 h-8 bg-blue-100 rounded-full -start-4 ring-2 ring-blue bg-blue2 text-black">
{array.length - index}
</span>
<p className=""> <p className="">
<Badge> <Badge>
{item.operationWithDescription.description} توسط{" "} {item.operationWithDescription.description}{" "}
{item.sender == 0 ? "شهروند" : "بازرس"} توسط {item.sender == 0 ? "شهروند" : "بازرس"}
</Badge> </Badge>
</p> </p>
</div>
<p className=""> <p className="">
<span className="text-[#7C838A] text-sm"> <span className="text-[#7C838A] text-sm">
{convertFullTime(item.dateTime)} {convertFullTime(item.dateTime)}

View File

@ -184,7 +184,6 @@ export default function InspectorOperations({
className="resize-none bg-white lg:min-h-[20em]" className="resize-none bg-white lg:min-h-[20em]"
{...field} {...field}
readOnly={possibleOperations.length == 0} readOnly={possibleOperations.length == 0}
onChange={(e) => { onChange={(e) => {
const currentValue = e.target.value; const currentValue = e.target.value;
if (currentValue.length <= data?.maxTextLength) { if (currentValue.length <= data?.maxTextLength) {
@ -192,10 +191,11 @@ export default function InspectorOperations({
handleTextChange(e); handleTextChange(e);
} else { } else {
// Truncate the value to the allowed limit // Truncate the value to the allowed limit
field.onChange(currentValue.substring(0, data?.maxTextLength)); field.onChange(
currentValue.substring(0, data?.maxTextLength)
);
} }
}} }}
/> />
</FormControl> </FormControl>
{!error ? ( {!error ? (
@ -264,7 +264,7 @@ export default function InspectorOperations({
<FormDescription className=" text-xs my-1 "> <FormDescription className=" text-xs my-1 ">
<span> <span>
حجم هر فایل حداکثر می بایست {formatSize(data?.maxFileSize)}{" "} حجم هر فایل حداکثر می بایست {formatSize(data?.maxFileSize)}{" "}
مگابایت باشد باشد
</span>{" "} </span>{" "}
و{" "} و{" "}
{`تعداد فایل های پیوست شده می بایست حداکثر ${data?.maxFileCount} تا باشد.`} {`تعداد فایل های پیوست شده می بایست حداکثر ${data?.maxFileCount} تا باشد.`}

View File

@ -82,7 +82,8 @@ export default function RequestStep2() {
OrganizationId: z.string({ OrganizationId: z.string({
required_error: "لطفا دستگاه مربوطه را انتخاب نمایید.", required_error: "لطفا دستگاه مربوطه را انتخاب نمایید.",
}), }),
person: z.string() person: z
.string()
.min(1, { .min(1, {
message: "لطفا نام فرد مورد نظر را بنویسید.", message: "لطفا نام فرد مورد نظر را بنویسید.",
}) })
@ -292,7 +293,7 @@ export default function RequestStep2() {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="flex flex-col w-full mt-6" className="flex flex-col w-full mt-6 max-sm:gap-4"
> >
<FormField <FormField
control={form.control} control={form.control}
@ -312,7 +313,7 @@ export default function RequestStep2() {
</FormItem> </FormItem>
)} )}
/> />
<div className="flex flex-row flex-wrap justify-between"> <div className="flex flex-row flex-wrap justify-between max-sm:gap-4">
<FormField <FormField
control={form.control} control={form.control}
name="OrganizationId" name="OrganizationId"
@ -373,12 +374,7 @@ export default function RequestStep2() {
handlePersonCharCountChange(e); handlePersonCharCountChange(e);
} else { } else {
// Truncate the value to the allowed limit // Truncate the value to the allowed limit
field.onChange( field.onChange(currentValue.substring(0, 50));
currentValue.substring(
0,
50
)
);
} }
}} }}
/> />
@ -424,7 +420,7 @@ export default function RequestStep2() {
)} )}
/> />
<div className="flex flex-row flex-wrap justify-between mb-2"> <div className="flex flex-row flex-wrap justify-between mb-2 max-sm:gap-4">
{/* Select Option */} {/* Select Option */}
<FormField <FormField
control={form.control} control={form.control}
@ -527,19 +523,19 @@ export default function RequestStep2() {
}} }}
/> />
</div> </div>
{/* {!error ? ( {!error ? (
<FormDescription className=" text-xs my-1 "> <FormDescription className=" text-xs my-1 ">
<span> <span>
حجم هر فایل حداکثر می بایست{" "} حجم هر فایل حداکثر می بایست{" "}
{formatSize(optionsData?.maxFileSize)} مگابایت باشد {formatSize(optionsData?.maxFileSize)} باشد
</span>{" "} </span>
و{" "} و {" "}
{`تعداد فایل های پیوست شده می بایست حداکثر ${optionsData?.maxFileCount} تا باشد.`} {`تعداد فایل های پیوست شده می بایست حداکثر ${optionsData?.maxFileCount} تا باشد.`}
</FormDescription> </FormDescription>
) : ( ) : (
<FormMessage /> <FormMessage />
)} */} )}
<FormMessage /> {/* <FormMessage /> */}
</FormItem> </FormItem>
); );
}} }}
@ -598,10 +594,10 @@ export default function RequestStep2() {
)} )}
</div> </div>
<div className="flex justify-center w-full gap-2 mt-4 sm:justify-end"> <div className="flex justify-center w-full gap-2 mt-0 sm:justify-end">
<Button <Button
type="submit" type="submit"
className="w-1/2 p-2 mb-4 text-center text-white sm:w-1/3 lg:w-1/4 bg-blue rounded-xl" className="w-1/2 p-2 mb-3 text-center text-white sm:w-1/3 lg:w-1/4 bg-blue rounded-xl"
> >
{authorizedComplaintSubmitMutation.isPending || {authorizedComplaintSubmitMutation.isPending ||
complaintSubmitMutation.isPending ? ( complaintSubmitMutation.isPending ? (

View File

@ -18,8 +18,13 @@ function convertDate(date: string) {
.format("YYYY/M/DD"); .format("YYYY/M/DD");
return convertedDate; return convertedDate;
} }
const registeredAt = localStorage.getItem("registeredAt"); // const registeredAt = localStorage.getItem("registeredAt");
const convertedDate = registeredAt ? convertDate(registeredAt) : "Invalid Date"; // const convertedDate = registeredAt ? convertDate(registeredAt) : "Invalid Date";
const currentDate = new Date();
const formattedDate = currentDate.toISOString();
const convertedDate = convertDate(formattedDate);
const PrintPage: React.FC<PrintPageProps> = ({ const PrintPage: React.FC<PrintPageProps> = ({
contentRef, contentRef,

View File

@ -80,7 +80,7 @@ const SelectContent = React.forwardRef<
<SelectPrimitive.Content <SelectPrimitive.Content
ref={ref} ref={ref}
className={cn( className={cn(
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", "relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
position === "popper" && position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className className