Skip to content

Commit

Permalink
Merge pull request #145 from SSchulze1989/develop
Browse files Browse the repository at this point in the history
v 0.11.8
  • Loading branch information
SSchulze1989 authored Feb 29, 2024
2 parents 5039ce8 + dde90f8 commit b4b3018
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
<MudSelect @bind-Value="Value"
Label="@Label"
HelperText="@HelperText"
Placeholder="@Placeholder"
Variant="Variant"
AnchorOrigin="Origin.BottomCenter"
ToStringFunc="ToStringFunc">
ToStringFunc="ToStringFunc"
Clearable="Clearable">
@if (ItemTemplate is not null)
{
@foreach (var item in Items)
Expand Down Expand Up @@ -39,6 +41,8 @@
[Parameter] public IEnumerable<T> Items { get; set; } = Array.Empty<T>();
[Parameter] public Func<T, string> ToStringFunc { get; set; } = x => x?.ToString() ?? string.Empty;
[Parameter] public RenderFragment<T>? ItemTemplate { get; set; }
[Parameter] public bool Clearable { get; set; } = false;
[Parameter] public string Placeholder { get; set; } = string.Empty;

protected override void OnParametersSet()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
}
}
@{
var sourceHelperText = Config.SourceResultConfig != null ? $"Reuse results calculated in {Config.SourceResultConfig.ChampionshipName} - {Config.SourceResultConfig.Name}" : "Use uploaded result data";
var sourceHelperText = Config.SourceResultConfig != null ? $"Use points and final order calculated in {Config.SourceResultConfig.ChampionshipName} - {Config.SourceResultConfig.Name}" : "Use uploaded result data";
}
<SettingsSelectPrompt Label="Source"
HelperText="@sourceHelperText"
@bind-Value="Config.SourceResultConfig"
Items="Config.AvailableResultConfigs"
ToStringFunc="@(config => config != null ? $"{config.ChampionshipName} - {config.Name}" : "Raw Result")">
Placeholder="Raw Results"
ToStringFunc="@(config => config != null ? $"{config.ChampionshipName} - {config.Name}" : null)"
Clearable="true">
<ItemTemplate Context="sourceConfig">
@sourceConfig?.ChampionshipName - @sourceConfig?.Name
</ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
[Parameter] public Func<T, string> ToStringFunc { get; set; } = value => value?.ToString() ?? string.Empty;
[Parameter] public IEnumerable<T> Items { get; set; } = Array.Empty<T>();
[Parameter] public RenderFragment<T> ItemTemplate { get; set; } = default!;
[Parameter] public bool Clearable { get; set; } = false;
[Parameter] public string Placeholder { get; set; } = string.Empty;

private string ValueString => ToStringFunc(Value);
private string ValueString => ToStringFunc(Value) ?? Placeholder;

protected override void OnParametersSet()
{
Expand All @@ -41,6 +43,8 @@
{ x => x.Items, Items },
{ x => x.ItemTemplate, ItemTemplate },
{ x => x.ToStringFunc, ToStringFunc },
{ x => x.Clearable, Clearable },
{ x => x.Placeholder, Placeholder },
};

var options = new DialogOptions()
Expand Down
5 changes: 4 additions & 1 deletion src/iRLeagueManager.Web/ViewModels/ResultConfigViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ public async Task<StatusResult> LoadAvailableResultConfigs(CancellationToken can
var result = await request;
if (result.Success && result.Content is not null)
{
AvailableResultConfigs = new(result.Content.Select(GetConfigInfoModel).NotNull());
AvailableResultConfigs = new(result.Content
.Select(GetConfigInfoModel)
.NotNull()
.Where(x => x.ChampSeasonId != ChampSeasonId));
}

return result.ToStatusResult();
Expand Down
2 changes: 1 addition & 1 deletion src/iRLeagueManager.Web/iRLeagueManager.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Version>0.11.7</Version>
<Version>0.11.8</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-iRLeagueManager.Web-2B05F9DC-55A3-49D1-BD64-31507000EDF3</UserSecretsId>
Expand Down

0 comments on commit b4b3018

Please sign in to comment.