From e9912b9d440ba370effebd6f63c6f19db4420d08 Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Sun, 15 Mar 2026 11:21:54 -0700 Subject: [PATCH] RE1-T106 Notification page fix --- Core/Resgrid.Model/DepartmentNotification.cs | 12 ++++++++++++ .../User/Controllers/NotificationsController.cs | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Core/Resgrid.Model/DepartmentNotification.cs b/Core/Resgrid.Model/DepartmentNotification.cs index 2727cf70..359cd0cc 100644 --- a/Core/Resgrid.Model/DepartmentNotification.cs +++ b/Core/Resgrid.Model/DepartmentNotification.cs @@ -88,6 +88,8 @@ public string TranslateBefore(List customStates = null) switch ((EventTypes)EventType) { case EventTypes.UnitStatusChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "Any"; if (BeforeData == "-1") return "Any"; else @@ -115,6 +117,8 @@ public string TranslateBefore(List customStates = null) } break; case EventTypes.PersonnelStaffingChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "Any"; if (BeforeData == "-1") return "Any"; else @@ -142,6 +146,8 @@ public string TranslateBefore(List customStates = null) } break; case EventTypes.PersonnelStatusChanged: + if (string.IsNullOrWhiteSpace(BeforeData)) + return "None"; if (BeforeData == "-1") return "Any"; else @@ -202,6 +208,8 @@ public string TranslateCurrent(List customStates = null) switch ((EventTypes)EventType) { case EventTypes.UnitStatusChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else @@ -229,6 +237,8 @@ public string TranslateCurrent(List customStates = null) } break; case EventTypes.PersonnelStaffingChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else @@ -256,6 +266,8 @@ public string TranslateCurrent(List customStates = null) } break; case EventTypes.PersonnelStatusChanged: + if (string.IsNullOrWhiteSpace(CurrentData)) + return "None"; if (CurrentData == "-1") return "Any"; else diff --git a/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs b/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs index 141c2100..2ffdcec9 100644 --- a/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs +++ b/Web/Resgrid.Web/Areas/User/Controllers/NotificationsController.cs @@ -99,9 +99,9 @@ public async Task Index() var user = _usersService.GetUserById(userId); if (sb.Length > 0) - sb.Append("," + UserHelper.GetFullNameForUser(user.UserId)); + sb.Append("," + await UserHelper.GetFullNameForUser(user.UserId)); else - sb.Append(UserHelper.GetFullNameForUser(user.UserId)); + sb.Append(await UserHelper.GetFullNameForUser(user.UserId)); } }