From 12971cf62fe3415b5548a78352995b43725849c6 Mon Sep 17 00:00:00 2001 From: Hamza Zulfiqar Date: Fri, 29 Sep 2023 15:17:53 +0500 Subject: [PATCH] ... --- client/src/Pages/Leads/Lead.jsx | 206 +++++++++++++-------------- client/src/Pages/Sales/Sales.jsx | 4 - client/src/Pages/Tasks/EditModal.jsx | 1 - client/src/Pages/Tasks/Task.jsx | 135 ++++++------------ client/src/Pages/Users/Clients.jsx | 7 - client/src/Pages/Users/Employees.jsx | 7 - server/models/lead.js | 1 - 7 files changed, 144 insertions(+), 217 deletions(-) diff --git a/client/src/Pages/Leads/Lead.jsx b/client/src/Pages/Leads/Lead.jsx index 242e0fe5..cdbbf7bf 100644 --- a/client/src/Pages/Leads/Lead.jsx +++ b/client/src/Pages/Leads/Lead.jsx @@ -61,133 +61,121 @@ const Lead = ({ open, setOpen, leadId, scroll }) => { - {isFetching ? ( -
- ) : ( - -
-
-
Lead Details
+ +
+
+
Lead Details
-
- - Property Details -
- -
- Property Type :{" "} - {currentLead?.propertyType} -
-
- Home Type :{" "} - {currentLead?.homeType} -
-
- Beds Required :{" "} - {currentLead?.beds} -
+
+ + Property Details +
+ +
+ Project :{" "} + {currentLead?.property.title} +
+
+ Priority :{" "} + {currentLead?.priority} +
-
- - Location -
- -
- Required City :{" "} - {currentLead?.city} -
+
+ + Location +
+ +
+ Required City : {currentLead?.city} +
-
- - Area -
- -
- Minimum Area :{" "} - {currentLead?.minArea} {currentLead?.minAreaUnit} -
-
- Maximum Area :{" "} - {currentLead?.maxArea} {currentLead?.maxAreaUnit} -
+
+ + Details +
+ -
- - Budget -
- -
- Minimum Budget :{" "} - Rs. {currentLead?.minBudget} -
-
- Maximum Budget :{" "} - Rs. {currentLead?.maxBudget} -
+
+ Source :{" "} + {currentLead?.source}
-
-
-
Customer Details
-
- {currentLead?.clientId?.firstName} {currentLead?.clientId?.lastName} -
-
-
- Gender :{" "} - {currentLead?.clientId?.gender} -
-
-
-
- CNIC :{" "} - {currentLead?.clientId?.CNIC} -
-
-
-
- Phone :{" "} - {currentLead?.clientId?.phone} -
+
+ + Description +
+ +
+ {currentLead?.description} +
+
+ +
+
+
Customer Details
+
+ {currentLead?.client?.username == "" ? "Null" : currentLead?.client?.username} +
+
+
+ CNIC :{" "} + + {currentLead?.client?.CNIC == "" ? "Null" : currentLead?.client?.CNIC} +
-
-
- Email:{" "} - {currentLead?.clientId?.email} -
+
+
+
+ Phone :{" "} + {currentLead?.client?.phone}
-
-
- Client Type :{" "} - {currentLead?.clientType} -
+
+
+
+ Email:{" "} + + {currentLead?.client?.email == "" ? "Null" : currentLead?.client?.email} +
-
-
- Created :{" "} - {format(currentLead?.createdAt)} -
+
+
+
+ Created :{" "} + {format(currentLead?.createdAt)}
+
-
-
-
- Allocated to :{" "} - {currentLead?.allocatedTo?.username} -
+
+
+
+ +
Allocated Persons
-
-
- Status :{" "} - {currentLead?.status} + {currentLead?.allocatedTo.length < 1 ? ( +
+ + {currentLead?.allocatedTo[0]?.username} +
+ ) : ( + currentLead?.allocatedTo.map((person) => ( +
+
{">"} {person.username}
+
+ )) + )} +
+
+
+ Status :{" "} + {currentLead?.status}
- - )} +
+
); diff --git a/client/src/Pages/Sales/Sales.jsx b/client/src/Pages/Sales/Sales.jsx index ded62f32..b66fc7e9 100644 --- a/client/src/Pages/Sales/Sales.jsx +++ b/client/src/Pages/Sales/Sales.jsx @@ -92,10 +92,6 @@ function Sales() { />
- - {" "} - - {" "} { }; const handleClose = () => { setOpen(false); - setOpenFromNavbar(false); }; return (
diff --git a/client/src/Pages/Tasks/Task.jsx b/client/src/Pages/Tasks/Task.jsx index 784da388..493c5819 100644 --- a/client/src/Pages/Tasks/Task.jsx +++ b/client/src/Pages/Tasks/Task.jsx @@ -5,13 +5,7 @@ import React from "react"; import { useDispatch, useSelector } from "react-redux"; import { useParams } from "react-router-dom"; import { getTask } from "../../redux/action/task"; -import { - PiCalendar, - PiNotepad, - PiSealCheck, - PiSealQuestion, - PiXLight, -} from "react-icons/pi"; +import { PiCalendar, PiNotepad, PiSealCheck, PiSealQuestion, PiXLight } from "react-icons/pi"; import { Divider, Dialog, DialogContent, DialogTitle, Slide } from "@mui/material"; import { format } from "timeago.js"; @@ -22,6 +16,7 @@ const Transition = React.forwardRef(function Transition(props, ref) { const Task = ({ open, setOpen }) => { /////////////////////////////////////// VARIABLES ////////////////////////////////////// const { currentTask: task, isFetching, error } = useSelector((state) => state.task); + console.log(task); /////////////////////////////////////// STATES ////////////////////////////////////// @@ -48,57 +43,77 @@ const Task = ({ open, setOpen }) => {
+
Completed Task Details
-
Task Details
-
- Title + Completed Task
-
{task?.title}
+
+ {task?.completedTask} +
Description
-
{task?.description}
+
+ {task?.completedTaskComment} +
-
-
+
+
- Created :{" "} - {format(task?.createdAt)} + Completed :{" "} + {format(task?.completedTaskDate)}
- Due Date :{" "} - {task?.dueDate} -
-
-
-
- - Priority : {task?.priority} + Status :{" "} + + {task?.completedTaskStatus == "successful" ? "Successful" : ""} + {task?.completedTaskStatus == "unsuccessful" ? "Unsuccessful" : ""} +
+
+
+ +
New Task Details
+ + +
+
+
+ + Next Task +
+ +
{task?.newTask}
-
+
+ + Description +
+ +
+ {task?.newTaskComment} +
+
+
+
- Status :{" "} - - {task?.status == "completed" ? "Completed" : ""} - {task?.status == "new" ? "New" : ""} - {task?.status == "overDue" ? "Over Due" : ""} - {task?.status == "inProgress" ? "In Progress" : ""} - + + Deadline in :{" "} + {format(task?.newTaskDeadline)}
@@ -107,62 +122,6 @@ const Task = ({ open, setOpen }) => {
- - // - - //
- - //
- //

{task?.title}

- //
- // - //
- //
- - //
- - //
- - //
- //
Description
- //
- //

{task?.description}

- //
- - //
- //
- //
- //
Settings
- //
- //
- // - // Start Date: - // {task?.createdAt} - //
- //
- // - // Due Date: - // {task?.dueDate} - //
- //
- // - // Status: - // {task?.status} - //
- //
- // - // Priority: - // {task?.priority} - //
- //
- //
- //
- - //
- - //
- - //
); }; diff --git a/client/src/Pages/Users/Clients.jsx b/client/src/Pages/Users/Clients.jsx index d8ff0935..bb3fbe49 100644 --- a/client/src/Pages/Users/Clients.jsx +++ b/client/src/Pages/Users/Clients.jsx @@ -156,13 +156,6 @@ const Clients = () => { /> } - - {" "} - handleClickOpen(params.row._id)} - className="cursor-pointer text-orange-500 text-[23px] hover:text-orange-400" - /> -
), }, diff --git a/client/src/Pages/Users/Employees.jsx b/client/src/Pages/Users/Employees.jsx index 2c630a86..5e57f8dd 100644 --- a/client/src/Pages/Users/Employees.jsx +++ b/client/src/Pages/Users/Employees.jsx @@ -98,13 +98,6 @@ const Employees = memo(() => { className="cursor-pointer text-red-500 text-[23px] hover:text-red-400" /> - - {" "} - hanldeOpenViewModal(params.row)} - className="cursor-pointer text-orange-500 text-[23px] hover:text-orange-400" - /> - {" "}