diff --git a/LearningHub.Nhs.WebUI/Views/Reports/CreateReportDateSelection.cshtml b/LearningHub.Nhs.WebUI/Views/Reports/CreateReportDateSelection.cshtml index 62c733db2..04c840a73 100644 --- a/LearningHub.Nhs.WebUI/Views/Reports/CreateReportDateSelection.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Reports/CreateReportDateSelection.cshtml @@ -56,7 +56,7 @@ For the last: - @if (errorHasOccurred) + @if (errorHasOccurred && string.IsNullOrWhiteSpace(Model.TimePeriod)) {
diff --git a/LearningHub.Nhs.WebUI/Views/Reports/Index.cshtml b/LearningHub.Nhs.WebUI/Views/Reports/Index.cshtml index 1a5a95122..5f03ecbe6 100644 --- a/LearningHub.Nhs.WebUI/Views/Reports/Index.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Reports/Index.cshtml @@ -84,8 +84,9 @@ } else { - matchedCourseNames = $"{matched[0]} and {matched.Count - 1} others"; + matchedCourseNames = $"{matched[0]} and {matched.Count - 1} other{((matched.Count - 1) > 1 ? "s" : "")}"; } + matchedCourseNames = UtilityHelper.ConvertToSentenceCase(matchedCourseNames); } diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Helpers/TextCasingHelper.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Helpers/TextCasingHelper.cs new file mode 100644 index 000000000..415211a32 --- /dev/null +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Helpers/TextCasingHelper.cs @@ -0,0 +1,24 @@ +namespace LearningHub.Nhs.OpenApi.Services.Helpers +{ + /// + /// TextCasingHelper. + /// + public class TextCasingHelper + { + /// + /// Returns sentence case of input string. + /// + /// input. + /// A sentence case string corresponding to the input string. + public static string ConvertToSentenceCase(string input) + { + if (string.IsNullOrEmpty(input)) + { + return input; + } + + input = input.ToLower(); + return char.ToUpper(input[0]) + input.Substring(1); + } + } +} diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DatabricksService.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DatabricksService.cs index 922c739ed..c56bca122 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DatabricksService.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DatabricksService.cs @@ -21,9 +21,9 @@ using System.Text.Json; using LearningHub.Nhs.Models.Entities; using LearningHub.Nhs.OpenApi.Services.Interface.Services.Messaging; -using elfhHub.Nhs.Models.Entities; using LearningHub.Nhs.Models.Email.Models; using LearningHub.Nhs.Models.Email; +using LearningHub.Nhs.OpenApi.Services.Helpers; namespace LearningHub.Nhs.OpenApi.Services.Services { @@ -415,10 +415,12 @@ public async Task UpdateDatabricksReport(int userId, DatabricksUpdateRequest dat } else { - firstCourse = $"{matched[0].ToLower()} and {matched.Count - 1} others"; + firstCourse = $"{matched[0].ToLower()} and {matched.Count - 1} other{((matched.Count - 1) > 1 ? "s" : "")}"; + } } + firstCourse = TextCasingHelper.ConvertToSentenceCase(firstCourse); try { diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json b/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json index 155a27dd4..acab953d8 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json +++ b/OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json @@ -96,7 +96,7 @@ "ResourceReadonlyAccess": "

You can continue to search for and access resources in the Learning Hub, however you cannot contribute to it.

If you have any questions about this, please contact the support team.

", "ResourceContributeAccess": "

You can now contribute to the Learning Hub and continue to search for and access resources.

If you have any questions about this, please contact the support team.

", "ReportTitle": "[ReportName] report for [ReportContent] is ready", - "Report": "

Your report [ReportName] report for [ReportContent] is ready. You can view and download the report in the reports section

" + "Report": "

Your [ReportName] report for [ReportContent] is ready. You can view and download the report in the reports section

" }, "MyContributionsUrl": "/my-contributions", "MyLearningUrl": "/MyLearning", diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Pre-Deploy/Scripts/InPlatform_Report_Predeployment.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Pre-Deploy/Scripts/InPlatform_Report_Predeployment.sql index 4cfef993c..08469490e 100644 --- a/WebAPI/LearningHub.Nhs.Database/Scripts/Pre-Deploy/Scripts/InPlatform_Report_Predeployment.sql +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Pre-Deploy/Scripts/InPlatform_Report_Predeployment.sql @@ -3,6 +3,6 @@ GO -INSERT [messaging].[EmailTemplate] ([Id], [LayoutId], [Title], [Subject], [Body], [AvailableTags], [Deleted], [CreateUserId], [CreateDate], [AmendUserId], [AmendDate]) VALUES (2007, 1, N'ReportProcessed', N'[ReportName] report for [ReportContent] is ready', N'

Dear [AdminFirstName],

-

Your report [ReportName] report for [ReportContent] is ready. You can view and download the report in the reports section

', N'[UserFirstName][ReportSection][ReportName][ReportContent]', 0, 4, CAST(N'2025-12-22T00:00:00.0000000+00:00' AS DateTimeOffset), 4, CAST(N'2025-12-22T00:00:00.0000000+00:00' AS DateTimeOffset)) +INSERT [messaging].[EmailTemplate] ([Id], [LayoutId], [Title], [Subject], [Body], [AvailableTags], [Deleted], [CreateUserId], [CreateDate], [AmendUserId], [AmendDate]) VALUES (2007, 1, N'ReportProcessed', N'[ReportName] report for [ReportContent] is ready', N'

Dear [UserFirstName],

+

Your [ReportName] report for [ReportContent] is ready. You can view and download the report in the reports section

', N'[UserFirstName][ReportSection][ReportName][ReportContent]', 0, 4, CAST(N'2025-12-22T00:00:00.0000000+00:00' AS DateTimeOffset), 4, CAST(N'2025-12-22T00:00:00.0000000+00:00' AS DateTimeOffset)) GO \ No newline at end of file