diff --git a/src/iRLeagueManager.Web/Components/Dialogs/SelectPromptDialog.razor b/src/iRLeagueManager.Web/Components/Dialogs/SelectPromptDialog.razor index 7c968bb..a9f58c1 100644 --- a/src/iRLeagueManager.Web/Components/Dialogs/SelectPromptDialog.razor +++ b/src/iRLeagueManager.Web/Components/Dialogs/SelectPromptDialog.razor @@ -7,9 +7,11 @@ + ToStringFunc="ToStringFunc" + Clearable="Clearable"> @if (ItemTemplate is not null) { @foreach (var item in Items) @@ -39,6 +41,8 @@ [Parameter] public IEnumerable Items { get; set; } = Array.Empty(); [Parameter] public Func ToStringFunc { get; set; } = x => x?.ToString() ?? string.Empty; [Parameter] public RenderFragment? ItemTemplate { get; set; } + [Parameter] public bool Clearable { get; set; } = false; + [Parameter] public string Placeholder { get; set; } = string.Empty; protected override void OnParametersSet() { diff --git a/src/iRLeagueManager.Web/Components/Settings/ResultConfigSettings.razor b/src/iRLeagueManager.Web/Components/Settings/ResultConfigSettings.razor index 38dc042..7f8d9a7 100644 --- a/src/iRLeagueManager.Web/Components/Settings/ResultConfigSettings.razor +++ b/src/iRLeagueManager.Web/Components/Settings/ResultConfigSettings.razor @@ -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"; } + Placeholder="Raw Results" + ToStringFunc="@(config => config != null ? $"{config.ChampionshipName} - {config.Name}" : null)" + Clearable="true"> @sourceConfig?.ChampionshipName - @sourceConfig?.Name diff --git a/src/iRLeagueManager.Web/Components/Settings/SettingsSelectPrompt.razor b/src/iRLeagueManager.Web/Components/Settings/SettingsSelectPrompt.razor index 2ed416f..e952419 100644 --- a/src/iRLeagueManager.Web/Components/Settings/SettingsSelectPrompt.razor +++ b/src/iRLeagueManager.Web/Components/Settings/SettingsSelectPrompt.razor @@ -23,8 +23,10 @@ [Parameter] public Func ToStringFunc { get; set; } = value => value?.ToString() ?? string.Empty; [Parameter] public IEnumerable Items { get; set; } = Array.Empty(); [Parameter] public RenderFragment 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() { @@ -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() diff --git a/src/iRLeagueManager.Web/ViewModels/ResultConfigViewModel.cs b/src/iRLeagueManager.Web/ViewModels/ResultConfigViewModel.cs index fca01f9..7a685c8 100644 --- a/src/iRLeagueManager.Web/ViewModels/ResultConfigViewModel.cs +++ b/src/iRLeagueManager.Web/ViewModels/ResultConfigViewModel.cs @@ -162,7 +162,10 @@ public async Task 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(); diff --git a/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj b/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj index cb8a646..468fb7e 100644 --- a/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj +++ b/src/iRLeagueManager.Web/iRLeagueManager.Web.csproj @@ -2,7 +2,7 @@ net7.0 - 0.11.7 + 0.11.8 enable enable aspnet-iRLeagueManager.Web-2B05F9DC-55A3-49D1-BD64-31507000EDF3