Skip to content

Commit

Permalink
fix: SA errors
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Jan 12, 2025
1 parent ddb4ee3 commit f034a70
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<div class="mb-3">
<label for="proficiency">Proficiency</label>
<select class="form-select" id="proficiency" @bind="model.Proficiency">
@foreach (var level in ProficiencyLevel.All)
@foreach (var level in ProficiencyLevel.All.Select(l => l.Key))
{
<option value="@level.Key">@level.Key</option>
<option value="@level">@level</option>
}
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@
}
}

private void SetContentFromFile(string content) => model.Content = content;

private async Task PreventNavigationWhenDirty(LocationChangingContext context)
{
if (!model.IsDirty)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="row mb-3">
@using System.Globalization
<div class="row mb-3">
<div class="col-sm-6 col-md-4 col-sm-6">
<label for="startDate">Since</label>
<input type="date" class="form-control" id="startDate" @onchange="StartDateChanged"/>
Expand All @@ -12,19 +13,19 @@
[Parameter]
public EventCallback<Filter> FilterChanged { get; set; }

private Filter filter = new();
private readonly Filter filter = new();

private async Task ApplyFilters() => await FilterChanged.InvokeAsync(filter);

private async Task StartDateChanged(ChangeEventArgs args)
{
filter.StartDate = args.Value is string { Length: >0 } dateTime ? DateOnly.Parse(dateTime) : null;
filter.StartDate = args.Value is string { Length: >0 } dateTime ? DateOnly.Parse(dateTime, CultureInfo.CurrentCulture) : null;
await ApplyFilters();
}

private async Task EndDateChanged(ChangeEventArgs args)
{
filter.EndDate = args.Value is string { Length: >0 } dateTime ? DateOnly.Parse(dateTime) : null;
filter.EndDate = args.Value is string { Length: >0 } dateTime ? DateOnly.Parse(dateTime, CultureInfo.CurrentCulture) : null;
await ApplyFilters();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
[Parameter, EditorRequired]
public required Social Social { get; set; }

private record SocialAccount(string Id, bool HasAccount, string? Url, string Name, string Icon);
private sealed record SocialAccount(string Id, bool HasAccount, string? Url, string Name, string Icon);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
await base.OnParametersSetAsync();
}

private class NewsArticle
private sealed class NewsArticle
{
[JsonPropertyName("@context")]
public required string Context { get; set; }
Expand Down

0 comments on commit f034a70

Please sign in to comment.