Compare commits

..
2 Commits
Author SHA1 Message Date
poprhythm 37e82646b8 Enhance calendar import functionality with null safety checks
This commit updates the Import.razor component to include a cast to non-nullable strings after filtering locations, ensuring that only valid strings are processed. Additionally, the Index.razor component is modified to handle null event definitions gracefully by providing an empty list of student first names when the event definition is null. These changes improve the robustness and reliability of the calendar import feature.
2026-01-10 19:08:11 -05:00
poprhythm e77f34ff9f Refactor career mapping display to enhance layout and styling
This commit updates the CareerMapping.razor component by wrapping the career display in a new div with a class for improved styling. The MudStack component's WrapItems property has been changed to Wrap, enhancing the layout of related careers. These changes aim to improve the visual presentation and maintainability of the career mapping feature.
2026-01-10 19:04:54 -05:00
3 changed files with 12 additions and 7 deletions
@@ -155,6 +155,7 @@
.SelectMany(list => list) .SelectMany(list => list)
.Select(eo => eo.Location) .Select(eo => eo.Location)
.Where(loc => !string.IsNullOrWhiteSpace(loc)) .Where(loc => !string.IsNullOrWhiteSpace(loc))
.Cast<string>() // Cast to non-nullable string after null check
.Distinct() .Distinct()
.OrderBy(loc => loc) .OrderBy(loc => loc)
.ToList(); .ToList();
@@ -110,7 +110,9 @@
} }
// Get student first names for this event definition // Get student first names for this event definition
var studentFirstNames = StudentFirstNames(occ.EventDefinition, teamsByEventId); var studentFirstNames = occ.EventDefinition != null
? StudentFirstNames(occ.EventDefinition, teamsByEventId)
: new List<string>();
var calendarItem = new CalendarEventItem(occ, studentFirstNames); var calendarItem = new CalendarEventItem(occ, studentFirstNames);
items.Add(calendarItem); items.Add(calendarItem);
@@ -49,12 +49,14 @@ else
@if (_selectedNodeInfo.Careers != null && _selectedNodeInfo.Careers.Any()) @if (_selectedNodeInfo.Careers != null && _selectedNodeInfo.Careers.Any())
{ {
<MudText Typo="Typo.subtitle2" Class="mb-2">Related Careers:</MudText> <MudText Typo="Typo.subtitle2" Class="mb-2">Related Careers:</MudText>
<MudStack Row="true" Spacing="1" WrapItems="true"> <div class="career-mapping">
@foreach (var career in _selectedNodeInfo.Careers.OrderBy(c => c)) <MudStack Row="true" Spacing="1" Wrap="Wrap.Wrap">
{ @foreach (var career in _selectedNodeInfo.Careers.OrderBy(c => c))
<MudChip T="string" Size="Size.Small" Variant="Variant.Filled" Color="Color.Default">@career</MudChip> {
} <MudChip T="string" Size="Size.Small" Variant="Variant.Filled" Color="Color.Default">@career</MudChip>
</MudStack> }
</MudStack>
</div>
} }
</MudPaper> </MudPaper>
} }