Remove resource calendar mode support

Simplifies calendar configuration and removes resource-specific code paths

Eliminates complexity around resource-based calendar rendering by:
- Removing ResourceCalendarData type
- Removing resource-specific renderers and managers
- Streamlining event and grid management logic
- Consolidating to single date-based calendar implementation
This commit is contained in:
Janus C. H. Knudsen 2025-11-01 01:10:10 +01:00
parent 349e1e8293
commit cda201301c
16 changed files with 65 additions and 323 deletions

View file

@ -2,7 +2,6 @@ import { eventBus } from '../core/EventBus';
import { CalendarConfig } from '../core/CalendarConfig';
import { CoreEvents } from '../constants/CoreEvents';
import { HeaderRenderer, HeaderRenderContext } from '../renderers/HeaderRenderer';
import { ResourceCalendarData } from '../types/CalendarTypes';
import { DragMouseEnterHeaderEventPayload, DragMouseLeaveHeaderEventPayload, HeaderReadyEventPayload } from '../types/EventTypes';
import { ColumnDetectionUtils } from '../utils/ColumnDetectionUtils';
@ -30,8 +29,8 @@ export class HeaderManager {
/**
* Initialize header with initial date
*/
public initializeHeader(currentDate: Date, resourceData: ResourceCalendarData | null = null): void {
this.updateHeader(currentDate, resourceData);
public initializeHeader(currentDate: Date): void {
this.updateHeader(currentDate);
}
/**
@ -89,20 +88,20 @@ export class HeaderManager {
*/
private setupNavigationListener(): void {
eventBus.on(CoreEvents.NAVIGATION_COMPLETED, (event) => {
const { currentDate, resourceData } = (event as CustomEvent).detail;
this.updateHeader(currentDate, resourceData);
const { currentDate } = (event as CustomEvent).detail;
this.updateHeader(currentDate);
});
// Also listen for date changes (including initial setup)
eventBus.on(CoreEvents.DATE_CHANGED, (event) => {
const { currentDate } = (event as CustomEvent).detail;
this.updateHeader(currentDate, null);
this.updateHeader(currentDate);
});
// Listen for workweek header updates after grid rebuild
eventBus.on('workweek:header-update', (event) => {
const { currentDate } = (event as CustomEvent).detail;
this.updateHeader(currentDate, null);
this.updateHeader(currentDate);
});
}
@ -110,10 +109,9 @@ export class HeaderManager {
/**
* Update header content for navigation
*/
private updateHeader(currentDate: Date, resourceData: ResourceCalendarData | null = null): void {
private updateHeader(currentDate: Date): void {
console.log('🎯 HeaderManager.updateHeader called', {
currentDate,
hasResourceData: !!resourceData,
rendererType: this.headerRenderer.constructor.name
});
@ -129,8 +127,7 @@ export class HeaderManager {
// Render new header content using injected renderer
const context: HeaderRenderContext = {
currentWeek: currentDate,
config: this.config,
resourceData: resourceData
config: this.config
};
console.log('🎨 HeaderManager: Calling renderer.render()', context);