Skip to content

Commit

Permalink
Merge pull request #110 from SSchulze1989/develop
Browse files Browse the repository at this point in the history
v 0.8.3
  • Loading branch information
SSchulze1989 authored Aug 25, 2023
2 parents c08c8ff + 32f8ad3 commit ed49e51
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
@code {
[Parameter, EditorRequired]
public IEnumerable<MemberModel> LeagueMembers { get; set; } = default!;
[Parameter, EditorRequired]
public IEnumerable<TeamModel> Teams { get; set; } = default!;

private string Text { get; set; } = string.Empty;

Expand All @@ -69,6 +71,7 @@
base.OnParametersSet();
BlazorParameterNullException.ThrowIfNull(this, ModalService);
BlazorParameterNullException.ThrowIfNull(this, LeagueMembers);
BlazorParameterNullException.ThrowIfNull(this, Teams);
}

private static ResultFilterModel MapToResultFilterModel(FilterConditionModel condition) => new ResultFilterModel()
Expand Down Expand Up @@ -96,6 +99,7 @@
var parameters = new ModalParameters<EditResultFilterModal>()
.Add(x => x.Model, conditions)
.Add(x => x.LeagueMembers, LeagueMembers)
.Add(x => x.Teams, Teams)
.Add(x => x.AllowForEach, true)
.Add(x => x.Actions, new[] { MatchedValueAction.Keep });
var result = await ModalService.Show<EditResultFilterModal>("Penalty Conditions", parameters).Result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@inject IJSRuntime JsRuntime

<CascadingValue Value="@Bind(Vm, x => x.LeagueMembers).AsEnumerable()">
<CascadingValue Value="@Bind(Vm, x => x.Teams).AsEnumerable()">
<EditForm Model=Vm OnValidSubmit=Submit>
<StatusResultValidator @ref=ResultValidator />
<div class="accordion mb-3" id="resultConfigSections">
Expand Down Expand Up @@ -139,6 +140,7 @@
<CancelSubmitButtons ModelState=Vm SubmitText="Save" OnCancel=Cancel/>
</EditForm>
</CascadingValue>
</CascadingValue>

@code {
protected override async Task OnAfterRenderAsync(bool firstRender)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
public IModalService ModalService { get; set; } = default!;
[CascadingParameter]
public IEnumerable<MemberModel> LeagueMembers { get; set; } = default!;
[CascadingParameter]
public IEnumerable<TeamModel> Teams { get; set; } = default!;

[Parameter]
public ScoringViewModel Scoring { get; set; } = default!;
Expand Down Expand Up @@ -141,7 +143,8 @@
var autoPenalties = Scoring.PointRule.CopyModel().AutoPenalties;
var parameters = new ModalParameters<EditAutoPenaltiesModal>()
.Add(x => x.Model, autoPenalties)
.Add(x => x.LeagueMembers, LeagueMembers);
.Add(x => x.LeagueMembers, LeagueMembers)
.Add(x => x.Teams, Teams);
var result = await ModalService.Show<EditAutoPenaltiesModal>("Automatic Penalties", parameters).Result;
if (result.Confirmed && result.Data is IEnumerable<AutoPenaltyConfiguration> model)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ else
ChampSeason.DefaultResultConfig = null;
}

private ResultConfigModel CreateResultConfig()
private ResultConfigModel CreateResultConfig() => new ResultConfigModel()
{
return new ResultConfigModel();
}
ChampSeasonId = ChampSeason.ChampSeasonId,
};
}
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.8.2</Version>
<Version>0.8.3</Version>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-iRLeagueManager.Web-2B05F9DC-55A3-49D1-BD64-31507000EDF3</UserSecretsId>
Expand Down

0 comments on commit ed49e51

Please sign in to comment.