Refactor term-related settings into a dedicated class

Extracted term-related properties from AppSettings to a new TermSettings class for improved organization and separation of concerns. Updated appsettings.json to reflect the new structure.
This commit is contained in:
Andre Beging
2025-03-28 09:01:50 +01:00
parent ff5fbd50bf
commit 3d92833199
14 changed files with 49 additions and 36 deletions

View File

@@ -3,27 +3,8 @@
public class AppSettings
{
#region Public Properties
/// <summary>
/// Gets or sets the name of the "StepIn."
/// This property typically represents the label or identifier used for a specific feature
/// or section within the application.
/// </summary>
public string? StepInName { get; set; } = "StepIn";
/// <summary>
/// Gets or sets the title of the application.
/// This property holds the display name or title of the application,
/// which may be used for branding purposes in various parts of the UI.
/// </summary>
public string? Title { get; set; } = "Foodsharing Musterhausen";
/// <summary>
/// Gets or sets the title displayed in the sidebar.
/// This property represents the text that appears in the application's sidebar,
/// typically used for informational or navigational purposes.
/// </summary>
public string? TitleShort { get; set; }
public TermSettings Terms { get; set; } = new();
#endregion
}

View File

@@ -0,0 +1,30 @@
namespace FoodsharingSiegen.Contracts.Model
{
public class TermSettings
{
#region Public Properties
/// <summary>
/// Gets or sets the name of the "StepIn."
/// This property typically represents the label or identifier used for a specific feature
/// or section within the application.
/// </summary>
public string? StepInName { get; set; } = "StepIn";
/// <summary>
/// Gets or sets the title of the application.
/// This property holds the display name or title of the application,
/// which may be used for branding purposes in various parts of the UI.
/// </summary>
public string? Title { get; set; } = "Foodsharing Musterhausen";
/// <summary>
/// Gets or sets the title displayed in the sidebar.
/// This property represents the text that appears in the application's sidebar,
/// typically used for informational or navigational purposes.
/// </summary>
public string? TitleShort { get; set; }
#endregion
}
}

View File

@@ -48,7 +48,7 @@
AllowInteraction="@(StateFilter == ProspectStateFilter.OnBoarding && CurrentUser.IsInGroup(UserGroup.WelcomeTeam))"
AddClick="() => AddInteraction(InteractionType.StepInBriefing)"
RemoveClick="@RemoveInteraction"
Caption="@AppSettings.StepInName"
Caption="@AppSettings.Terms.StepInName"
ButtonIconClass="fa-solid fa-check"
IconClass="fa-solid fa-graduation-cap">
</InteractionRow>

View File

@@ -29,7 +29,7 @@
</div>
<div class="card-body" style="padding: .5rem;">
<div style="margin-left: 1rem;">
<Switch TValue="bool" Checked="Filter.WithoutStepInBriefing" CheckedChanged="WithoutStepInBriefingChangedAsync">Ohne @AppSettings.StepInName</Switch>
<Switch TValue="bool" Checked="Filter.WithoutStepInBriefing" CheckedChanged="WithoutStepInBriefingChangedAsync">Ohne @AppSettings.Terms.StepInName</Switch>
</div>
<TextEdit Text="@Filter.Text" TextChanged="TextChanged" Placeholder="Suchen..." Debounce="true" DebounceInterval="150"/>
</div>

View File

@@ -75,7 +75,7 @@ namespace FoodsharingSiegen.Server.Dialogs
_showInfo = true;
break;
case InteractionType.StepInBriefing:
_header = $"{AppSettings.StepInName} absolviert";
_header = $"{AppSettings.Terms.StepInName} absolviert";
break;
case InteractionType.ReleasedForVerification:
_header = "Zur Verifizierung freigegeben";

View File

@@ -6,7 +6,7 @@
@inherits FsBase
<PageTitle>Aktivitäten - @AppSettings.Title</PageTitle>
<PageTitle>Aktivitäten - @AppSettings.Terms.Title</PageTitle>
<div class="d-flex flex-column p-audit">
<h2>Aktivitäten</h2>

View File

@@ -4,11 +4,11 @@
@inherits FoodsharingSiegen.Server.BaseClasses.FsBase
<PageTitle>@AppSettings.Title</PageTitle>
<PageTitle>@AppSettings.Terms.Title</PageTitle>
<div class="d-flex justify-content-center align-items-center" style="height: 100vh;">
<div class="card" style="width: 100%; max-width: 380px;">
<div class="card-header">@AppSettings.Title</div>
<div class="card-header">@AppSettings.Terms.Title</div>
<div class="card-body">
<Validation Validator="ValidationHelper.ValidateMail" @bind-Status="@IsValidMail">
<TextEdit @bind-Text="MailAddress" Role="TextRole.Email" Placeholder="E-Mail" Class="mt-0" KeyUp="TextEdit_KeyUp"></TextEdit>

View File

@@ -7,7 +7,7 @@
@inherits FsBase
<PageTitle>Profil - @AppSettings.Title</PageTitle>
<PageTitle>Profil - @AppSettings.Terms.Title</PageTitle>
<div style="width: 100%; max-width: 500px;">

View File

@@ -5,7 +5,7 @@
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
<PageTitle>Neue Foodsaver - @AppSettings.Title</PageTitle>
<PageTitle>Neue Foodsaver - @AppSettings.Terms.Title</PageTitle>
<h2>Neue Foodsaver</h2>
<Button

View File

@@ -3,7 +3,7 @@
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
<PageTitle>Abgeschlossene Einarbeitungen - @AppSettings.Title</PageTitle>
<PageTitle>Abgeschlossene Einarbeitungen - @AppSettings.Terms.Title</PageTitle>
<h2>Abgeschlossene Einarbeitungen</h2>
@{

View File

@@ -3,7 +3,7 @@
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
<PageTitle>Freischalten - @AppSettings.Title</PageTitle>
<PageTitle>Freischalten - @AppSettings.Terms.Title</PageTitle>
<h2>Freischalten</h2>

View File

@@ -22,7 +22,7 @@
}
<PageTitle>Benutzerverwaltung - @AppSettings.Title</PageTitle>
<PageTitle>Benutzerverwaltung - @AppSettings.Terms.Title</PageTitle>
<h2>Benutzerverwaltung <span style="font-size: .5em; line-height: 0;">Admin</span></h2>

View File

@@ -2,7 +2,7 @@
<div class="nav-logo"></div>
<div class="d-flex px-3 justify-content-center text-center font-weight-bold">
Einarbeitungen<br/>
@(AppSettings.TitleShort ?? AppSettings.Title)
@(AppSettings.Terms.TitleShort ?? AppSettings.Terms.Title)
</div>
<div class="d-flex px-3 mt-3 justify-content-center text-center font-weight-bold">
Hallo @CurrentUser.Name!

View File

@@ -7,8 +7,10 @@
}
},
"Settings": {
"Title": "Foodsharing Musterhausen",
"TitleShort": "Musterhausen",
"StepInName": "Krabbelgruppe"
"Terms": {
"Title": "Foodsharing Musterhausen",
"TitleShort": "Musterhausen",
"StepInName": "Krabbelgruppe2"
}
}
}