Claim Logic
This commit is contained in:
@@ -28,6 +28,9 @@
|
||||
|
||||
[Parameter]
|
||||
public int Minimum { get; set; } = 1;
|
||||
|
||||
[Parameter]
|
||||
public bool AllowAddInteraction { get; set; }
|
||||
|
||||
private List<Interaction> Interactions => Prospect?.Interactions?.Where(x => x.Type == Type).ToList() ?? new List<Interaction>();
|
||||
|
||||
@@ -62,7 +65,7 @@
|
||||
<span>(<i>@interaction.Info</i>)</span>
|
||||
}
|
||||
|
||||
@if (!Prospect.Complete || interaction.Type == InteractionType.Complete)
|
||||
@if ((!Prospect.Complete || interaction.Type == InteractionType.Complete) && AllowAddInteraction)
|
||||
{
|
||||
<span> <a href=""><i class="fa-solid fa-square-xmark" @onclick="async () => await RemoveClick.InvokeAsync(interaction.Id)" @onclick:preventDefault></i></a></span>
|
||||
}
|
||||
@@ -71,7 +74,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@if (!Prospect.Complete && (Interactions.Count == 0 || Multiple))
|
||||
@if (!Prospect.Complete && (Interactions.Count == 0 || Multiple) && AllowAddInteraction)
|
||||
{
|
||||
if (Multiple) ButtonText = "+";
|
||||
<Button Size="Size.Small" Clicked="AddClick">@ButtonText</Button>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
@using FoodsharingSiegen.Contracts.Helper
|
||||
@using FoodsharingSiegen.Server.BaseClasses
|
||||
@inherits FsBase
|
||||
|
||||
@{
|
||||
var divClass = "pc-main";
|
||||
@@ -18,6 +21,7 @@
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.Welcome"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.WelcomeTeam)"
|
||||
AddClick="() => AddInteraction(InteractionType.Welcome)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Begrüßung"
|
||||
@@ -28,6 +32,7 @@
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.EinAb"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.StoreManager, UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.EinAb)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Einführungen"
|
||||
@@ -40,6 +45,7 @@
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.IdCheck"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.IdCheck)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Perso prüfen"
|
||||
@@ -50,6 +56,7 @@
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.PdfPass"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.PdfPass)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="FS-Ausweis (digital)"
|
||||
@@ -60,6 +67,7 @@
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.PrintPass"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.PrintPass)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="FS-Ausweis (print)"
|
||||
@@ -69,6 +77,7 @@
|
||||
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
Type="InteractionType.Verify"
|
||||
AddClick="() => AddInteraction(InteractionType.Verify)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
@@ -79,6 +88,7 @@
|
||||
|
||||
<InteractionRow
|
||||
Prospect="Prospect"
|
||||
AllowAddInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
Type="InteractionType.Complete"
|
||||
AddClick="() => AddInteraction(InteractionType.Complete)"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
|
||||
Reference in New Issue
Block a user