Move edit prospect dialog logic
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
<Button
|
||||
Color="Color.Primary"
|
||||
Clicked="() => ProspectModal.Show()"
|
||||
Clicked="@CreateProspectAsync"
|
||||
Visibility="@(CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador) ? Visibility.Default : Visibility.Invisible)"
|
||||
>Hinzufügen
|
||||
</Button>
|
||||
@@ -26,9 +26,7 @@
|
||||
Prospects="filterList"
|
||||
OnRemoveInteraction="RemoveInteractionAsync"
|
||||
StateFilter="ProspectStateFilter.OnBoarding"
|
||||
InteractionModal="InteractionModal"
|
||||
ProspectModal="@ProspectModal">
|
||||
InteractionModal="InteractionModal">
|
||||
</ProspectGrid>
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnAdd="OnAddProspect" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
@@ -30,7 +30,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
#region Private Properties
|
||||
|
||||
private ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the interaction modal (ab)
|
||||
/// </summary>
|
||||
@@ -41,11 +41,6 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// </summary>
|
||||
private List<Prospect>? ProspectList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the prospect modal (ab)
|
||||
/// </summary>
|
||||
private AddProspectModal ProspectModal { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the users (ab)
|
||||
/// </summary>
|
||||
@@ -69,6 +64,19 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method CreateProspectAsync
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronously creates a new prospect by displaying the AddProspectModal dialog and refreshing the prospect list.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation.</returns>
|
||||
private async Task CreateProspectAsync()
|
||||
{
|
||||
await EditProspectDialog.ShowAsync(ModalService, LoadProspects);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method LoadProspects
|
||||
|
||||
/// <summary>
|
||||
@@ -80,7 +88,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
{
|
||||
CannotHaveInteractions = [InteractionType.Complete, InteractionType.Verify, InteractionType.ReleasedForVerification]
|
||||
};
|
||||
|
||||
|
||||
var prospectsR = await ProspectService.GetProspectsAsync(parameter);
|
||||
if (prospectsR.Success) ProspectList = prospectsR.Data;
|
||||
|
||||
@@ -132,7 +140,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Method RemoveInteraction
|
||||
#region Private Method RemoveInteractionAsync
|
||||
|
||||
/// <summary>
|
||||
/// Removes the interaction using the specified arg (a. beging, 11.04.2022)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
<PageTitle>Abgeschlossene Einarbeitungen - @AppSettings.Terms.Title</PageTitle>
|
||||
<h2>Abgeschlossene Einarbeitungen</h2>
|
||||
<PageTitle>Abgeschlossen - @AppSettings.Terms.Title</PageTitle>
|
||||
<h2>Abgeschlossen</h2>
|
||||
|
||||
@{
|
||||
var filterList = ProspectList.ApplyFilter(Filter);
|
||||
|
||||
@@ -19,10 +19,9 @@
|
||||
{
|
||||
<div class="row m-0">
|
||||
<Repeater Items="@filterList">
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" ProspectModal="ProspectModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.Verification"></ProspectContainer>
|
||||
<ProspectContainer Prospect="context" InteractionModal="InteractionModal" RemoveInteraction="RemoveInteraction" StateFilter="ProspectStateFilter.Verification"></ProspectContainer>
|
||||
</Repeater>
|
||||
</div>
|
||||
}
|
||||
|
||||
<AddProspectModal @ref="ProspectModal" OnUpdate="OnUpdateProspect"></AddProspectModal>
|
||||
<AddInteractionModal @ref="InteractionModal" OnAdd="OnAddInteraction" Users="Users"></AddInteractionModal>
|
||||
@@ -40,9 +40,7 @@ namespace FoodsharingSiegen.Server.Pages
|
||||
/// Gets or sets the value of the prospect list (ab)
|
||||
/// </summary>
|
||||
private List<Prospect>? ProspectList { get; set; }
|
||||
|
||||
private AddProspectModal? ProspectModal { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value of the users (ab)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user