diff --git a/src/components/Directory/ManageContact.jsx b/src/components/Directory/ManageContact.jsx index f83c5875..04205961 100644 --- a/src/components/Directory/ManageContact.jsx +++ b/src/components/Directory/ManageContact.jsx @@ -470,9 +470,8 @@ const ManageContact = ({ contactId, closeModal }) => { )} - {/* Actions */} -
-
))} diff --git a/src/components/Expenses/ExpenseFilterPanel.jsx b/src/components/Expenses/ExpenseFilterPanel.jsx index 84e6eb8c..5e415821 100644 --- a/src/components/Expenses/ExpenseFilterPanel.jsx +++ b/src/components/Expenses/ExpenseFilterPanel.jsx @@ -187,7 +187,7 @@ const ExpenseFilterPanel = ({ onApply, handleGroupBy }) => {
+ +
{/* Remember Me + Forgot Password */} @@ -169,8 +200,8 @@ const LoginPage = () => { {loading ? "Please Wait..." : IsLoginWithOTP - ? "Send OTP" - : "Sign In"} + ? "Send OTP" + : "Sign In"} {/* Login With OTP Button */} diff --git a/src/pages/authentication/ResetPassword.jsx b/src/pages/authentication/ResetPassword.jsx index 9c7ab0d2..02a8084c 100644 --- a/src/pages/authentication/ResetPassword.jsx +++ b/src/pages/authentication/ResetPassword.jsx @@ -93,153 +93,155 @@ const ResetPassword = () => { ); } return ( -
-
-

Reset Password? 🔒

-

Enter your email and new password to update.

-
-
- - - {errors.email && ( -
- {errors.email.message} -
- )} -
- -
-
- -
-
- - -
- {errors.password && ( -
- {errors.password.message} -
- )} -
- {" "} - {" "} -
-
- - -
- {errors.confirmPassword && ( -
- {errors.confirmPassword.message} -
- )} -
- -
-

- Password must be at least 8 characters -

-

- Password must contain at least one uppercase letter -

-

- Password must contain at least one number -

-

- Password must contain at least one special character -

-
- - -
- +
+

Reset Password? 🔒

+

Enter your email and new password to update.

+
- - Back to login - +
+ + + {errors.email && ( +
+ {errors.email.message} +
+ )} +
+ +
+
+ +
+ +
+ + +
+ + {errors.password && ( +
+ {errors.password.message} +
+ )} +
+ {" "} + {" "} +
+
+ + +
+ {errors.confirmPassword && ( +
+ {errors.confirmPassword.message} +
+ )} +
+ +
+

+ Password must be at least 8 characters +

+

+ Password must contain at least one uppercase letter +

+

+ Password must contain at least one number +

+

+ Password must contain at least one special character +

+
+ + +
+ + + Back to login + +
-
-
+
); }; diff --git a/src/pages/employee/EmployeeList.jsx b/src/pages/employee/EmployeeList.jsx index 37bccb60..a7d6b918 100644 --- a/src/pages/employee/EmployeeList.jsx +++ b/src/pages/employee/EmployeeList.jsx @@ -18,7 +18,7 @@ import { VIEW_ALL_EMPLOYEES, VIEW_TEAM_MEMBERS, } from "../../utils/constants"; -import { clearCacheKey, useSelectedProject } from "../../slices/apiDataManager"; +import { clearCacheKey } from "../../slices/apiDataManager"; import { useHasUserPermission } from "../../hooks/useHasUserPermission"; import SuspendEmp from "../../components/Employee/SuspendEmp"; // Keep if you use SuspendEmp import { @@ -38,10 +38,9 @@ import usePagination from "../../hooks/usePagination"; import { setProjectId } from "../../slices/localVariablesSlice"; const EmployeeList = () => { - // const selectedProjectId = useSelector( - // (store) => store.localVariables.projectId - // ); - const selectedProjectId = useSelectedProject(); + const selectedProjectId = useSelector( + (store) => store.localVariables.projectId + ); const { projectNames, loading: projectLoading, fetchData } = useProjectName(); const dispatch = useDispatch(); @@ -79,11 +78,11 @@ const EmployeeList = () => { } ); -useEffect(() => { - if (!selectedProjectId && projectNames?.length > 0) { - dispatch(setProjectId(projectNames[0].id)); - } -}, [selectedProjectId, projectNames, dispatch]); + useEffect(() => { + if (selectedProjectId === null) { + dispatch(setProjectId(projectNames[0]?.id)); + } + }, [selectedProjectId]); const navigate = useNavigate(); const applySearchFilter = (data, text) => { @@ -177,12 +176,10 @@ useEffect(() => { useEffect(() => { if (!loading && Array.isArray(employees)) { const sorted = [...employees].sort((a, b) => { - const nameA = `${a.firstName || ""}${a.middleName || ""}${ - a.lastName || "" - }`.toLowerCase(); - const nameB = `${b.firstName || ""}${b.middleName || ""}${ - b.lastName || "" - }`.toLowerCase(); + const nameA = `${a.firstName || ""}${a.middleName || ""}${a.lastName || "" + }`.toLowerCase(); + const nameB = `${b.firstName || ""}${b.middleName || ""}${b.lastName || "" + }`.toLowerCase(); return nameA?.localeCompare(nameB); }); @@ -221,10 +218,10 @@ useEffect(() => { recallEmployeeData( showInactive, showAllEmployees ? null : selectedProjectId - ); + ); // Use selectedProjectId here } }, - [employees, showInactive, showAllEmployees, selectedProjectId] + [employees, showInactive, showAllEmployees, selectedProjectId] // Add all relevant dependencies ); useEffect(() => { @@ -247,7 +244,7 @@ useEffect(() => { )} {showModal && ( - setShowModal(false)} @@ -259,18 +256,24 @@ useEffect(() => { /> )} - {IsDeleteModalOpen && ( + + {IsDeleteModalOpen && ( - suspendEmployee({ - employeeId:id , - active: !selectedEmpFordelete.isActive, - }) - } + suspendEmployee({ + employeeId: id, + active: !selectedEmpFordelete.isActive, + }) + } onClose={() => setIsDeleteModalOpen(false)} loading={employeeLodaing} paramData={selectedEmpFordelete.id} @@ -496,9 +499,8 @@ useEffect(() => { Status { )} {/* Conditional messages for no data or no search results */} {!loading && - displayData?.length === 0 && - searchText && - !showAllEmployees ? ( + displayData?.length === 0 && + searchText && + !showAllEmployees ? ( @@ -530,14 +532,14 @@ useEffect(() => { ) : null} {!loading && - displayData?.length === 0 && - (!searchText || showAllEmployees) ? ( + displayData?.length === 0 && + (!searchText || showAllEmployees) ? ( - No team members assigned yet + No Data Found ) : null} @@ -556,9 +558,7 @@ useEffect(() => {
- navigate( - `/employee/${item.id}?for=attendance` - ) + navigate(`/employee/${item.id}`) } className="text-heading text-truncate cursor-pointer" > @@ -594,10 +594,9 @@ useEffect(() => { {item.jobRole || "Not Assign Yet"} + - {item.joiningDate - ? moment(item.joiningDate).format("DD-MMM-YYYY") - : "NA"} + {moment(item.joiningDate)?.format("DD-MMM-YYYY")} {showInactive ? ( @@ -626,47 +625,56 @@ useEffect(() => {
+ {/* View always visible */} - - {!item.isSystem && ( + + {/* If ACTIVE employee */} + {item.isActive && ( <> + + {/* Suspend only when active */} + {item.isActive && ( + + )} + + )} + + {/* If INACTIVE employee AND inactive toggle is ON */} + {!item.isActive && showInactive && ( + + )}
@@ -683,9 +691,8 @@ useEffect(() => {