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:
parent
349e1e8293
commit
cda201301c
16 changed files with 65 additions and 323 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// Calendar configuration management
|
||||
// Pure static configuration class - no dependencies, no events
|
||||
|
||||
import { ICalendarConfig, ViewPeriod, CalendarMode } from '../types/CalendarTypes';
|
||||
import { ICalendarConfig, ViewPeriod } from '../types/CalendarTypes';
|
||||
import { TimeFormatter, TimeFormatSettings } from '../utils/TimeFormatter';
|
||||
|
||||
/**
|
||||
|
|
@ -61,18 +61,6 @@ interface WorkWeekSettings {
|
|||
firstWorkDay: number; // ISO: 1 = Monday, 7 = Sunday
|
||||
}
|
||||
|
||||
/**
|
||||
* View settings for resource-based calendar mode
|
||||
*/
|
||||
interface ResourceViewSettings {
|
||||
maxResources: number; // Maximum resources to display
|
||||
showAvatars: boolean; // Display user avatars
|
||||
avatarSize: number; // Avatar size in pixels
|
||||
resourceNameFormat: 'full' | 'short'; // How to display names
|
||||
showResourceDetails: boolean; // Show additional resource info
|
||||
showAllDay: boolean; // Show all-day event row
|
||||
}
|
||||
|
||||
/**
|
||||
* Time format configuration settings
|
||||
*/
|
||||
|
|
@ -116,7 +104,6 @@ export class CalendarConfig {
|
|||
maxEventDuration: 480 // 8 hours
|
||||
};
|
||||
|
||||
private static calendarMode: CalendarMode = 'date';
|
||||
private static selectedDate: Date | null = new Date();
|
||||
private static currentWorkWeek: string = 'standard';
|
||||
|
||||
|
|
@ -143,16 +130,6 @@ export class CalendarConfig {
|
|||
showAllDay: true
|
||||
};
|
||||
|
||||
// Resource view settings
|
||||
private static resourceViewSettings: ResourceViewSettings = {
|
||||
maxResources: 10,
|
||||
showAvatars: true,
|
||||
avatarSize: 32,
|
||||
resourceNameFormat: 'full',
|
||||
showResourceDetails: true,
|
||||
showAllDay: true
|
||||
};
|
||||
|
||||
// Time format settings - default to Denmark with technical format
|
||||
private static timeFormatConfig: TimeFormatConfig = {
|
||||
timezone: 'Europe/Copenhagen',
|
||||
|
|
@ -293,28 +270,6 @@ export class CalendarConfig {
|
|||
return { ...CalendarConfig.dateViewSettings };
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resource view settings
|
||||
*/
|
||||
static getResourceViewSettings(): ResourceViewSettings {
|
||||
return { ...CalendarConfig.resourceViewSettings };
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get calendar mode
|
||||
*/
|
||||
static getCalendarMode(): CalendarMode {
|
||||
return CalendarConfig.calendarMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set calendar mode
|
||||
*/
|
||||
static setCalendarMode(mode: CalendarMode): void {
|
||||
CalendarConfig.calendarMode = mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get selected date
|
||||
*/
|
||||
|
|
@ -440,7 +395,6 @@ export class CalendarConfig {
|
|||
const data = JSON.parse(json);
|
||||
if (data.gridSettings) CalendarConfig.updateGridSettings(data.gridSettings);
|
||||
if (data.dateViewSettings) CalendarConfig.dateViewSettings = { ...CalendarConfig.dateViewSettings, ...data.dateViewSettings };
|
||||
if (data.resourceViewSettings) CalendarConfig.resourceViewSettings = { ...CalendarConfig.resourceViewSettings, ...data.resourceViewSettings };
|
||||
if (data.timeFormatConfig) {
|
||||
CalendarConfig.timeFormatConfig = { ...CalendarConfig.timeFormatConfig, ...data.timeFormatConfig };
|
||||
TimeFormatter.configure(CalendarConfig.timeFormatConfig);
|
||||
|
|
@ -469,9 +423,6 @@ export class CalendarConfig {
|
|||
getGridSettings() { return CalendarConfig.getGridSettings(); }
|
||||
updateGridSettings(updates: Partial<GridSettings>) { return CalendarConfig.updateGridSettings(updates); }
|
||||
getDateViewSettings() { return CalendarConfig.getDateViewSettings(); }
|
||||
getResourceViewSettings() { return CalendarConfig.getResourceViewSettings(); }
|
||||
getCalendarMode() { return CalendarConfig.getCalendarMode(); }
|
||||
setCalendarMode(mode: CalendarMode) { return CalendarConfig.setCalendarMode(mode); }
|
||||
getSelectedDate() { return CalendarConfig.getSelectedDate(); }
|
||||
setSelectedDate(date: Date) { return CalendarConfig.setSelectedDate(date); }
|
||||
getWorkWeekSettings() { return CalendarConfig.getWorkWeekSettings(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue