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:
@@ -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)
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
@inherits FsBase
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public ProspectFilter Filter { get; set; } = new();
|
||||
[Parameter] public ProspectFilter Filter { get; set; } = new();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<ProspectFilter> FilterChanged { get; set; }
|
||||
[Parameter] public EventCallback<ProspectFilter> FilterChanged { get; set; }
|
||||
|
||||
[Parameter] public ProspectStateFilter StateFilter { get; set; }
|
||||
|
||||
@@ -23,6 +21,18 @@
|
||||
await FilterChanged.InvokeAsync(Filter);
|
||||
}
|
||||
|
||||
private async Task WithoutIdCheckChangedAsync(bool arg)
|
||||
{
|
||||
Filter.WithoutIdCheck = arg;
|
||||
await FilterChanged.InvokeAsync(Filter);
|
||||
}
|
||||
|
||||
private async Task NoActivityChangedAsync(bool arg)
|
||||
{
|
||||
Filter.NoActivity = arg;
|
||||
await FilterChanged.InvokeAsync(Filter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
@@ -36,6 +46,18 @@
|
||||
<Switch TValue="bool" Checked="Filter.WithoutStepInBriefing" CheckedChanged="WithoutStepInBriefingChangedAsync">Ohne @AppSettings.Terms.StepInName</Switch>
|
||||
</div>
|
||||
}
|
||||
@if (StateFilter == ProspectStateFilter.Verification)
|
||||
{
|
||||
<div style="margin-left: 1rem;">
|
||||
<Switch TValue="bool" Checked="Filter.WithoutIdCheck" CheckedChanged="WithoutIdCheckChangedAsync">Perso noch nicht geprüft</Switch>
|
||||
</div>
|
||||
}
|
||||
@if (StateFilter is ProspectStateFilter.OnBoarding or ProspectStateFilter.Verification)
|
||||
{
|
||||
<div style="margin-left: 1rem;">
|
||||
<Switch TValue="bool" Checked="Filter.NoActivity" CheckedChanged="NoActivityChangedAsync">Lange keine Aktivität (6 Monate)</Switch>
|
||||
</div>
|
||||
}
|
||||
<TextEdit Text="@Filter.Text" TextChanged="TextChanged" Placeholder="Suchen..." Debounce="true" DebounceInterval="150"/>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user