Refactor interaction handling with utility for translations
Introduced `TermHelper.Translate` to centralize string mappings for `InteractionType`, reducing duplication across components. Updated related code to leverage this utility and streamline interaction row implementation by removing the `Caption` parameter. Minor UI adjustments were also made to align button positioning and styling.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@inherits FsBase
|
||||
@using FoodsharingSiegen.Shared.Helper
|
||||
@inherits FsBase
|
||||
|
||||
@{
|
||||
var divClass = $"{CssClass} pc-main";
|
||||
@@ -35,9 +36,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.Welcome"
|
||||
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
||||
AddClick="() => AddInteraction(InteractionType.Welcome)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Begrüßung"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-handshake-simple">
|
||||
</InteractionRow>
|
||||
@@ -46,9 +46,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.StepInBriefing"
|
||||
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
||||
AddClick="() => AddInteraction(InteractionType.StepInBriefing)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="@AppSettings.Terms.StepInName"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-graduation-cap">
|
||||
</InteractionRow>
|
||||
@@ -57,9 +56,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.EinAb"
|
||||
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam, UserGroup.StoreManager, UserGroup.Ambassador))"
|
||||
AddClick="() => AddInteraction(InteractionType.EinAb)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Einführungen"
|
||||
Multiple="true"
|
||||
Minimum="3"
|
||||
ButtonIconClass="fa-solid fa-plus"
|
||||
@@ -76,9 +74,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.ReleasedForVerification"
|
||||
AllowInteraction="@(StateFilter is ProspectStateFilter.OnBoarding or ProspectStateFilter.Verification && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
|
||||
AddClick="() => AddInteraction(InteractionType.ReleasedForVerification)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Freigabe zur Verifizierung"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-id-card">
|
||||
</InteractionRow>
|
||||
@@ -89,9 +86,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.IdCheck"
|
||||
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.IdCheck)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Perso checken"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-magnifying-glass">
|
||||
</InteractionRow>
|
||||
@@ -103,9 +99,8 @@
|
||||
Prospect="Prospect"
|
||||
Type="InteractionType.PrintPass"
|
||||
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
AddClick="() => AddInteraction(InteractionType.PrintPass)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="FS-Ausweis (print)"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-id-card">
|
||||
</InteractionRow>
|
||||
@@ -114,9 +109,8 @@
|
||||
Prospect="Prospect"
|
||||
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
Type="InteractionType.Verify"
|
||||
AddClick="() => AddInteraction(InteractionType.Verify)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Verifizieren"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-user-check">
|
||||
</InteractionRow>
|
||||
@@ -131,9 +125,8 @@
|
||||
Prospect="Prospect"
|
||||
AllowInteraction="@CurrentUser.IsInGroup(UserGroup.Ambassador)"
|
||||
Type="InteractionType.Complete"
|
||||
AddClick="() => AddInteraction(InteractionType.Complete)"
|
||||
AddClick="AddInteraction"
|
||||
RemoveClick="@RemoveInteraction"
|
||||
Caption="Fertig"
|
||||
ButtonIconClass="fa-solid fa-check"
|
||||
IconClass="fa-solid fa-flag-checkered">
|
||||
</InteractionRow>
|
||||
|
||||
Reference in New Issue
Block a user