Move edit prospect dialog logic
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
<div class="@divClass">
|
||||
<h5 class="mb-0">
|
||||
@if (ProspectModal != null && CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.Ambassador))
|
||||
@if (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="EditProspectAsync" @onclick:preventDefault></i> </a>
|
||||
}
|
||||
|
||||
@Prospect?.Name
|
||||
@@ -28,7 +28,6 @@
|
||||
</Alert>
|
||||
}
|
||||
|
||||
|
||||
<table style="width: 100%;">
|
||||
|
||||
<InteractionRow
|
||||
|
||||
@@ -10,8 +10,6 @@ namespace FoodsharingSiegen.Server.Controls
|
||||
|
||||
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
|
||||
|
||||
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
|
||||
|
||||
[Parameter] public Func<Guid, Task>? RemoveInteraction { get; set; }
|
||||
|
||||
[Parameter] public ProspectStateFilter StateFilter { get; set; }
|
||||
@@ -26,7 +24,12 @@ namespace FoodsharingSiegen.Server.Controls
|
||||
|
||||
private List<Interaction> GetTyped(InteractionType type)
|
||||
{
|
||||
return Prospect?.Interactions?.Where(x => x.Type == type).ToList() ?? new List<Interaction>();
|
||||
return Prospect?.Interactions?.Where(x => x.Type == type).ToList() ?? [];
|
||||
}
|
||||
|
||||
private async Task EditProspectAsync()
|
||||
{
|
||||
await EditProspectDialog.ShowAsync(ModalService, () => InvokeAsync(StateHasChanged), Prospect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,7 @@
|
||||
[Parameter] public Func<Guid, Task>? OnRemoveInteraction { get; set; }
|
||||
|
||||
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
|
||||
|
||||
[Parameter] public AddProspectModal? ProspectModal { get; set; } = null!;
|
||||
|
||||
|
||||
[Parameter] public ProspectStateFilter StateFilter { get; set; }
|
||||
|
||||
}
|
||||
@@ -22,7 +20,6 @@
|
||||
<ProspectContainer
|
||||
Prospect="context"
|
||||
InteractionModal="@InteractionModal"
|
||||
ProspectModal="@ProspectModal"
|
||||
RemoveInteraction="OnRemoveInteraction"
|
||||
StateFilter="StateFilter"></ProspectContainer>
|
||||
</Repeater>
|
||||
|
||||
Reference in New Issue
Block a user