Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
For the last:
</div>

@if (errorHasOccurred)
@if (errorHasOccurred && string.IsNullOrWhiteSpace(Model.TimePeriod))
{
<div id="TimePeriod-error" class="nhsuk-u-padding-top-1 nhsuk-u-padding-bottom-3">

Expand Down
3 changes: 2 additions & 1 deletion LearningHub.Nhs.WebUI/Views/Reports/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace LearningHub.Nhs.OpenApi.Services.Helpers
{
/// <summary>
/// TextCasingHelper.
/// </summary>
public class TextCasingHelper
{
/// <summary>
/// Returns sentence case of input string.
/// </summary>
/// <param name="input">input.</param>
/// <returns>A sentence case string corresponding to the input string.</returns>
public static string ConvertToSentenceCase(string input)
{
if (string.IsNullOrEmpty(input))
{
return input;
}

input = input.ToLower();
return char.ToUpper(input[0]) + input.Substring(1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion OpenAPI/LearningHub.Nhs.OpenApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"ResourceReadonlyAccess": "<p>You can continue to search for and access resources in the Learning Hub, however you cannot contribute to it.</p><p class='pt-4'>If you have any questions about this, please contact the <a href='[SupportContact]' target='_blank'>support team.</a></p>",
"ResourceContributeAccess": "<p>You can now contribute to the Learning Hub and continue to search for and access resources.</p><p class='pt-4'>If you have any questions about this, please contact the <a href='[SupportContact]' target='_blank'>support team.</a></p>",
"ReportTitle": "[ReportName] report for [ReportContent] is ready",
"Report": "<p>Your report [ReportName] report for [ReportContent] is ready. You can view and download the report in the <a href='[ReportSection]' target='_blank'>reports section</a></p>"
"Report": "<p>Your [ReportName] report for [ReportContent] is ready. You can view and download the report in the <a href='[ReportSection]' target='_blank'>reports section</a></p>"
},
"MyContributionsUrl": "/my-contributions",
"MyLearningUrl": "/MyLearning",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'<p>Dear [AdminFirstName],</p>
<p>Your report [ReportName] report for [ReportContent] is ready. You can view and download the report in the <a href=''[ReportSection]'' target=''_blank''>reports section</a></p>', 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'<p>Dear [UserFirstName],</p>
<p>Your [ReportName] report for [ReportContent] is ready. You can view and download the report in the <a href=''[ReportSection]'' target=''_blank''>reports section</a></p>', 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
Loading