Prospectgrid draft

This commit is contained in:
Andre Beging
2025-03-28 17:48:08 +01:00
parent e8e438b62a
commit 97deed7d90
7 changed files with 42 additions and 15 deletions

View File

@@ -23,7 +23,7 @@
@if ((Prospect is not { Complete: true } || interaction.Type == InteractionType.Complete) && AllowInteraction)
{
<span>&nbsp;<a href=""><i class="fa-solid fa-square-xmark" @onclick="async () => await RemoveClick.InvokeAsync(interaction.Id)" @onclick:preventDefault></i></a></span>
<span>&nbsp;<a href=""><i class="fa-solid fa-square-xmark" @onclick="async () => { if (RemoveClick != null) await RemoveClick.Invoke(interaction.Id); }" @onclick:preventDefault></i></a></span>
}
</div>

View File

@@ -62,7 +62,7 @@ namespace FoodsharingSiegen.Server.Controls
/// Gets or sets the value of the remove click (ab)
/// </summary>
[Parameter]
public EventCallback<Guid> RemoveClick { get; set; }
public Func<Guid, Task>? RemoveClick { get; set; }
/// <summary>
/// Gets or sets the value of the type (ab)

View File

@@ -75,7 +75,7 @@
<InteractionRow
Prospect="Prospect"
Type="InteractionType.ReleasedForVerification"
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
AllowInteraction="@(StateFilter is ProspectStateFilter.OnBoarding or ProspectStateFilter.Verification && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
AddClick="() => AddInteraction(InteractionType.ReleasedForVerification)"
RemoveClick="@RemoveInteraction"
Caption="Freigabe zur Verifizierung"

View File

@@ -12,7 +12,7 @@ namespace FoodsharingSiegen.Server.Controls
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
[Parameter] public EventCallback<Guid> RemoveInteraction { get; set; }
[Parameter] public Func<Guid, Task>? RemoveInteraction { get; set; }
[Parameter] public ProspectStateFilter StateFilter { get; set; }

View File

@@ -0,0 +1,30 @@
<h3>ProspectGrid</h3>
@code {
[Parameter] public List<Prospect>? Prospects { get; set; }
[Parameter] public Func<Guid, Task>? OnRemoveInteraction { get; set; }
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
[Parameter] public ProspectStateFilter StateFilter { get; set; }
}
<h5>@(Prospects?.Count ?? 0) Einträge</h5>
@if (Prospects?.Any() == true)
{
<div class="row m-0">
<Repeater Items="@Prospects">
<ProspectContainer
Prospect="context"
InteractionModal="@InteractionModal"
ProspectModal="@ProspectModal"
RemoveInteraction="OnRemoveInteraction"
StateFilter="StateFilter"></ProspectContainer>
</Repeater>
</div>
}