From 7bc0f76da48eb31c5ed8fc78861c22df723cbfd4 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Sat, 31 May 2025 15:03:34 +0530 Subject: [PATCH 1/3] added modal name- Assign Employee --- src/components/Project/MapUsers.jsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Project/MapUsers.jsx b/src/components/Project/MapUsers.jsx index bb429789..c72c1c0d 100644 --- a/src/components/Project/MapUsers.jsx +++ b/src/components/Project/MapUsers.jsx @@ -144,17 +144,24 @@ const MapUsers = ({ {employeeLoading && allocationEmployeesData.length === 0 && ( -

Loading...

+ + Loading.. + )} {!employeeLoading && allocationEmployeesData.length === 0 && filteredData.length === 0 && ( -

All employee assigned to Project.

+ + + All employee assigned to Project. + )} {!employeeLoading && allocationEmployeesData.length > 0 && filteredData.length === 0 && ( -

No matching employees found.

+ + No matching employees found. + )} {(filteredData.length > 0 || -- 2.43.0 From d25aa108f188cce5879657f9dd82b4fb65307e66 Mon Sep 17 00:00:00 2001 From: Pramod Mahajan Date: Sat, 31 May 2025 15:15:42 +0530 Subject: [PATCH 2/3] added title name for assign employee modal --- src/components/Project/MapUsers.jsx | 87 +++++++++++++++-------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/components/Project/MapUsers.jsx b/src/components/Project/MapUsers.jsx index c72c1c0d..512b0985 100644 --- a/src/components/Project/MapUsers.jsx +++ b/src/components/Project/MapUsers.jsx @@ -14,9 +14,13 @@ const MapUsers = ({ assignedLoading, setAssignedLoading, }) => { - const { employeesList, loading: employeeLoading, error } = useAllEmployees(false); + const { + employeesList, + loading: employeeLoading, + error, + } = useAllEmployees(false); const [selectedEmployees, setSelectedEmployees] = useState([]); - const [ searchText, setSearchText ] = useState( "" ); + const [searchText, setSearchText] = useState(""); const handleAllocationData = Array.isArray(allocation) ? allocation : []; @@ -96,9 +100,8 @@ const MapUsers = ({ }); }; - const handleSubmit = () => - { - setAssignedLoading(true) + const handleSubmit = () => { + setAssignedLoading(true); const selected = selectedEmployees .filter((emp) => emp.isSelected) .map((emp) => ({ empID: emp.id, jobRoleId: emp.jobRoleId })); @@ -108,32 +111,33 @@ const MapUsers = ({ } else { showToast("Please select Employee", "error"); } - }; return ( <>
-
-
- {(filteredData.length > 0 || - allocationEmployeesData.length > 0)&& ( -
- setSearchQuery(e.target.value)} - /> -
- )} -
+
+
-
-
- Select Employee -
-
+

Assign Employee

+ +
+ {(filteredData.length > 0 || + allocationEmployeesData.length > 0) && ( +
+ setSearchQuery(e.target.value)} + /> +
+ )} + +

Select Employee

+
+
- {employeeLoading && allocationEmployeesData.length === 0 && ( - + )} @@ -152,17 +155,18 @@ const MapUsers = ({ {!employeeLoading && allocationEmployeesData.length === 0 && filteredData.length === 0 && ( - - - - + + + )} - {!employeeLoading && allocationEmployeesData.length > 0 && filteredData.length === 0 && ( + {!employeeLoading && + allocationEmployeesData.length > 0 && + filteredData.length === 0 && ( - - - )} + + + )} {(filteredData.length > 0 || allocationEmployeesData.length > 0) && @@ -181,14 +185,11 @@ const MapUsers = ({
{(filteredData.length > 0 || - allocationEmployeesData.length > 0) && ( - - )} + allocationEmployeesData.length > 0) && ( + + )}
Loading..
All employee assigned to Project.
All employee assigned to Project.
No matching employees found.
No matching employees found.