Prospectgrid draft
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
@if ((Prospect is not { Complete: true } || interaction.Type == InteractionType.Complete) && AllowInteraction)
|
@if ((Prospect is not { Complete: true } || interaction.Type == InteractionType.Complete) && AllowInteraction)
|
||||||
{
|
{
|
||||||
<span> <a href=""><i class="fa-solid fa-square-xmark" @onclick="async () => await RemoveClick.InvokeAsync(interaction.Id)" @onclick:preventDefault></i></a></span>
|
<span> <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>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace FoodsharingSiegen.Server.Controls
|
|||||||
/// Gets or sets the value of the remove click (ab)
|
/// Gets or sets the value of the remove click (ab)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<Guid> RemoveClick { get; set; }
|
public Func<Guid, Task>? RemoveClick { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the value of the type (ab)
|
/// Gets or sets the value of the type (ab)
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
<InteractionRow
|
<InteractionRow
|
||||||
Prospect="Prospect"
|
Prospect="Prospect"
|
||||||
Type="InteractionType.ReleasedForVerification"
|
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)"
|
AddClick="() => AddInteraction(InteractionType.ReleasedForVerification)"
|
||||||
RemoveClick="@RemoveInteraction"
|
RemoveClick="@RemoveInteraction"
|
||||||
Caption="Freigabe zur Verifizierung"
|
Caption="Freigabe zur Verifizierung"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace FoodsharingSiegen.Server.Controls
|
|||||||
|
|
||||||
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
|
[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; }
|
[Parameter] public ProspectStateFilter StateFilter { get; set; }
|
||||||
|
|
||||||
|
|||||||
30
FoodsharingSiegen.Server/Controls/ProspectGrid.razor
Normal file
30
FoodsharingSiegen.Server/Controls/ProspectGrid.razor
Normal 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>
|
||||||
|
}
|
||||||
@@ -22,16 +22,13 @@
|
|||||||
<hr/>
|
<hr/>
|
||||||
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
<ProspectFilterControl @bind-Filter="Filter"></ProspectFilterControl>
|
||||||
<hr />
|
<hr />
|
||||||
<h5>@(filterList.Count) Einträge</h5>
|
<ProspectGrid
|
||||||
|
Prospects="filterList"
|
||||||
@if (filterList.Any())
|
OnRemoveInteraction="RemoveInteractionAsync"
|
||||||
{
|
StateFilter="ProspectStateFilter.OnBoarding"
|
||||||
<div class="row m-0">
|
InteractionModal="InteractionModal"
|
||||||
<Repeater Items="@filterList">
|
ProspectModal="@ProspectModal">
|
||||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.OnBoarding"></ProspectContainer>
|
</ProspectGrid>
|
||||||
</Repeater>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<AddProspectModal @ref="ProspectModal" OnAdd="OnAddProspect" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
<AddProspectModal @ref="ProspectModal" OnAdd="OnAddProspect" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||||
@@ -138,7 +138,7 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// Removes the interaction using the specified arg (a. beging, 11.04.2022)
|
/// Removes the interaction using the specified arg (a. beging, 11.04.2022)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="arg">The arg</param>
|
/// <param name="arg">The arg</param>
|
||||||
private async Task RemoveInteraction(Guid arg)
|
private async Task RemoveInteractionAsync(Guid arg)
|
||||||
{
|
{
|
||||||
var confirm = await Message.Confirm("Interaktion wirklich löschen?", "Bestätigen", o =>
|
var confirm = await Message.Confirm("Interaktion wirklich löschen?", "Bestätigen", o =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user