Darstellung der Prospects fragmentiert
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
@page "/"
|
||||
@page "/prospect"
|
||||
@page "/prospects"
|
||||
@using FoodsharingSiegen.Server.Dialogs
|
||||
@using FoodsharingSiegen.Server.Controls
|
||||
@using FoodsharingSiegen.Contracts.Entity
|
||||
@using FoodsharingSiegen.Contracts.Helper
|
||||
@using FoodsharingSiegen.Server.BaseClasses
|
||||
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Einarbeitungen</PageTitle>
|
||||
|
||||
<PageTitle>Aktuelle Einarbeitungen</PageTitle>
|
||||
<h2>Aktuelle Einarbeitungen</h2>
|
||||
|
||||
<Button
|
||||
@@ -19,35 +13,17 @@
|
||||
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
|
||||
>Hinzufügen</Button>
|
||||
|
||||
@{
|
||||
var activeProspects = ProspectList?.Where(x => x.Interactions.All(i => i.Type != InteractionType.Complete));
|
||||
}
|
||||
@if (activeProspects?.Any() == true)
|
||||
|
||||
@if (ProspectList?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h3>Aktuell:</h3>
|
||||
<h5>@ProspectList.Count Einträge</h5>
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@activeProspects">
|
||||
<Repeater Items="@ProspectList">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@{
|
||||
var completedProspects = ProspectList?.Where(x => x.Interactions.Any(i => i.Type == InteractionType.Complete));
|
||||
}
|
||||
@if (completedProspects?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h3>Abgeschlossen:</h3>
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@completedProspects">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnAdd="OnAddProspect" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
@@ -1,5 +1,6 @@
|
||||
using Blazorise;
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using FoodsharingSiegen.Server.Dialogs;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
@@ -88,7 +89,11 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// </summary>
|
||||
private async Task LoadProspects()
|
||||
{
|
||||
var prospectsR = await ProspectService.GetProspectsAsync();
|
||||
var parameter = new GetProspectsParameter
|
||||
{
|
||||
CannotHaveInteractions = new List<InteractionType> { InteractionType.Complete, InteractionType.Verify }
|
||||
};
|
||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
|
||||
17
FoodsharingSiegen.Server/Pages/ProspectsDone.razor
Normal file
17
FoodsharingSiegen.Server/Pages/ProspectsDone.razor
Normal file
@@ -0,0 +1,17 @@
|
||||
@page "/done"
|
||||
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Abgeschlossene Einarbeitungen</PageTitle>
|
||||
<h2>Abgeschlossene Einarbeitungen</h2>
|
||||
|
||||
@if (ProspectList?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h5>@ProspectList.Count Einträge</h5>
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@ProspectList">
|
||||
<ProspectContainer Prospect="context" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
93
FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs
Normal file
93
FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// The prospects done class (a. beging, 07.02.2023)
|
||||
/// </summary>
|
||||
public partial class ProspectsTodo
|
||||
{
|
||||
#region Dependencies
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect service (ab)
|
||||
/// </summary>
|
||||
[Inject] public ProspectService ProspectService { get; set; } = null!;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect list (ab)
|
||||
/// </summary>
|
||||
private List<Prospect>? ProspectList { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Override OnAfterRenderAsync
|
||||
|
||||
/// <summary>
|
||||
/// Ons the after render using the specified first render (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="firstRender">The first render</param>
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
await LoadProspects();
|
||||
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
/// Loads the prospects (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
private async Task LoadProspects()
|
||||
{
|
||||
var parameter = new GetProspectsParameter
|
||||
{
|
||||
CannotHaveInteractions = new List<InteractionType> { InteractionType.Complete },
|
||||
MustHaveInteractions = new List<InteractionType> { InteractionType.Verify }
|
||||
};
|
||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method RemoveInteraction
|
||||
|
||||
/// <summary>
|
||||
/// Removes the interaction using the specified arg (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task RemoveInteraction(Guid arg)
|
||||
{
|
||||
var confirm = await Message.Confirm("Interaktion wirklich löschen?", "Bestätigen", o =>
|
||||
{
|
||||
o.ConfirmButtonText = "Ja, wirklich!";
|
||||
o.CancelButtonText = "Abbrechen";
|
||||
o.ShowMessageIcon = false;
|
||||
});
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
await ProspectService.RemoveInteraction(arg);
|
||||
await LoadProspects();
|
||||
}
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
19
FoodsharingSiegen.Server/Pages/ProspectsTodo.razor
Normal file
19
FoodsharingSiegen.Server/Pages/ProspectsTodo.razor
Normal file
@@ -0,0 +1,19 @@
|
||||
@page "/todo"
|
||||
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Wartende Einarbeitungen</PageTitle>
|
||||
|
||||
<h2>Wartende Einarbeitungen</h2>
|
||||
|
||||
@if (ProspectList?.Any() == true)
|
||||
{
|
||||
<hr />
|
||||
<h5>@ProspectList.Count Einträge</h5>
|
||||
<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">
|
||||
<Repeater Items="@ProspectList">
|
||||
<ProspectContainer Prospect="context" RemoveInteraction="RemoveInteraction"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
89
FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs
Normal file
89
FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using FoodsharingSiegen.Contracts.Entity;
|
||||
using FoodsharingSiegen.Contracts.Model;
|
||||
using FoodsharingSiegen.Server.Data.Service;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// The prospects done class (a. beging, 07.02.2023)
|
||||
/// </summary>
|
||||
public partial class ProspectsDone
|
||||
{
|
||||
#region Dependencies
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect service (ab)
|
||||
/// </summary>
|
||||
[Inject] public ProspectService ProspectService { get; set; } = null!;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect list (ab)
|
||||
/// </summary>
|
||||
private List<Prospect>? ProspectList { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Override OnAfterRenderAsync
|
||||
|
||||
/// <summary>
|
||||
/// Ons the after render using the specified first render (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="firstRender">The first render</param>
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
await LoadProspects();
|
||||
|
||||
await base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
/// Loads the prospects (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
private async Task LoadProspects()
|
||||
{
|
||||
var parameter = new GetProspectsParameter {MustHaveInteractions = new List<InteractionType> { InteractionType.Complete }};
|
||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method RemoveInteraction
|
||||
|
||||
/// <summary>
|
||||
/// Removes the interaction using the specified arg (a. beging, 11.04.2022)
|
||||
/// </summary>
|
||||
/// <param name="arg">The arg</param>
|
||||
private async Task RemoveInteraction(Guid arg)
|
||||
{
|
||||
var confirm = await Message.Confirm("Interaktion wirklich löschen?", "Bestätigen", o =>
|
||||
{
|
||||
o.ConfirmButtonText = "Ja, wirklich!";
|
||||
o.CancelButtonText = "Abbrechen";
|
||||
o.ShowMessageIcon = false;
|
||||
});
|
||||
|
||||
if (confirm)
|
||||
{
|
||||
await ProspectService.RemoveInteraction(arg);
|
||||
await LoadProspects();
|
||||
}
|
||||
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user