Address compiler warnings
This commit is contained in:
@@ -27,9 +27,9 @@
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public EventDefinition EventDefinition { get; set; }
|
||||
public required EventDefinition EventDefinition { get; set; }
|
||||
|
||||
private string _attributes;
|
||||
private string _attributes = string.Empty;
|
||||
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
ShowBackButton="true"
|
||||
BackButtonUrl="/events" />
|
||||
|
||||
<EditForm id="create-event-form" Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<EditForm Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<FormChangeTracker @ref="_formChangeTracker" />
|
||||
<AntiforgeryToken />
|
||||
<DataAnnotationsValidator />
|
||||
@@ -45,13 +45,12 @@
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary">Create</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
</EditForm>
|
||||
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="create-event-form">Create</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromForm]
|
||||
private EventDefinition EventDefinition { get; set; } = new();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
ShowBackButton="true"
|
||||
BackButtonUrl="/events" />
|
||||
|
||||
<EditForm id="edit-event-form" Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<EditForm Model="EventDefinition" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<FormChangeTracker @ref="_formChangeTracker" />
|
||||
<AntiforgeryToken />
|
||||
<DataAnnotationsValidator />
|
||||
@@ -52,13 +52,12 @@
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary">Save</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
</EditForm>
|
||||
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="edit-event-form">Save</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromQuery]
|
||||
private int Id { get; set; }
|
||||
|
||||
@@ -25,15 +25,13 @@
|
||||
@context.Item.Name
|
||||
</MudLink>
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
||||
Size="Size.Small"
|
||||
Href="@($"/events/edit?id={context.Item.Id}")"
|
||||
Title="Edit" />
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Delete"
|
||||
Size="Size.Small"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteEventDefinition(context.Item!)"
|
||||
Title="Delete" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Filled.Edit"
|
||||
TooltipText="Edit"
|
||||
Href="@($"/events/edit?id={context.Item.Id}")" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Outlined.Delete"
|
||||
TooltipText="Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteEventDefinition(context.Item!)" />
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</CellTemplate>
|
||||
|
||||
@@ -102,11 +102,11 @@
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
private Team[]? _teams;
|
||||
private Student[]? _students;
|
||||
MudTable<TeamScheduleTimeSlot> _solutionData;
|
||||
private TeamSchedulerSolution _solution;
|
||||
private TeamSchedulerOptions _parameters;
|
||||
private Team[] _teams = null!;
|
||||
private Student[] _students = null!;
|
||||
MudTable<TeamScheduleTimeSlot> _solutionData = null!;
|
||||
private TeamSchedulerSolution _solution = null!;
|
||||
private TeamSchedulerOptions _parameters = null!;
|
||||
bool _isSolving;
|
||||
private IEnumerable<Team> _scheduledTeams = [];
|
||||
private IEnumerable<Student> _absentStudents = [];
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
ShowBackButton="true"
|
||||
BackButtonUrl="/students" />
|
||||
|
||||
<EditForm id="create-student-form" Model="Student" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<EditForm Model="Student" OnValidSubmit="OnValidSubmit" Enhance>
|
||||
<FormChangeTracker @ref="_formChangeTracker" />
|
||||
<AntiforgeryToken />
|
||||
<DataAnnotationsValidator />
|
||||
@@ -26,13 +26,12 @@
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
</MudGrid>
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary">Create</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
</EditForm>
|
||||
|
||||
<FormActions>
|
||||
<MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Form="create-student-form">Create</MudButton>
|
||||
<MudButton OnClick="HandleCancel" Variant="Variant.Text">Cancel</MudButton>
|
||||
</FormActions>
|
||||
|
||||
@code {
|
||||
[SupplyParameterFromForm]
|
||||
private Student Student { get; set; } = new() { TsaYear = 1 };
|
||||
|
||||
@@ -97,11 +97,11 @@ else
|
||||
private Student[]? _students;
|
||||
|
||||
private class EventStudentRankings {
|
||||
public EventDefinition Event {get; set; }
|
||||
public Tuple<Student,int> [] StudentRanking { get; set; }
|
||||
public required EventDefinition Event {get; set; }
|
||||
public required Tuple<Student,int>[] StudentRanking { get; set; }
|
||||
}
|
||||
|
||||
private EventStudentRankings[] _eventStudentRankings;
|
||||
private EventStudentRankings[] _eventStudentRankings = null!;
|
||||
private int _maxEventStudentRankings;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
||||
@@ -32,15 +32,13 @@
|
||||
}
|
||||
</MudStack>
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
||||
Size="Size.Small"
|
||||
Href="@($"/students/edit?id={context.Item.Id}&returnUrl=/students")"
|
||||
Title="Edit" />
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Delete"
|
||||
Size="Size.Small"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteStudent(context.Item!)"
|
||||
Title="Delete" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Filled.Edit"
|
||||
TooltipText="Edit"
|
||||
Href="@($"/students/edit?id={context.Item.Id}&returnUrl=/students")" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Outlined.Delete"
|
||||
TooltipText="Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteStudent(context.Item!)" />
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</CellTemplate>
|
||||
|
||||
@@ -309,19 +309,19 @@
|
||||
private readonly AssignmentParameters _parameters = new() { RequireOnSite = false, RequireRegional = false };
|
||||
private ValidationService _validationService = new ValidationService(ValidationConfiguration.Default);
|
||||
|
||||
private List<EventDefinition>? _events;
|
||||
private List<Student>? _students;
|
||||
private List<EventDefinition> _events = null!;
|
||||
private List<Student> _students = null!;
|
||||
private List<EventAssignmentThresholds> _eventAssignmentThresholds = [];
|
||||
|
||||
MudTable<Team> _teamData;
|
||||
MudTable<Team> _teamData = null!;
|
||||
private Team[] _teams = [];
|
||||
MudTable<StudentEventStatistics> _statisticData;
|
||||
MudTable<StudentEventStatistics> _statisticData = null!;
|
||||
private List<StudentEventStatistics> _statistics = [];
|
||||
MudTable<AssignmentRequirement> _assignmentRequirementData;
|
||||
MudTable<AssignmentRequirement> _assignmentRequirementData = null!;
|
||||
private List<AssignmentRequirement> _assignmentRequirements = [];
|
||||
MudTable<EventDefinition> _eventTwoTeamData;
|
||||
MudTable<EventDefinition> _eventTwoTeamData = null!;
|
||||
private List<EventDefinition> _eventTwoTeams = [];
|
||||
MudTable<EventDefinition> _eventOmittedData;
|
||||
MudTable<EventDefinition> _eventOmittedData = null!;
|
||||
private List<EventDefinition> _eventOmitted = [];
|
||||
|
||||
private string _solutionStatus = string.Empty;
|
||||
@@ -387,9 +387,9 @@
|
||||
return new TableData<Team> { Items = _teams };
|
||||
}
|
||||
|
||||
private async Task<TableData<StudentEventStatistics>> ReloadStatistics(TableState arg1, CancellationToken arg2)
|
||||
private Task<TableData<StudentEventStatistics>> ReloadStatistics(TableState arg1, CancellationToken arg2)
|
||||
{
|
||||
return new TableData<StudentEventStatistics> {Items = _statistics};
|
||||
return Task.FromResult(new TableData<StudentEventStatistics> {Items = _statistics});
|
||||
}
|
||||
|
||||
private void UpdateValidationConfig()
|
||||
@@ -403,20 +403,20 @@
|
||||
return _validationService.ValidateStudentStatistics(stats, ValidationContext.StudentAssignment);
|
||||
}
|
||||
|
||||
private async Task<TableData<AssignmentRequirement>> ReloadAssignmentRequirements(TableState arg1, CancellationToken arg2)
|
||||
private Task<TableData<AssignmentRequirement>> ReloadAssignmentRequirements(TableState arg1, CancellationToken arg2)
|
||||
{
|
||||
return new TableData<AssignmentRequirement> { Items = _assignmentRequirements };
|
||||
return Task.FromResult(new TableData<AssignmentRequirement> { Items = _assignmentRequirements });
|
||||
}
|
||||
|
||||
private async Task<TableData<EventDefinition>> ReloadEventTwoTeam(TableState arg1, CancellationToken arg2)
|
||||
private Task<TableData<EventDefinition>> ReloadEventTwoTeam(TableState arg1, CancellationToken arg2)
|
||||
{
|
||||
return new TableData<EventDefinition> { Items = _eventTwoTeams };
|
||||
return Task.FromResult(new TableData<EventDefinition> { Items = _eventTwoTeams });
|
||||
}
|
||||
|
||||
|
||||
private async Task<TableData<EventDefinition>> ReloadOmittedEvents(TableState arg1, CancellationToken arg2)
|
||||
private Task<TableData<EventDefinition>> ReloadOmittedEvents(TableState arg1, CancellationToken arg2)
|
||||
{
|
||||
return new TableData<EventDefinition> { Items = _eventOmitted };
|
||||
return Task.FromResult(new TableData<EventDefinition> { Items = _eventOmitted });
|
||||
}
|
||||
|
||||
private void RequireEvent(EventDefinition evt, Student student, Requirement requirement)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</MudSelect>
|
||||
|
||||
@code {
|
||||
[Parameter] public Team[]? Teams { get; set; }
|
||||
[Parameter] public Team[] Teams { get; set; } = null!;
|
||||
[Parameter] public required IEnumerable<Team> SelectedTeams { get; set; }
|
||||
[Parameter] public string Label { get; set; } = "Teams";
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Team Team { get; set; }
|
||||
public required Team Team { get; set; }
|
||||
}
|
||||
|
||||
@@ -25,15 +25,13 @@
|
||||
@context.Item.ToString()
|
||||
</MudLink>
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Edit"
|
||||
Size="Size.Small"
|
||||
Href="@($"/teams/edit?id={context.Item.Id}")"
|
||||
Title="Edit" />
|
||||
<MudIconButton Icon="@Icons.Material.Outlined.Delete"
|
||||
Size="Size.Small"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteTeam(context.Item!)"
|
||||
Title="Delete" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Filled.Edit"
|
||||
TooltipText="Edit"
|
||||
Href="@($"/teams/edit?id={context.Item.Id}")" />
|
||||
<IconButtonWithTooltip Icon="@Icons.Material.Outlined.Delete"
|
||||
TooltipText="Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="() => DeleteTeam(context.Item!)" />
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</CellTemplate>
|
||||
|
||||
@@ -205,7 +205,7 @@ else
|
||||
private Team[]? _teams;
|
||||
private int _maxTeamSize;
|
||||
private Student[]? _students;
|
||||
private bool _rankColorEnabled;
|
||||
private bool _rankColorEnabled = false;
|
||||
|
||||
private string EventRankClass(int rank)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
@namespace WebApp.Components.Shared.Components
|
||||
|
||||
<MudTooltip Text="@TooltipText">
|
||||
<MudIconButton Icon="@Icon"
|
||||
Size="@Size"
|
||||
Color="@Color"
|
||||
Href="@Href"
|
||||
OnClick="@OnClick" />
|
||||
</MudTooltip>
|
||||
|
||||
@code {
|
||||
[Parameter] public required string Icon { get; set; }
|
||||
[Parameter] public required string TooltipText { get; set; }
|
||||
[Parameter] public Size Size { get; set; } = Size.Small;
|
||||
[Parameter] public Color Color { get; set; } = Color.Default;
|
||||
[Parameter] public string? Href { get; set; }
|
||||
[Parameter] public EventCallback<MouseEventArgs> OnClick { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user