diff --git a/MeetUpFunctions/Constants.cs b/MeetUpFunctions/Constants.cs index cc52cf2..08fac8c 100644 --- a/MeetUpFunctions/Constants.cs +++ b/MeetUpFunctions/Constants.cs @@ -22,7 +22,7 @@ public static class Constants public const string DEFAULT_DISCLAIMER = "Disclaimer"; public const string DEFAULT_GUEST_DISCLAIMER = "Guest Disclaimer"; - public const string VERSION = "2021-11-08"; + public const string VERSION = "2021-11-14"; public const int ADMINOVERBOOKFACTOR = 2; public const int LOG_TTL = 30 * 24 * 3600; // 30 days TTL for Log items diff --git a/MeetUpPlanner/Client/AppState.cs b/MeetUpPlanner/Client/AppState.cs index 507a9c1..1b59941 100644 --- a/MeetUpPlanner/Client/AppState.cs +++ b/MeetUpPlanner/Client/AppState.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using System.Text; using MeetUpPlanner.Shared; using System.ComponentModel.DataAnnotations; @@ -39,6 +40,21 @@ public ClientSettings ClientSettings [MaxLength(80, ErrorMessage = "Der Nachname ist zu lang."), MinLength(3, ErrorMessage = "Der Nachname ist zu kurz.")] [Required(ErrorMessage = "Der Nachname fehlt.")] public string LastName { get; set; } + public string DisplayName + { + get + { + int nameDisplayLength = _clientSettings != null ? _clientSettings.NameDisplayLength : 0; + int length = nameDisplayLength > 0 ? Math.Min(nameDisplayLength, LastName.Length) : LastName.Length; + StringBuilder sb = new StringBuilder(FirstName).Append(' '); + sb.Append(LastName.Substring(0, length)); + if (length < LastName.Length) + { + sb.Append('.'); + } + return sb.ToString(); + } + } [MaxLength(120, ErrorMessage = "Die Tel-Nr/Mail-Adresse ist zu lang"), MinLength(8, ErrorMessage = "Die Tel-Nr/Mail-Adresse ist zu kurz.")] [Required(ErrorMessage = "Tel-Nr/Mail-Adresse fehlen.")] public string PhoneMail { get; set; } diff --git a/MeetUpPlanner/Client/Pages/About.razor b/MeetUpPlanner/Client/Pages/About.razor index ce68b25..db1ad90 100644 --- a/MeetUpPlanner/Client/Pages/About.razor +++ b/MeetUpPlanner/Client/Pages/About.razor @@ -51,7 +51,7 @@ @code { - private const string clientVersion = "2021-11-08"; + private const string clientVersion = "2021-11-14"; private string serverVersion = "tbd"; private string functionsVersion = "tbd"; diff --git a/MeetUpPlanner/Client/Pages/NewMeetUp.razor b/MeetUpPlanner/Client/Pages/NewMeetUp.razor index c404cc8..cc0f7bc 100644 --- a/MeetUpPlanner/Client/Pages/NewMeetUp.razor +++ b/MeetUpPlanner/Client/Pages/NewMeetUp.razor @@ -7,6 +7,7 @@ @inject NavigationManager NavigationManager @inject NotificationService notificationService @using Newtonsoft.Json +@using System.Text @using Microsoft.AspNetCore.SignalR.Client @using MeetUpPlanner.Shared @using Blazored.TextEditor @@ -648,8 +649,7 @@ _routeComment = new MeetUpPlanner.Shared.Comment(); _routeComment.ReferenceId = route.Core.Id; _routeComment.CommentText = "Im MeetUpPlanner für eine Ausfahrt ausgewählt!"; - _routeComment.AuthorDisplayName = $"{AppStateStore.FirstName}"; - + _routeComment.AuthorDisplayName = AppStateStore.DisplayName; } } diff --git a/MeetUpPlanner/Client/Pages/Routes.razor b/MeetUpPlanner/Client/Pages/Routes.razor index 27f33de..00edea2 100644 --- a/MeetUpPlanner/Client/Pages/Routes.razor +++ b/MeetUpPlanner/Client/Pages/Routes.razor @@ -25,6 +25,7 @@ else