From ef005162566cec89b42df8ffda34eb4ecacbbc39 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 10 Oct 2025 12:11:12 +0530 Subject: [PATCH] Changes in Dashboard weidget Attendance and Monthly weidget when no data show. --- .../Dashboard/AttendanceOverview.jsx | 8 +- src/components/Dashboard/Dashboard.jsx | 6 +- src/components/Dashboard/ExpenseAnalysis.jsx | 5 +- src/components/Dashboard/ExpenseByProject.jsx | 14 +- src/components/Documents/Documents.jsx | 2 +- src/components/Expenses/ExpenseList.jsx | 2 +- src/pages/employee/EmployeeList.jsx | 511 +++++++++--------- 7 files changed, 276 insertions(+), 272 deletions(-) diff --git a/src/components/Dashboard/AttendanceOverview.jsx b/src/components/Dashboard/AttendanceOverview.jsx index dba31a52..06b5220b 100644 --- a/src/components/Dashboard/AttendanceOverview.jsx +++ b/src/components/Dashboard/AttendanceOverview.jsx @@ -95,8 +95,12 @@ const AttendanceOverview = () => { {/* Content */} -
- {view === "chart" ? ( +
+ {!isLoading && (!attendanceData || attendanceData.length === 0) ? ( +
No data found
+ ) : view === "chart" ? (
diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index 9653b8cd..8f2e7a37 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -45,13 +45,13 @@ const Dashboard = () => {
-
+
{!isAllProjectsSelected && ( -
+
)} -
+
diff --git a/src/components/Dashboard/ExpenseAnalysis.jsx b/src/components/Dashboard/ExpenseAnalysis.jsx index 48daf6b8..283e64c8 100644 --- a/src/components/Dashboard/ExpenseAnalysis.jsx +++ b/src/components/Dashboard/ExpenseAnalysis.jsx @@ -65,9 +65,6 @@ const { labels, series, total } = useMemo(() => { }, }; - if (data?.report === 0) { - return
No data found
; - } return ( <> @@ -97,7 +94,7 @@ const { labels, series, total } = useMemo(() => { {/* Data display */} {!isLoading && report.length === 0 && ( -
No data found
+
No data found
)} {!isLoading && report.length > 0 && ( diff --git a/src/components/Dashboard/ExpenseByProject.jsx b/src/components/Dashboard/ExpenseByProject.jsx index 97cf6c7a..c0189306 100644 --- a/src/components/Dashboard/ExpenseByProject.jsx +++ b/src/components/Dashboard/ExpenseByProject.jsx @@ -117,11 +117,10 @@ const ExpenseByProject = () => { {["1M", "3M", "6M", "12M", "All"].map((item) => (
{/* Chart */} -
+
{isLoading ? (

Loading chart...

+ ) : !expenseApiData || expenseApiData.length === 0 ? ( +
No data found
) : ( - + )}
+
); }; diff --git a/src/components/Documents/Documents.jsx b/src/components/Documents/Documents.jsx index 47eadad5..38f8a5aa 100644 --- a/src/components/Documents/Documents.jsx +++ b/src/components/Documents/Documents.jsx @@ -147,7 +147,7 @@ const Documents = ({ Document_Entity, Entity }) => { return (
-
+
{/* Search */} diff --git a/src/components/Expenses/ExpenseList.jsx b/src/components/Expenses/ExpenseList.jsx index 7400ee0a..cacf14ee 100644 --- a/src/components/Expenses/ExpenseList.jsx +++ b/src/components/Expenses/ExpenseList.jsx @@ -270,7 +270,7 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
{" "} - + {displayField} :{" "} {" "} diff --git a/src/pages/employee/EmployeeList.jsx b/src/pages/employee/EmployeeList.jsx index 3a71fee4..a243d43a 100644 --- a/src/pages/employee/EmployeeList.jsx +++ b/src/pages/employee/EmployeeList.jsx @@ -360,7 +360,7 @@ const EmployeeList = () => {
{/* Right side: Search + Add Employee + Options */} -
+
{/* Add Employee Button */} {Manage_Employee && (
- - - - - - - - - - - - - - - - {loading && ( +
+
-
Name
-
-
Email
-
-
Contact
-
-
Designation
-
- Joining Date - - Status - - Actions -
+ - - - )} - {/* Conditional messages for no data or no search results */} - {!loading && - displayData?.length === 0 && - searchText ? ( - - - - ) : null} - {!loading && - displayData?.length === 0 && - (!searchText) ? ( - - - - ) : null} + + + + - {/* Render current items */} - {currentItems && - !loading && - currentItems.map((item) => ( - - + + + + + + {loading && ( + + + + )} + {/* Conditional messages for no data or no search results */} + {!loading && + displayData?.length === 0 && + searchText ? ( + + - - - + ) : null} + {!loading && + displayData?.length === 0 && + (!searchText) ? ( + + + + ) : null} - - - - {Manage_Employee && ( - + - )} - - ))} - -
-

Loading...

-
-
- - '{searchText}' employee not found - {" "} -
-
-
{showInactive ? "No In-active Employeee Found" : "No Employeee Found"}
-
+
Name
+
+
Email
+
+
Contact
+
+
Designation
+
- + Joining Date + + Status + + Actions +
+

Loading...

+
+
+ + '{searchText}' employee not found + {" "}
- {item.email ? ( - - - {item.email} - - ) : ( - - - )} - - - - {item.phoneNumber} - - - - - {item.jobRole || "Not Assign Yet"} - +
+
{showInactive ? "No In-active Employeee Found" : "No Employeee Found"}
- {item.joiningDate ? moment(item.joiningDate).format("DD-MMM-YYYY") : "NA"} - - {showInactive ? ( - - Inactive - - ) : ( - - Active - - )} - -
- -
- {/* View always visible */} -
+
+ + {item.email ? ( + + + {item.email} + + ) : ( + - + )} + + + + + {item.phoneNumber} + + + + + + {item.jobRole || "Not Assign Yet"} + + + + + {item.joiningDate ? moment(item.joiningDate).format("DD-MMM-YYYY") : "NA"} + + + + {showInactive ? ( + + Inactive + + ) : ( + + Active + + )} + + {Manage_Employee && ( + +
+ +
+ {/* View always visible */} + + + {/* If ACTIVE employee */} + {item.isActive && ( + <> + + + {/* Suspend only when active */} + {item.isActive && ( + + )} + + + + )} + + {/* If INACTIVE employee AND inactive toggle is ON */} + {!item.isActive && showInactive && ( + + )} +
+
+ + )} + + ))} + + +
+ + {displayData.length > 0 && (