Anzeige des Prospect Pages überarbeitet
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<div class="@divClass">
|
<div class="@divClass">
|
||||||
<h5 class="mb-0">
|
<h5 class="mb-0">
|
||||||
@if (CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
@if (ProspectModal != null && CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
||||||
{
|
{
|
||||||
<a href=""><i class="fa-solid fa-pen-to-square" @onclick="() => ProspectModal.Show(Prospect)" @onclick:preventDefault></i> </a>
|
<a href=""><i class="fa-solid fa-pen-to-square" @onclick="() => ProspectModal.Show(Prospect)" @onclick:preventDefault></i> </a>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace FoodsharingSiegen.Server.Controls
|
|||||||
|
|
||||||
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
|
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
|
||||||
|
|
||||||
[Parameter] public AddProspectModal ProspectModal { get; set; } = null!;
|
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
|
||||||
|
|
||||||
[Parameter] public EventCallback<Guid> RemoveInteraction { get; set; }
|
[Parameter] public EventCallback<Guid> RemoveInteraction { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using FoodsharingSiegen.Contracts.Entity;
|
using FoodsharingSiegen.Contracts.Entity;
|
||||||
using FoodsharingSiegen.Contracts.Model;
|
using FoodsharingSiegen.Contracts.Model;
|
||||||
using FoodsharingSiegen.Server.Data.Service;
|
using FoodsharingSiegen.Server.Data.Service;
|
||||||
|
using FoodsharingSiegen.Server.Dialogs;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace FoodsharingSiegen.Server.Pages
|
namespace FoodsharingSiegen.Server.Pages
|
||||||
@@ -8,7 +9,7 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The prospects done class (a. beging, 07.02.2023)
|
/// The prospects done class (a. beging, 07.02.2023)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ProspectsTodo
|
public partial class ProspectsDone
|
||||||
{
|
{
|
||||||
#region Dependencies
|
#region Dependencies
|
||||||
|
|
||||||
@@ -51,11 +52,7 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task LoadProspects()
|
private async Task LoadProspects()
|
||||||
{
|
{
|
||||||
var parameter = new GetProspectsParameter
|
var parameter = new GetProspectsParameter { MustHaveInteractions = new List<InteractionType> { InteractionType.Complete } };
|
||||||
{
|
|
||||||
CannotHaveInteractions = new List<InteractionType> { InteractionType.Complete },
|
|
||||||
MustHaveInteractions = new List<InteractionType> { InteractionType.Verify }
|
|
||||||
};
|
|
||||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,10 @@
|
|||||||
<div class="text-center font-weight-bold">Bereits verifiziert, aber noch nicht abgeschlossen. Zum Beispiel, wenn noch der Druck-Ausweis fehlt o.ä.</div>
|
<div class="text-center font-weight-bold">Bereits verifiziert, aber noch nicht abgeschlossen. Zum Beispiel, wenn noch der Druck-Ausweis fehlt o.ä.</div>
|
||||||
<div class="row m-0">
|
<div class="row m-0">
|
||||||
<Repeater Items="@ProspectList">
|
<Repeater Items="@ProspectList">
|
||||||
<ProspectContainer Prospect="context" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
||||||
</Repeater>
|
</Repeater>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<AddProspectModal @ref="ProspectModal" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||||
|
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
using FoodsharingSiegen.Contracts.Entity;
|
using FoodsharingSiegen.Contracts.Entity;
|
||||||
using FoodsharingSiegen.Contracts.Model;
|
using FoodsharingSiegen.Contracts.Model;
|
||||||
using FoodsharingSiegen.Server.Data.Service;
|
using FoodsharingSiegen.Server.Data.Service;
|
||||||
|
using FoodsharingSiegen.Server.Dialogs;
|
||||||
using Microsoft.AspNetCore.Components;
|
using Microsoft.AspNetCore.Components;
|
||||||
|
|
||||||
namespace FoodsharingSiegen.Server.Pages
|
namespace FoodsharingSiegen.Server.Pages
|
||||||
@@ -8,7 +9,7 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The prospects done class (a. beging, 07.02.2023)
|
/// The prospects done class (a. beging, 07.02.2023)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ProspectsDone
|
public partial class ProspectsTodo
|
||||||
{
|
{
|
||||||
#region Dependencies
|
#region Dependencies
|
||||||
|
|
||||||
@@ -17,15 +18,32 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Inject] public ProspectService ProspectService { get; set; } = null!;
|
[Inject] public ProspectService ProspectService { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the value of the user service (ab)
|
||||||
|
/// </summary>
|
||||||
|
[Inject] public UserService UserService { get; set; } = null!;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Private Properties
|
#region Private Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the value of the interaction modal (ab)
|
||||||
|
/// </summary>
|
||||||
|
private AddInteractionModal? InteractionModal { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the value of the prospect list (ab)
|
/// Gets or sets the value of the prospect list (ab)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private List<Prospect>? ProspectList { get; set; }
|
private List<Prospect>? ProspectList { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the value of the users (ab)
|
||||||
|
/// </summary>
|
||||||
|
private List<User>? Users { get; set; }
|
||||||
|
|
||||||
|
private AddProspectModal? ProspectModal { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Override OnAfterRenderAsync
|
#region Override OnAfterRenderAsync
|
||||||
@@ -51,7 +69,11 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private async Task LoadProspects()
|
private async Task LoadProspects()
|
||||||
{
|
{
|
||||||
var parameter = new GetProspectsParameter {MustHaveInteractions = new List<InteractionType> { InteractionType.Complete }};
|
var parameter = new GetProspectsParameter
|
||||||
|
{
|
||||||
|
CannotHaveInteractions = new List<InteractionType> { InteractionType.Complete },
|
||||||
|
MustHaveInteractions = new List<InteractionType> { InteractionType.Verify }
|
||||||
|
};
|
||||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||||
|
|
||||||
@@ -60,6 +82,29 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
var getUsersR = await UserService.GetUsersAsync();
|
||||||
|
if (getUsersR.Success)
|
||||||
|
Users = getUsersR.Data;
|
||||||
|
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Private Method OnAddInteraction
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ons the add interaction using the specified arg (a. beging, 11.04.2022)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="arg">The arg</param>
|
||||||
|
private async Task OnAddInteraction(Interaction arg)
|
||||||
|
{
|
||||||
|
await ProspectService.AddInteraction(arg);
|
||||||
|
await LoadProspects();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Private Method RemoveInteraction
|
#region Private Method RemoveInteraction
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -85,5 +130,19 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Private Method OnUpdateProspect
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ons the update prospect using the specified prospect (a. beging, 11.04.2022)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="prospect">The prospect</param>
|
||||||
|
private async Task OnUpdateProspect(Prospect prospect)
|
||||||
|
{
|
||||||
|
var updateProspectR = await ProspectService.UpdateAsync(prospect);
|
||||||
|
if (updateProspectR.Success) await LoadProspects();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user