From 19796928e73ad5c0d7d541224e41bac555b36ab7 Mon Sep 17 00:00:00 2001 From: Andre Beging Date: Thu, 27 Mar 2025 17:12:28 +0100 Subject: [PATCH] Refactor onboarding and verification workflows. Adjusted interaction types and state filters to better streamline onboarding and verification processes. Updated UI labels, navigation, and modal dialogs to reflect new terminology and improve usability. Enhanced filtering logic and added new interaction types to support the revised process. --- FoodsharingSiegen.Contracts/Entity/Enums.cs | 21 ++- .../Controls/InteractionRow.razor | 4 +- .../Controls/InteractionRow.razor.cs | 2 +- .../Controls/ProspectContainer.razor | 131 +++++++++++------- .../Controls/ProspectContainer.razor.cs | 2 + .../Controls/ProspectContainer.razor.css | 2 +- .../Dialogs/AddInteractionModal.razor | 2 +- .../Dialogs/AddInteractionModal.razor.cs | 8 ++ .../Pages/Prospects.razor | 6 +- .../Pages/Prospects.razor.cs | 2 +- .../Pages/ProspectsDone.razor.cs | 2 +- .../Pages/ProspectsTodo.razor | 7 +- .../Pages/ProspectsTodo.razor.cs | 2 +- FoodsharingSiegen.Server/Shared/NavMenu.razor | 46 +++--- .../config/appsettings.json | 2 +- 15 files changed, 148 insertions(+), 91 deletions(-) diff --git a/FoodsharingSiegen.Contracts/Entity/Enums.cs b/FoodsharingSiegen.Contracts/Entity/Enums.cs index 2baf57c..2f9a17f 100644 --- a/FoodsharingSiegen.Contracts/Entity/Enums.cs +++ b/FoodsharingSiegen.Contracts/Entity/Enums.cs @@ -90,6 +90,15 @@ namespace FoodsharingSiegen.Contracts.Entity Admin = 300 } + public enum ProspectStateFilter + { + OnBoarding = 10, + + Verification = 20, + + Completed = 30 + } + /// /// The user group enum /// @@ -190,6 +199,16 @@ namespace FoodsharingSiegen.Contracts.Entity /// /// The complete interaction type /// - Complete = 70 + Complete = 70, + + /// + /// The StepInBriefing interaction type + /// + StepInBriefing = 80, + + /// + /// The StepInBriefing interaction type + /// + ReleasedForVerification = 90 } } \ No newline at end of file diff --git a/FoodsharingSiegen.Server/Controls/InteractionRow.razor b/FoodsharingSiegen.Server/Controls/InteractionRow.razor index 143148d..0cfbcd3 100644 --- a/FoodsharingSiegen.Server/Controls/InteractionRow.razor +++ b/FoodsharingSiegen.Server/Controls/InteractionRow.razor @@ -21,7 +21,7 @@
@interaction.User.Name (@interaction.Date.ToShortDateString()) - @if ((Prospect is not { Complete: true } || interaction.Type == InteractionType.Complete) && AllowAddInteraction) + @if ((Prospect is not { Complete: true } || interaction.Type == InteractionType.Complete) && AllowInteraction) {   } @@ -35,7 +35,7 @@ } } - @if (Prospect is not {Complete: true } && (Interactions.Count == 0 || Multiple) && AllowAddInteraction) + @if (Prospect is not {Complete: true } && (Interactions.Count == 0 || Multiple) && AllowInteraction) { if (Multiple) ButtonIconClass = "fa-solid fa-plus";
diff --git a/FoodsharingSiegen.Server/Controls/InteractionRow.razor.cs b/FoodsharingSiegen.Server/Controls/InteractionRow.razor.cs index b5b6d07..72b5378 100644 --- a/FoodsharingSiegen.Server/Controls/InteractionRow.razor.cs +++ b/FoodsharingSiegen.Server/Controls/InteractionRow.razor.cs @@ -20,7 +20,7 @@ namespace FoodsharingSiegen.Server.Controls /// Gets or sets the value of the allow add interaction (ab) /// [Parameter] - public bool AllowAddInteraction { get; set; } + public bool AllowInteraction { get; set; } /// /// Gets or sets the value of the button text (ab) diff --git a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor index 6adea54..420f33b 100644 --- a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor +++ b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor @@ -1,11 +1,8 @@ -@using FoodsharingSiegen.Contracts.Entity -@using FoodsharingSiegen.Contracts.Helper -@using FoodsharingSiegen.Server.BaseClasses -@inherits FsBase +@inherits FsBase @{ var divClass = $"{CssClass} pc-main"; - if (Prospect is {Complete: true }) divClass += " complete"; + if (Prospect is { Complete: true }) divClass += " complete"; }
@@ -14,30 +11,30 @@ { } - + @Prospect?.Name Profil öffnen - + @if (!string.IsNullOrWhiteSpace(Prospect?.Memo) || Prospect?.Warning is true) { var alertColor = Prospect?.Warning is true ? Color.Warning : Color.Info; var alertIconClass = Prospect?.Warning is true ? "fa-solid fa-triangle-exclamation" : "fa-solid fa-circle-info"; - + @Prospect?.Memo } - - + + + + + - - - - - + @if (CurrentUser.IsInGroup(UserGroup.Ambassador)) + { + + + } - - - - - - + @if (StateFilter > ProspectStateFilter.OnBoarding) + { + + + + + + + + + + + + + }
-
-
+
+
diff --git a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs index 562e7e4..93f4983 100644 --- a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs +++ b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs @@ -14,6 +14,8 @@ namespace FoodsharingSiegen.Server.Controls [Parameter] public EventCallback RemoveInteraction { get; set; } + [Parameter] public ProspectStateFilter StateFilter { get; set; } + [Parameter] public string? CssClass { get; set; } diff --git a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.css b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.css index e29ba55..fe35b97 100644 --- a/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.css +++ b/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.css @@ -18,7 +18,7 @@ flex-grow: 1; max-width: 480px; border: 1px solid #533a20; - border-radius: 7px; + border-radius: 3px; margin: 5px; padding: 16px; } diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor index 37d93c1..9258e6c 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor @@ -53,7 +53,7 @@ - + \ No newline at end of file diff --git a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs index 35a8265..3d1a4c3 100644 --- a/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs +++ b/FoodsharingSiegen.Server/Dialogs/AddInteractionModal.razor.cs @@ -72,6 +72,14 @@ namespace FoodsharingSiegen.Server.Dialogs _header = "Als fertig markieren"; _showInfo = true; break; + case InteractionType.StepInBriefing: + _header = "Neulingstreffen absolviert"; + break; + case InteractionType.ReleasedForVerification: + _header = "Zur Verifizierung freigegeben"; + _showInfo = true; + _infoName = "Hinweis"; + break; } Interaction = new Interaction diff --git a/FoodsharingSiegen.Server/Pages/Prospects.razor b/FoodsharingSiegen.Server/Pages/Prospects.razor index 17f30ef..888bceb 100644 --- a/FoodsharingSiegen.Server/Pages/Prospects.razor +++ b/FoodsharingSiegen.Server/Pages/Prospects.razor @@ -4,8 +4,8 @@ @inherits FsBase -@AppSettings.Title - Aktuelle Einarbeitungen -

Aktuelle Einarbeitungen

+@AppSettings.Title - Neue Foodsaver +

Neue Foodsaver

} diff --git a/FoodsharingSiegen.Server/Pages/Prospects.razor.cs b/FoodsharingSiegen.Server/Pages/Prospects.razor.cs index df7524c..3fc0238 100644 --- a/FoodsharingSiegen.Server/Pages/Prospects.razor.cs +++ b/FoodsharingSiegen.Server/Pages/Prospects.razor.cs @@ -94,7 +94,7 @@ namespace FoodsharingSiegen.Server.Pages { var parameter = new GetProspectsParameter { - CannotHaveInteractions = [InteractionType.Complete, InteractionType.Verify] + CannotHaveInteractions = [InteractionType.Complete, InteractionType.Verify, InteractionType.ReleasedForVerification] }; var prospectsR = await ProspectService.GetProspectsAsync(parameter); if (prospectsR.Success) ProspectList = prospectsR.Data; diff --git a/FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs b/FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs index 088b02d..1d5d49a 100644 --- a/FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs +++ b/FoodsharingSiegen.Server/Pages/ProspectsDone.razor.cs @@ -64,7 +64,7 @@ namespace FoodsharingSiegen.Server.Pages ///
private async Task LoadProspects() { - var parameter = new GetProspectsParameter { MustHaveInteractions = new() { InteractionType.Complete } }; + var parameter = new GetProspectsParameter { MustHaveInteractions = [InteractionType.Complete] }; var prospectsR = await ProspectService.GetProspectsAsync(parameter); if (prospectsR.Success) ProspectList = prospectsR.Data; diff --git a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor index 743a043..469794a 100644 --- a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor +++ b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor @@ -2,9 +2,9 @@ @inherits FsBase -@AppSettings.Title - Wartende Einarbeitungen +@AppSettings.Title - -

Wartende Einarbeitungen

+

Freischalten

@{ var filterList = ProspectList; @@ -21,10 +21,9 @@ @if (filterList?.Any() == true) { -
Bereits verifiziert, aber noch nicht abgeschlossen. Zum Beispiel, wenn noch der Druck-Ausweis fehlt o.ä.
- +
} diff --git a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs index 4e4f631..28107dd 100644 --- a/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs +++ b/FoodsharingSiegen.Server/Pages/ProspectsTodo.razor.cs @@ -92,7 +92,7 @@ namespace FoodsharingSiegen.Server.Pages var parameter = new GetProspectsParameter { CannotHaveInteractions = [InteractionType.Complete], - MustHaveInteractions = [InteractionType.Verify] + MustHaveInteractions = [InteractionType.ReleasedForVerification] }; var prospectsR = await ProspectService.GetProspectsAsync(parameter); if (prospectsR.Success) ProspectList = prospectsR.Data; diff --git a/FoodsharingSiegen.Server/Shared/NavMenu.razor b/FoodsharingSiegen.Server/Shared/NavMenu.razor index 0cda9b6..c2b0836 100644 --- a/FoodsharingSiegen.Server/Shared/NavMenu.razor +++ b/FoodsharingSiegen.Server/Shared/NavMenu.razor @@ -4,50 +4,54 @@ Einarbeitungen
@(AppSettings.SidebarTitle ?? AppSettings.Title)
-
-
- -
-
- -
+
+ Hallo @CurrentUser.Name!
+ +
+ +
+ @if (CurrentUser.IsAdmin()) { -