3.3 KiB
3.3 KiB
Calendar View Update Summary
Overview
Updated the Calendar.vue component from a weekly view to a daily view with foremen as columns and 30-minute time slots as rows.
Key Changes Made
1. Layout Structure
- Before: Weekly calendar with 7 day columns
- After: Daily calendar with 10 foreman columns
2. Header Changes
- Changed from "Sprinkler Service Calendar" to "Daily Schedule - Sprinkler Service"
- Navigation changed from week-based (previousWeek/nextWeek) to day-based (previousDay/nextDay)
- Display shows full day name instead of week range
3. Grid Structure
- Columns: Now shows foremen names instead of days of the week
- Rows: Still uses 30-minute time slots from 7 AM to 7 PM
- Grid template updated from
repeat(7, 1fr)torepeat(10, 1fr)for 10 foremen
4. Foremen Data
Added 10 foremen to the system:
- Mike Thompson
- Sarah Johnson
- David Martinez
- Chris Wilson
- Lisa Anderson
- Robert Thomas
- Maria White
- James Clark
- Patricia Lewis
- Kevin Walker
5. Event Scheduling Logic
- Events now filter by foreman name instead of day
- Drag and drop updated to assign services to specific foremen
- Time slot conflict detection now checks per foreman instead of per day
- Preview slots updated to show foreman-specific scheduling
6. Visual Updates
- Foreman headers show name and job count for the day
- CSS classes renamed from
day-columntoforeman-column - Updated styling to accommodate wider layout for 10 columns
- Maintained all existing drag-and-drop visual feedback
7. Functionality Preserved
- All existing drag-and-drop functionality
- Service priority handling
- Unscheduled services panel
- Event details modal
- Time slot highlighting for current time
Technical Implementation Details
Data Flow
currentDate(string) - tracks the currently viewed dateforemen(array) - contains foreman ID and name pairs- Services filter by
foremanname andscheduledDatematchingcurrentDate - Grid renders 10 columns × ~24 time slots (30-min intervals)
Key Methods Updated
getEventsForTimeSlot(foremanName, time, date)- filters by foreman and dateisTimeSlotOccupied(foremanName, startTime, duration)- checks conflicts per foremangetOccupiedSlots(foremanId, startTime, duration)- preview slots per foremanhandleDragOver/handleDrop- updated to work with foreman IDs- Navigation:
previousDay(),nextDay(),goToToday()
CSS Grid Layout
.calendar-header-row, .time-row {
grid-template-columns: 80px repeat(10, 1fr);
}
This provides a time column (80px) plus 10 equal-width foreman columns.
Benefits of New Design
- Better resource allocation - See all foremen's schedules at once
- Easier scheduling - Drag services directly to specific foremen
- Conflict prevention - Visual feedback for time conflicts per foreman
- Daily focus - Concentrate on optimizing a single day's schedule
- Scalable - Easy to add/remove foremen by updating the foremen array
Usage
- Use left/right arrows to navigate between days
- Drag unscheduled services from the right panel to specific foreman time slots
- Services automatically get assigned to the foreman and time slot where dropped
- Current time slot is highlighted across all foremen columns
- Each foreman header shows their job count for the selected day