Files
poprhythm 6acbc4e852 Enhance authentication flow by adding return URL support
This commit updates the authentication process to include a return URL parameter, allowing users to be redirected back to their original page after logging in. Changes were made to the AuthController, Login component, and Routes component to handle the return URL appropriately. Additionally, improvements were made to the TeamScheduler and TeamSchedulerSolution classes for better team and student management. These enhancements improve user experience and navigation within the application.
2026-01-11 13:13:24 -05:00

50 lines
1.6 KiB
C#

using Core.Entities;
using Heron.MudCalendar;
namespace WebApp.Models;
/// <summary>
/// Calendar event item model for Heron.MudCalendar component.
/// Maps from EventOccurrence entity to calendar event format.
/// </summary>
public class CalendarEventItem : CalendarItem
{
/// <summary>
/// Gets the original EventOccurrence data.
/// </summary>
public EventOccurrence? EventOccurrenceData { get; set; }
/// <summary>
/// Gets the associated EventDefinition if available.
/// </summary>
public EventDefinition? EventDefinition { get; set; }
/// <summary>
/// Gets the list of student first names from teams matching the EventDefinition.
/// </summary>
public List<string> StudentFirstNames { get; set; } = [];
/// <summary>
/// Parameterless constructor required by Heron.MudCalendar component.
/// </summary>
public CalendarEventItem()
{
// Initialize base class properties to avoid null reference issues
Text = string.Empty;
Start = DateTime.MinValue;
End = DateTime.MinValue;
}
public CalendarEventItem(EventOccurrence occurrence, IEnumerable<string>? studentFirstNames = null)
{
EventOccurrenceData = occurrence;
EventDefinition = occurrence.EventDefinition;
// Set base class properties that the calendar component uses
StudentFirstNames = studentFirstNames?.ToList() ?? [];
Text = occurrence.EventDefinition?.ShortName ?? string.Empty;
Start = occurrence.StartTime;
End = occurrence.EndTime ?? occurrence.StartTime.AddHours(1);
}
}