Other bugs of meeting fixed

Kahdooei
Hossein Rahmani 2024-07-18 10:40:50 +03:30
parent 2a6e6fffaf
commit e3477dd28b
3 changed files with 36 additions and 23 deletions

View File

@ -165,7 +165,7 @@ export default function ComplainsDetails({
برای مشاهده گزارش رمز عبور خود را وارد نمایید. برای مشاهده گزارش رمز عبور خود را وارد نمایید.
</AlertDialogDescription> </AlertDialogDescription>
</AlertDialogHeader> </AlertDialogHeader>
<div className="grid items-center gap-1.5 w-full px-10 mx-auto"> <div className="grid items-center gap-1.5 w-full px-6 mx-auto">
{/* <Label htmlFor="picture">Picture</Label> */} {/* <Label htmlFor="picture">Picture</Label> */}
<Input <Input
dir="ltr" dir="ltr"
@ -207,15 +207,15 @@ 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-[79vh] mb-10">
{/* 1 */} {/* 1 */}
<div <div
className={`flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3 ${ className={`flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[79vh] max-lg:order-3 ${
possibleOperations.length == 0 && "hidden" 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-6 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">
انجام عملیات انجام عملیات
</p> </p>
@ -236,7 +236,7 @@ export default function ComplainsDetails({
possibleOperations.length == 0 && "lg:w-full" 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-6 flex flex-col md:flex-row gap-2 items-center justify-center">
{data?.user == null ? ( {data?.user == null ? (
<> <>
<div className="relative flex flex-col w-full p-5 mt-2 border border-gray-400 rounded-md gap-y-1"> <div className="relative flex flex-col w-full p-5 mt-2 border border-gray-400 rounded-md gap-y-1">
@ -346,7 +346,7 @@ export default function ComplainsDetails({
</div> </div>
<div className="h-[calc(80vh-11.5em)] max-h-[calc(80vh-11.5em)] overflow-hidden"> <div className="h-[calc(80vh-11.5em)] max-h-[calc(80vh-11.5em)] overflow-hidden">
<div className="bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col h-full "> <div className="bg-[#E9E9E9] rounded-md py-4 px-6 flex flex-col h-full ">
<p className="text-[#464646] text-base font-bold"> <p className="text-[#464646] text-base font-bold">
روند رسیدگی گزارش روند رسیدگی گزارش
</p> </p>
@ -357,7 +357,7 @@ export default function ComplainsDetails({
{data.contents?.map((item: any, index: any, array: any) => { {data.contents?.map((item: any, index: any, array: any) => {
return ( return (
<> <>
<div className="flex flex-row gap-2 "> <div className="flex max-sm:flex-col flex-row gap-2 m-1">
<div className="flex"> <div className="flex">
<span className=" flex items-center justify-center w-7 h-7 mt-1 mr-1 bg-blue-100 rounded-md -start-4 ring-2 ring-blue bg-blue2 text-white bg-blue"> <span className=" flex items-center justify-center w-7 h-7 mt-1 mr-1 bg-blue-100 rounded-md -start-4 ring-2 ring-blue bg-blue2 text-white bg-blue">
{array.length - index} {array.length - index}
@ -391,7 +391,7 @@ export default function ComplainsDetails({
</p> </p>
</div> </div>
<div className=" text-[#464646] mt-2"> <div className=" text-[#464646] mt-2">
<span className="text-[#7C838A] text-sm"> <span className="text-[#7C838A] text-sm flex flex-wrap whitespace-normal break-all mt-2">
{item.text ? item.text : "-"} {item.text ? item.text : "-"}
</span> </span>
</div> </div>
@ -414,12 +414,14 @@ export default function ComplainsDetails({
) )
} }
> >
<a className="flex items-center gap-2 truncate cursor-pointer "> <div className="flex items-center truncate gap-2 cursor-pointer w-full max-w-full">
<File className="w-6 h-6 " /> <div>
<p className=" max-w-full truncate"> <File className="w-6 h-6" />
</div>
<p className=" max-sm:max-w-[40vw] max-w-full truncate ">
{item.title} {item.title}
</p> </p>
</a> </div>
{/* <ArrowDownToLine {/* <ArrowDownToLine
className="cursor-pointer " className="cursor-pointer "
onClick={() => onClick={() =>

View File

@ -121,7 +121,10 @@ export default function InspectorOperations({
// Add the useEffect hook to monitor changes in the description field // Add the useEffect hook to monitor changes in the description field
useEffect(() => { useEffect(() => {
if (charCount != 0) {
setCharCount(form.watch("text")?.length); setCharCount(form.watch("text")?.length);
console.log(charCount);
}
}, [form.watch("text")]); }, [form.watch("text")]);
function handleTextChange(event: React.ChangeEvent<HTMLTextAreaElement>) { function handleTextChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
@ -168,14 +171,17 @@ export default function InspectorOperations({
const formatSize = (size: number) => { const formatSize = (size: number) => {
const string = formatBytes(size); const string = formatBytes(size);
return ( return (
<span className="" > <span className="">
{string[0]} {string[1]} {string[0]} {string[1]}
</span> </span>
); );
}; };
return ( return (
<Form {...form}> <Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className=""> <form
onSubmit={form.handleSubmit(onSubmit)}
className="flex flex-col h-full"
>
<FormField <FormField
control={form.control} control={form.control}
name="text" name="text"
@ -186,7 +192,7 @@ export default function InspectorOperations({
</FormLabel> </FormLabel>
<FormControl> <FormControl>
<Textarea <Textarea
className="resize-none bg-white lg:min-h-[20em]" className="resize-none bg-white lg:min-h-[19em]"
{...field} {...field}
readOnly={possibleOperations.length == 0} readOnly={possibleOperations.length == 0}
onChange={(e) => { onChange={(e) => {
@ -255,8 +261,13 @@ export default function InspectorOperations({
const fileArray1 = Array.from(first); const fileArray1 = Array.from(first);
const fileArray2 = Array.from(e.target.files); const fileArray2 = Array.from(e.target.files);
const mergedArray = fileArray1.concat(fileArray2); const mergedArray = fileArray1.concat(fileArray2);
setfirst(mergedArray); const uniqueFiles = Array.from(
field.onChange(mergedArray); new Map(
mergedArray.map((file: any) => [file.name, file])
).values()
);
setfirst(uniqueFiles);
field.onChange(uniqueFiles);
} else if (!first && e.target.files) { } else if (!first && e.target.files) {
const fileArray2 = Array.from(e.target.files); const fileArray2 = Array.from(e.target.files);
setfirst(fileArray2); setfirst(fileArray2);
@ -280,7 +291,7 @@ export default function InspectorOperations({
</FormItem> </FormItem>
)} )}
/> />
<div className="flex justify-between gap-2 mt-3 "> <div className="flex justify-between gap-2 mt-auto">
<FormField <FormField
control={form.control} control={form.control}
name="operation" name="operation"
@ -306,7 +317,7 @@ export default function InspectorOperations({
</FormControl> </FormControl>
<SelectContent dir="rtl"> <SelectContent dir="rtl">
<SelectGroup> <SelectGroup>
<SelectLabel>عملیات</SelectLabel> <SelectLabel>نوع عملیات</SelectLabel>
{possibleOperations.map((item: any) => { {possibleOperations.map((item: any) => {
return ( return (
<SelectItem <SelectItem

View File

@ -217,7 +217,7 @@ export default function RequestStep2() {
} }
// Add the useEffect hook to monitor changes in the description field // Add the useEffect hook to monitor changes in the description field
useEffect(() => { useEffect(() => {
setCharCount(form.watch("description").length); setCharCount(form.watch("description")?.length);
}, [form.watch("description")]); }, [form.watch("description")]);
function onSubmit(data: z.infer<typeof FormSchema>) { function onSubmit(data: z.infer<typeof FormSchema>) {