Introduced the RecordState property to manage the state of prospects, enabling soft deletion and restoration. Updated related database migrations, UI interactions, and filtering logic to accommodate this addition. Also included automatic database migration at runtime to ensure schema compatibility.
153 lines
5.8 KiB
Plaintext
153 lines
5.8 KiB
Plaintext
@using FoodsharingSiegen.Shared.Helper
|
|
@inherits FsBase
|
|
|
|
@{
|
|
var divClass = $"{CssClass} pc-main";
|
|
if (Prospect is { Complete: true }) divClass += " complete";
|
|
if (Prospect is { Warning: true }) divClass += " warning";
|
|
if (Prospect is { RecordState: RecordState.Deleted }) divClass += " deleted";
|
|
}
|
|
|
|
<div class="@divClass">
|
|
<h5 class="mb-2 d-flex">
|
|
<div class="flex-grow-1">
|
|
@Prospect?.Name
|
|
<small style="font-size: .9rem;">@Prospect?.FsId</small>
|
|
</div>
|
|
<div>
|
|
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
|
{
|
|
<i class="fa-solid fa-pen-to-square link mr-2" @onclick="EditProspectAsync" @onclick:preventDefault></i>
|
|
}
|
|
<a href="@(CurrentUser.NetworkLink)/profile/@Prospect?.FsId" target="_blank"><i class="fa-solid fa-eye"></i></a>
|
|
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
|
{
|
|
if (Prospect?.RecordState != RecordState.Deleted)
|
|
{
|
|
<i class="fa-solid fa-trash link ml-2" @onclick="DeleteProspectAsync" @onclick:preventDefault></i>
|
|
}
|
|
else if(CurrentUser.IsAdmin())
|
|
{
|
|
<i class="fa-solid fa-recycle link ml-2" @onclick="RestoreProspectAsync" @onclick:preventDefault></i>
|
|
}
|
|
|
|
}
|
|
</div>
|
|
</h5>
|
|
|
|
@if (!string.IsNullOrWhiteSpace(Prospect?.Memo))
|
|
{
|
|
var alertColor = Prospect?.Warning is true ? Color.Warning : Color.Info;
|
|
var alertIconClass = Prospect?.Warning is true ? "fa-solid fa-triangle-exclamation" : "fa-solid fa-circle-info";
|
|
|
|
<Alert Color="alertColor" Visible Class="p-2 mb-1">
|
|
<AlertDescription><i class="@alertIconClass"></i> @Prospect?.Memo</AlertDescription>
|
|
</Alert>
|
|
}
|
|
|
|
<table style="width: 100%;">
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.Welcome"
|
|
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-handshake-simple">
|
|
</InteractionRow>
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.StepInBriefing"
|
|
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-graduation-cap">
|
|
</InteractionRow>
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.EinAb"
|
|
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.StoreManager, UserGroup.Ambassador))"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
Multiple="true"
|
|
Minimum="3"
|
|
ButtonIconClass="fa-solid fa-plus"
|
|
IconClass="fa-solid fa-basket-shopping">
|
|
</InteractionRow>
|
|
|
|
<tr>
|
|
<td colspan="3">
|
|
<hr style="margin: 10px 0;">
|
|
</td>
|
|
</tr>
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.ReleasedForVerification"
|
|
AllowInteraction="@(StateFilter is ProspectStateFilter.OnBoarding or ProspectStateFilter.Verification && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-id-card">
|
|
</InteractionRow>
|
|
|
|
@if (CurrentUser.IsInGroup(UserGroup.Ambassador))
|
|
{
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.IdCheck"
|
|
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-magnifying-glass">
|
|
</InteractionRow>
|
|
}
|
|
|
|
@if (StateFilter > ProspectStateFilter.OnBoarding)
|
|
{
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
Type="InteractionType.PrintPass"
|
|
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-id-card">
|
|
</InteractionRow>
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
|
Type="InteractionType.Verify"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-user-check">
|
|
</InteractionRow>
|
|
|
|
<tr>
|
|
<td colspan="3">
|
|
<hr style="margin: 10px 0;">
|
|
</td>
|
|
</tr>
|
|
|
|
<InteractionRow
|
|
Prospect="Prospect"
|
|
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
|
Type="InteractionType.Complete"
|
|
AddClick="AddInteraction"
|
|
RemoveClick="@RemoveInteraction"
|
|
ButtonIconClass="fa-solid fa-check"
|
|
IconClass="fa-solid fa-flag-checkered">
|
|
</InteractionRow>
|
|
}
|
|
|
|
</table>
|
|
|
|
|
|
</div> |