From 95f65141e1e67f94711f904d605aa94deea287c9 Mon Sep 17 00:00:00 2001 From: Nikolay Tatarinov Date: Tue, 3 Mar 2026 16:21:27 +0300 Subject: [PATCH] fix: update loading state handling in CalendarPage and DutyList components - Set isLoading to false in CalendarPage to prevent unnecessary loading indicators. - Removed the loading spinner from CalendarHeader and adjusted rendering logic in DutyList to show a placeholder when data is not yet loaded for the month. - Enhanced tests in DutyList to verify behavior when data is empty and when data is loading, ensuring accurate user feedback during data fetching. --- webapp-next/src/components/CalendarPage.tsx | 2 +- .../components/calendar/CalendarHeader.tsx | 22 +----------- .../src/components/duty/DutyList.test.tsx | 13 ++++++- webapp-next/src/components/duty/DutyList.tsx | 35 +++++++++++++------ 4 files changed, 38 insertions(+), 34 deletions(-) diff --git a/webapp-next/src/components/CalendarPage.tsx b/webapp-next/src/components/CalendarPage.tsx index 542c992..162a267 100644 --- a/webapp-next/src/components/CalendarPage.tsx +++ b/webapp-next/src/components/CalendarPage.tsx @@ -145,7 +145,7 @@ export function CalendarPage({ isAllowed, initDataRaw }: CalendarPageProps) { > ( - -); - function isCurrentMonth(month: Date): boolean { const now = new Date(); return ( @@ -82,16 +75,6 @@ export function CalendarHeader({ aria-atomic="true" > {monthName(monthIndex)} {year} - {isLoading && ( - - - - )} {showToday && ( )}