fix(dashboard): sidebar theming, calendar reactivity, and booking filters
Fix multiple dashboard and UI issues: Frontend fixes: - Fix sidebar remaining dark on light theme (add proper light/dark CSS variables) - Fix DashboardCalendar blank/not showing events (use watch + calendar API instead of computed options) - Fix upcoming bookings to include active and recent past (last 7 days) bookings - Improve sidebar collapsed state UX (stack footer buttons vertically, full width) Details: - theme.css: Add light sidebar colors (white bg) for :root, keep dark colors for [data-theme="dark"] - DashboardCalendar: Add watch on events, use calendarRef to update events via removeAllEvents/addEventSource - Dashboard: Change upcoming filter from "startDate >= now" to "endDate >= 7 days ago" - AppSidebar: Stack footer-actions vertically when collapsed for better visibility Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -181,13 +181,18 @@ const adminStats = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// Get upcoming bookings (approved or pending, sorted by start time)
|
||||
// Get upcoming bookings (active, future, and recent past - last 7 days)
|
||||
const upcomingBookings = computed(() => {
|
||||
const now = new Date()
|
||||
const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000)
|
||||
|
||||
return myBookings.value
|
||||
.filter((b) => {
|
||||
const startDate = new Date(ensureUTC(b.start_datetime))
|
||||
return startDate >= now && (b.status === 'approved' || b.status === 'pending')
|
||||
if (b.status !== 'approved' && b.status !== 'pending') return false
|
||||
|
||||
const endDate = new Date(ensureUTC(b.end_datetime))
|
||||
// Include if not ended yet OR ended within last 7 days
|
||||
return endDate >= sevenDaysAgo
|
||||
})
|
||||
.sort((a, b) => {
|
||||
return new Date(ensureUTC(a.start_datetime)).getTime() - new Date(ensureUTC(b.start_datetime)).getTime()
|
||||
|
||||
Reference in New Issue
Block a user