Integrate TeamMeetingHistoryService into Calendar component for enhanced meeting management

This commit updates the Calendar component to include the ITeamMeetingHistoryService, allowing for the loading and display of meeting histories alongside event occurrences. The calendar items are now wrapped in CalendarItemWrapper to accommodate both events and meetings. Additionally, error handling and logging are implemented to ensure robustness during the loading process. This enhancement improves the overall functionality and user experience of the calendar feature by providing a comprehensive view of both events and meetings.
This commit is contained in:
2026-01-25 19:07:43 -05:00
parent a503655f97
commit cc6e0d71a7
3 changed files with 182 additions and 14 deletions
+71
View File
@@ -0,0 +1,71 @@
using Heron.MudCalendar;
namespace WebApp.Models;
/// <summary>
/// Type discriminator for calendar item types.
/// </summary>
public enum CalendarItemType
{
Event,
Meeting
}
/// <summary>
/// Wrapper class for calendar items that can hold either a CalendarEventItem or CalendarMeetingItem.
/// This allows MudCalendar to display mixed item types while maintaining type safety.
/// </summary>
public class CalendarItemWrapper : CalendarItem
{
/// <summary>
/// Gets the type of calendar item this wrapper contains.
/// </summary>
public CalendarItemType ItemType { get; private set; }
/// <summary>
/// Gets the wrapped CalendarEventItem if ItemType is Event, otherwise null.
/// </summary>
public CalendarEventItem? EventItem { get; private set; }
/// <summary>
/// Gets the wrapped CalendarMeetingItem if ItemType is Meeting, otherwise null.
/// </summary>
public CalendarMeetingItem? MeetingItem { get; private set; }
/// <summary>
/// Parameterless constructor required by Heron.MudCalendar component.
/// </summary>
public CalendarItemWrapper()
{
// Initialize base class properties to avoid null reference issues
Text = string.Empty;
Start = DateTime.MinValue;
End = DateTime.MinValue;
}
/// <summary>
/// Creates a wrapper for a CalendarEventItem.
/// </summary>
public CalendarItemWrapper(CalendarEventItem eventItem)
{
ItemType = CalendarItemType.Event;
EventItem = eventItem;
// Delegate properties to wrapped item
Text = eventItem.Text;
Start = eventItem.Start;
End = eventItem.End;
}
/// <summary>
/// Creates a wrapper for a CalendarMeetingItem.
/// </summary>
public CalendarItemWrapper(CalendarMeetingItem meetingItem)
{
ItemType = CalendarItemType.Meeting;
MeetingItem = meetingItem;
// Delegate properties to wrapped item
Text = meetingItem.Text;
Start = meetingItem.Start;
End = meetingItem.End;
}
}
+38
View File
@@ -0,0 +1,38 @@
using Core.Entities;
using Heron.MudCalendar;
namespace WebApp.Models;
/// <summary>
/// Calendar meeting item model for Heron.MudCalendar component.
/// Maps from TeamMeetingHistory entity to calendar event format.
/// </summary>
public class CalendarMeetingItem : CalendarItem
{
/// <summary>
/// Gets the original TeamMeetingHistory data.
/// </summary>
public TeamMeetingHistory? MeetingHistoryData { get; set; }
/// <summary>
/// Parameterless constructor required by Heron.MudCalendar component.
/// </summary>
public CalendarMeetingItem()
{
// Initialize base class properties to avoid null reference issues
Text = string.Empty;
Start = DateTime.MinValue;
End = DateTime.MinValue;
}
public CalendarMeetingItem(TeamMeetingHistory meetingHistory)
{
MeetingHistoryData = meetingHistory;
// Set base class properties that the calendar component uses
Text = "Team Meeting";
// Use meeting date at 3:00 PM as default time
Start = meetingHistory.MeetingDate.Date.AddHours(15);
// Default to 1 hour duration
End = Start.AddHours(1);
}
}