Add new filters and refactor InteractionDialog handling

Introduced new filters for prospects: "WithoutIdCheck" and "NoActivity" with associated UI controls. Refactored `InteractionDialog.ShowAsync` to use a new parameter record for cleaner code and better extensibility. These changes enhance usability and maintainability by providing additional filtering options and streamlining dialog interactions.
This commit is contained in:
Andre Beging
2025-03-28 20:07:12 +01:00
parent aadf88db2b
commit 350e2003ca
5 changed files with 82 additions and 48 deletions

View File

@@ -19,7 +19,24 @@ namespace FoodsharingSiegen.Server.Controls
private async Task AddInteraction(InteractionType type)
{
if (Prospect != null && OnDataChanged != null)
await InteractionDialog.ShowAsync(ModalService, OnDataChanged, type, Prospect.Id);
{
var headerText = type switch
{
InteractionType.EinAb => "Einführung eintragen",
InteractionType.Welcome => "Begrüßung eintragen",
InteractionType.IdCheck => "Ausweisprüfung eintragen",
InteractionType.PrintPass => "FS-Ausweis (Print)",
InteractionType.PdfPass => "FS-Ausweis (PDF)",
InteractionType.Verify => "Verifizierung eintragen",
InteractionType.Complete => "Als fertig markieren",
InteractionType.StepInBriefing => $"{AppSettings.Terms.StepInName} absolviert",
InteractionType.ReleasedForVerification => "Zur Verifizierung freigegeben",
_ => "Neuer Eintrag"
};
await InteractionDialog.ShowAsync(ModalService, new(type, Prospect.Id, headerText, OnDataChanged));
}
}
private List<Interaction> GetTyped(InteractionType type)