From fa694d83614cdd6dd6b17f3eabc859f1d77ff020 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Sat, 13 Dec 2025 11:37:53 +0530 Subject: [PATCH] Correction in Attendance page. --- src/pages/Activities/AttendancePage.jsx | 90 +++++++++++-------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/src/pages/Activities/AttendancePage.jsx b/src/pages/Activities/AttendancePage.jsx index 23e8b75a..0e3af802 100644 --- a/src/pages/Activities/AttendancePage.jsx +++ b/src/pages/Activities/AttendancePage.jsx @@ -136,6 +136,15 @@ const AttendancePage = () => { : []), ]; // --- END: Tab Configuration Array + useEffect(() => { + if (!orgLoading && organizations?.length === 1) { + setAppliedFilters((prev) => ({ + ...prev, + selectedOrganization: organizations[0].id, + })); + } + }, [orgLoading, organizations]); + return ( <> @@ -173,19 +182,21 @@ const AttendancePage = () => { {/* Tabs header with search and filter */}
- - {/* Tabs Buttons - Now col-12 col-md-6 */} -
+ {/* Tabs Buttons */} +
    {tabsData.map((tab) => (
- {/* Search + Organization Filter - Now col-12 col-md-6 */} -
-
- - {/* Organization */} + {/* Search + Organization filter */} +
+
- - {/* If only 1 organization → show name only */} - {!orgLoading && organizations?.length === 1 && ( -
{organizations[0].name}
- )} - - {/* If multiple organizations → show dropdown */} - {!orgLoading && organizations?.length > 1 && ( - - )} - - {/* Loading case (optional) */} - {orgLoading && ( -
- Loading... -
- )} - +
- - - {/* Search */}
{ onChange={(e) => setSearchTerm(e.target.value)} />
-
-
- {/* Tab Content */}
{selectedProject ? (