diff --git a/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj b/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj index 34519f18..04b499ea 100644 --- a/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj +++ b/AdminUI/LearningHub.Nhs.AdminUI/LearningHub.Nhs.AdminUI.csproj @@ -89,7 +89,7 @@ - + diff --git a/LearningHub.Nhs.WebUI.AutomatedUiTests/LearningHub.Nhs.WebUI.AutomatedUiTests.csproj b/LearningHub.Nhs.WebUI.AutomatedUiTests/LearningHub.Nhs.WebUI.AutomatedUiTests.csproj index 00dc59fd..e9d58ce5 100644 --- a/LearningHub.Nhs.WebUI.AutomatedUiTests/LearningHub.Nhs.WebUI.AutomatedUiTests.csproj +++ b/LearningHub.Nhs.WebUI.AutomatedUiTests/LearningHub.Nhs.WebUI.AutomatedUiTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/LearningHub.Nhs.WebUI/Controllers/MyLearningController.cs b/LearningHub.Nhs.WebUI/Controllers/MyLearningController.cs index 46e449db..1157fcbe 100644 --- a/LearningHub.Nhs.WebUI/Controllers/MyLearningController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/MyLearningController.cs @@ -94,181 +94,6 @@ public static string RenderRazorViewToString(Controller controller, string viewN } } - /////// - /////// Index. - /////// - /////// learningRequest. - /////// The my learning dashboard type. - /////// IActionResult. - ////[Route("MyLearning")] - ////[Route("MyLearning/activity")] - ////[HttpGet] - ////[HttpPost] - ////public async Task Index(MyLearningViewModel learningRequest = null, string myLearningDashboard = null) - ////{ - //// var myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// Take = MyLearningPageSize, - //// TimePeriod = !string.IsNullOrWhiteSpace(learningRequest.TimePeriod) ? learningRequest.TimePeriod : "allDates", - //// StartDate = learningRequest.StartDate, - //// EndDate = learningRequest.EndDate, - //// Weblink = learningRequest.Weblink, - //// File = learningRequest.File, - //// Video = learningRequest.Video, - //// Article = learningRequest.Article, - //// Case = learningRequest.Case, - //// Image = learningRequest.Image, - //// Audio = learningRequest.Audio, - //// Elearning = learningRequest.Elearning, - //// Html = learningRequest.Html, - //// Assessment = learningRequest.Assessment, - //// Complete = learningRequest.Complete, - //// Incomplete = learningRequest.Incomplete, - //// Passed = learningRequest.Passed, - //// Failed = learningRequest.Failed, - //// Downloaded = learningRequest.Downloaded, - //// Viewed = learningRequest.Viewed, - //// Launched = learningRequest.Launched, - //// CertificateEnabled = learningRequest.CertificateEnabled, - //// }; - - //// if (myLearningDashboard != null) - //// { - //// if (myLearningDashboard == "my-in-progress") - //// { - //// myLearningRequestModel.Incomplete = true; - //// myLearningRequestModel.Failed = true; - //// } - //// else if (myLearningDashboard == "my-recent-completed") - //// { - //// myLearningRequestModel.Complete = true; - //// myLearningRequestModel.Passed = true; - //// myLearningRequestModel.Downloaded = true; - //// } - //// else if (myLearningDashboard == "my-certificates") - //// { - //// myLearningRequestModel.CertificateEnabled = true; - //// myLearningRequestModel.Complete = true; - //// myLearningRequestModel.Passed = true; - //// myLearningRequestModel.Downloaded = true; - //// } - //// } - - //// switch (learningRequest.MyLearningFormActionType) - //// { - //// case MyLearningFormActionTypeEnum.NextPageChange: - //// learningRequest.CurrentPageIndex += 1; - //// myLearningRequestModel.Skip = learningRequest.CurrentPageIndex * MyLearningPageSize; - //// break; - - //// case MyLearningFormActionTypeEnum.PreviousPageChange: - //// learningRequest.CurrentPageIndex -= 1; - //// myLearningRequestModel.Skip = learningRequest.CurrentPageIndex * MyLearningPageSize; - //// break; - //// case MyLearningFormActionTypeEnum.BasicSearch: - - //// myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// TimePeriod = !string.IsNullOrWhiteSpace(learningRequest.TimePeriod) ? learningRequest.TimePeriod : "allDates", - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// Take = MyLearningPageSize, - //// }; - //// break; - - //// case MyLearningFormActionTypeEnum.ApplyWeekFilter: - //// myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// TimePeriod = "thisWeek", - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// Take = MyLearningPageSize, - //// }; - //// break; - //// case MyLearningFormActionTypeEnum.ApplyMonthFilter: - //// myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// TimePeriod = "thisMonth", - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// Take = MyLearningPageSize, - //// }; - //// break; - - //// case MyLearningFormActionTypeEnum.ApplyTwelveMonthFilter: - //// myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// TimePeriod = "last12Months", - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// Take = MyLearningPageSize, - //// }; - //// break; - - //// case MyLearningFormActionTypeEnum.ApplyMajorFilters: - //// if (learningRequest.TimePeriod == "dateRange") - //// { - //// if (!this.ModelState.IsValid) - //// { - //// break; - //// } - - //// myLearningRequestModel.TimePeriod = learningRequest.TimePeriod; - //// myLearningRequestModel.StartDate = learningRequest.GetStartDate().HasValue ? learningRequest.GetStartDate().Value : null; - //// myLearningRequestModel.EndDate = learningRequest.GetEndDate().HasValue ? learningRequest.GetEndDate().Value : null; - //// } - - //// break; - - //// case MyLearningFormActionTypeEnum.ClearAllFilters: - - //// myLearningRequestModel = new MyLearningRequestModel - //// { - //// SearchText = learningRequest.SearchText?.Trim(), - //// Skip = learningRequest.CurrentPageIndex * MyLearningPageSize, - //// TimePeriod = "allDates", - //// Take = MyLearningPageSize, - //// }; - //// break; - //// } - - //// ////var result = await this.myLearningService.GetUserRecentMyLearningActivities(myLearningRequestModel); - //// var result = await this.myLearningService.GetActivityDetailed(myLearningRequestModel); - //// var response = new MyLearningViewModel(myLearningRequestModel); - //// if (learningRequest.TimePeriod == "dateRange") - //// { - //// response.StartDay = learningRequest.StartDay; - //// response.StartMonth = learningRequest.StartMonth; - //// response.StartYear = learningRequest.StartYear; - //// response.EndDay = learningRequest.EndDay; - //// response.EndMonth = learningRequest.EndMonth; - //// response.EndYear = learningRequest.EndYear; - //// } - - //// if (result != null) - //// { - //// response.TotalCount = result.TotalCount; - //// response.Activities = result.Activities.Select(entry => new ActivityDetailedItemViewModel(entry)).ToList(); - //// if (response.Activities.Any()) - //// { - //// foreach (var activity in response.Activities) - //// { - //// if (!response.MostRecentResources.Contains(activity.ResourceId)) - //// { - //// activity.IsMostRecent = true; - //// response.MostRecentResources.Add(activity.ResourceId); - //// } - //// } - //// } - //// } - - //// response.MyLearningPaging = new MyLearningPagingModel() { CurrentPage = learningRequest.CurrentPageIndex, PageSize = MyLearningPageSize, TotalItems = response.TotalCount, HasItems = response.TotalCount > 0 }; - //// this.ViewBag.MyLearningHelpUrl = this.Settings.SupportUrls.MyLearningHelpUrl; - //// return this.View(response); - ////} - /// /// Index. /// @@ -746,11 +571,12 @@ public async Task ViewProgress(int resourceId, int resourceRefere [HttpPost] public async Task Certificates(MyLearningUserCertificatesViewModel certificateRequest = null) { + int certificatePageSize = 6; var myLearningRequestModel = new MyLearningRequestModel { SearchText = certificateRequest.SearchText?.Trim(), - Skip = certificateRequest.CurrentPageIndex * MyLearningPageSize, - Take = MyLearningPageSize, + Skip = certificateRequest.CurrentPageIndex * certificatePageSize, + Take = certificatePageSize, File = certificateRequest.File, Video = certificateRequest.Video, Article = certificateRequest.Article, @@ -767,20 +593,20 @@ public async Task Certificates(MyLearningUserCertificatesViewMode { case MyLearningFormActionTypeEnum.NextPageChange: certificateRequest.CurrentPageIndex += 1; - myLearningRequestModel.Skip = certificateRequest.CurrentPageIndex * MyLearningPageSize; + myLearningRequestModel.Skip = certificateRequest.CurrentPageIndex * certificatePageSize; break; case MyLearningFormActionTypeEnum.PreviousPageChange: certificateRequest.CurrentPageIndex -= 1; - myLearningRequestModel.Skip = certificateRequest.CurrentPageIndex * MyLearningPageSize; + myLearningRequestModel.Skip = certificateRequest.CurrentPageIndex * certificatePageSize; break; case MyLearningFormActionTypeEnum.BasicSearch: myLearningRequestModel = new MyLearningRequestModel { SearchText = certificateRequest.SearchText?.Trim(), - Skip = certificateRequest.CurrentPageIndex * MyLearningPageSize, - Take = MyLearningPageSize, + Skip = certificateRequest.CurrentPageIndex * certificatePageSize, + Take = certificatePageSize, }; break; case MyLearningFormActionTypeEnum.ClearAllFilters: @@ -788,8 +614,8 @@ public async Task Certificates(MyLearningUserCertificatesViewMode myLearningRequestModel = new MyLearningRequestModel { SearchText = certificateRequest.SearchText?.Trim(), - Skip = certificateRequest.CurrentPageIndex * MyLearningPageSize, - Take = MyLearningPageSize, + Skip = certificateRequest.CurrentPageIndex * certificatePageSize, + Take = certificatePageSize, }; break; } diff --git a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj index c562072c..ce55ad82 100644 --- a/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj +++ b/LearningHub.Nhs.WebUI/LearningHub.Nhs.WebUI.csproj @@ -113,7 +113,7 @@ - + diff --git a/LearningHub.Nhs.WebUI/Views/Home/_LearningActivityCard.cshtml b/LearningHub.Nhs.WebUI/Views/Home/_LearningActivityCard.cshtml index 28e33f82..03d76d2b 100644 --- a/LearningHub.Nhs.WebUI/Views/Home/_LearningActivityCard.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Home/_LearningActivityCard.cshtml @@ -10,6 +10,7 @@ @inject LearningHub.Nhs.WebUI.Interfaces.IMoodleApiService moodleApiService; @model Tuple @{ + bool providerExists = Model.Item2.Providers?.Count > 0; string cardStyle = Model.Item1.Contains("my-learning") ? "card-provider-details--darkblank" : "card-provider-details--blank"; var activityDate = Model.Item2.ActivityDate.Date; var today = DateTime.Today; @@ -109,5 +110,14 @@ -
+ @if (providerExists) + { +
+ @ProviderHelper.GetProviderString(Model.Item2.Providers.FirstOrDefault().Name) +
+ } + else + { +
+ } \ No newline at end of file diff --git a/LearningHub.Nhs.WebUI/Views/MyLearning/Certificates.cshtml b/LearningHub.Nhs.WebUI/Views/MyLearning/Certificates.cshtml index bcba2b0b..8cfaf68d 100644 --- a/LearningHub.Nhs.WebUI/Views/MyLearning/Certificates.cshtml +++ b/LearningHub.Nhs.WebUI/Views/MyLearning/Certificates.cshtml @@ -193,7 +193,10 @@ - +
+ +
+

diff --git a/LearningHub.Nhs.WebUI/Views/MyLearning/_CertificateFilterSummary.cshtml b/LearningHub.Nhs.WebUI/Views/MyLearning/_CertificateFilterSummary.cshtml new file mode 100644 index 00000000..3cd7b798 --- /dev/null +++ b/LearningHub.Nhs.WebUI/Views/MyLearning/_CertificateFilterSummary.cshtml @@ -0,0 +1,125 @@ +@using LearningHub.Nhs.Models.Enums +@using LearningHub.Nhs.WebUI.Helpers +@using LearningHub.Nhs.WebUI.Models +@using LearningHub.Nhs.WebUI.Models.Learning; +@model MyLearningUserCertificatesViewModel; +@{ + string statusFilter = "Status: "; + string certificateFilter = string.Empty; + string typeFilter = "Type: "; + string filtersummary = string.Empty; + + @if (Model.CertificateEnabled) + { + certificateFilter = $"Certificates: Certificate"; + } + @if (Model.Complete) + { + filtersummary = filtersummary + $" Completed"; + } + @if (Model.Incomplete) + { + filtersummary = filtersummary + $" In progress"; + } + @if (Model.Passed) + { + filtersummary = filtersummary + $" Passed"; + } + @if (Model.Failed) + { + filtersummary = filtersummary + $" Failed"; + } + @if (Model.Downloaded) + { + filtersummary = filtersummary + $" Downloaded"; + } + @if (Model.Viewed) + { + filtersummary = filtersummary + $" Viewed"; + } + @if (Model.Launched) + { + filtersummary = filtersummary + $" Launched"; + } + @if (string.IsNullOrWhiteSpace(filtersummary)) + { + statusFilter = string.Empty; + } + else + { + statusFilter = statusFilter + filtersummary; + filtersummary = string.Empty; + } + + @if (Model.Article) + { + filtersummary = filtersummary + $" Article"; + } + @if (Model.Assessment) + { + filtersummary = filtersummary + $" Assessment"; + } + @if (Model.Audio) + { + filtersummary = filtersummary + $" Audio"; + } + @if (Model.Case) + { + filtersummary = filtersummary + $" Case"; + } + @if (Model.Elearning) + { + filtersummary = filtersummary + $" elearning"; + } + @if (Model.Html) + { + filtersummary = filtersummary + $" HTML"; + } + @if (Model.File) + { + filtersummary = filtersummary + $" File"; + } + @if (Model.Image) + { + filtersummary = filtersummary + $" Image"; + } + @if (Model.Video) + { + filtersummary = filtersummary + $" Video"; + } + @if (Model.Weblink) + { + filtersummary = filtersummary + $" Weblink"; + } + + @if (Model.Courses) + { + filtersummary = filtersummary + $" Courses"; + } + + @if (string.IsNullOrWhiteSpace(filtersummary)) + { + typeFilter = string.Empty; + } + else + { + typeFilter = typeFilter + filtersummary; + } + +} + +
+ @if (!string.IsNullOrWhiteSpace(statusFilter) || !string.IsNullOrWhiteSpace(statusFilter)) + { + Filtered by + } + @if (!string.IsNullOrWhiteSpace(statusFilter)) + { + @Html.Raw(statusFilter) + } + @if (!string.IsNullOrWhiteSpace(typeFilter)) + { + @Html.Raw(typeFilter) + } +
+ diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Models/LearningHub.Nhs.OpenApi.Models.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Models/LearningHub.Nhs.OpenApi.Models.csproj index 789097c6..aa12f509 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Models/LearningHub.Nhs.OpenApi.Models.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Models/LearningHub.Nhs.OpenApi.Models.csproj @@ -16,7 +16,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/LearningHub.Nhs.OpenApi.Repositories.Interface.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/LearningHub.Nhs.OpenApi.Repositories.Interface.csproj index eb00ba17..a53dd898 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/LearningHub.Nhs.OpenApi.Repositories.Interface.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Repositories.Interface/LearningHub.Nhs.OpenApi.Repositories.Interface.csproj @@ -17,7 +17,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Repositories/LearningHub.Nhs.OpenApi.Repositories.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Repositories/LearningHub.Nhs.OpenApi.Repositories.csproj index cd4e95ed..62c0ffef 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Repositories/LearningHub.Nhs.OpenApi.Repositories.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Repositories/LearningHub.Nhs.OpenApi.Repositories.csproj @@ -24,7 +24,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/LearningHub.Nhs.OpenApi.Services.Interface.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/LearningHub.Nhs.OpenApi.Services.Interface.csproj index 471fccae..898bef76 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/LearningHub.Nhs.OpenApi.Services.Interface.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services.Interface/LearningHub.Nhs.OpenApi.Services.Interface.csproj @@ -17,7 +17,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj index 8ec5d414..09bea69a 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/LearningHub.Nhs.OpenApi.Services.csproj @@ -30,7 +30,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DashboardService.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DashboardService.cs index fddd94c6..c3bd9c4b 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DashboardService.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/DashboardService.cs @@ -156,6 +156,21 @@ public async Task GetMyCoursesAndElearning resource.Providers = await providerService.GetByResourceVersionIdAsync(resource.ResourceVersionId); } } + if (myInProgressActivities.TotalCount > 0) + { + foreach (var activity in myInProgressActivities.Activities) + { + activity.Providers = await providerService.GetByResourceVersionIdAsync(activity.ResourceVersionId); + } + } + + if (certificates.TotalCount > 0) + { + foreach (var certificate in certificates.Certificates) + { + certificate.Providers = await providerService.GetByResourceVersionIdAsync(certificate.ResourceVersionId); + } + } var response = new DashboardMyLearningResponseViewModel { @@ -318,7 +333,8 @@ public async Task GetUserCertificateDet ? DateTimeOffset.FromUnixTimeSeconds(c.AwardedDate.Value) : DateTimeOffset.MinValue, CertificatePreviewUrl = c.PreviewLink, - CertificateDownloadUrl = c.DownloadLink + CertificateDownloadUrl = c.DownloadLink, + ResourceVersionId = 0 }); } diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/MyLearningService.cs b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/MyLearningService.cs index e4df3cb1..411d0e51 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/MyLearningService.cs +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Services/Services/MyLearningService.cs @@ -691,7 +691,8 @@ public async Task GetUserCertificateDet ? DateTimeOffset.FromUnixTimeSeconds(c.AwardedDate.Value) : DateTimeOffset.MinValue, CertificatePreviewUrl = c.PreviewLink, - CertificateDownloadUrl = c.DownloadLink + CertificateDownloadUrl = c.DownloadLink, + ResourceVersionId = 0 }); } diff --git a/OpenAPI/LearningHub.Nhs.OpenApi.Tests/LearningHub.Nhs.OpenApi.Tests.csproj b/OpenAPI/LearningHub.Nhs.OpenApi.Tests/LearningHub.Nhs.OpenApi.Tests.csproj index 8382dff2..878011b0 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi.Tests/LearningHub.Nhs.OpenApi.Tests.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi.Tests/LearningHub.Nhs.OpenApi.Tests.csproj @@ -11,7 +11,7 @@ - + diff --git a/OpenAPI/LearningHub.Nhs.OpenApi/LearningHub.NHS.OpenAPI.csproj b/OpenAPI/LearningHub.Nhs.OpenApi/LearningHub.NHS.OpenAPI.csproj index 1c56ee39..4939fe7f 100644 --- a/OpenAPI/LearningHub.Nhs.OpenApi/LearningHub.NHS.OpenAPI.csproj +++ b/OpenAPI/LearningHub.Nhs.OpenApi/LearningHub.NHS.OpenAPI.csproj @@ -19,7 +19,7 @@ - + diff --git a/ReportAPI/LearningHub.Nhs.ReportApi.Services.Interface/LearningHub.Nhs.ReportApi.Services.Interface.csproj b/ReportAPI/LearningHub.Nhs.ReportApi.Services.Interface/LearningHub.Nhs.ReportApi.Services.Interface.csproj index 8f45bb6c..98f007b5 100644 --- a/ReportAPI/LearningHub.Nhs.ReportApi.Services.Interface/LearningHub.Nhs.ReportApi.Services.Interface.csproj +++ b/ReportAPI/LearningHub.Nhs.ReportApi.Services.Interface/LearningHub.Nhs.ReportApi.Services.Interface.csproj @@ -16,7 +16,7 @@ - + diff --git a/ReportAPI/LearningHub.Nhs.ReportApi.Services.UnitTests/LearningHub.Nhs.ReportApi.Services.UnitTests.csproj b/ReportAPI/LearningHub.Nhs.ReportApi.Services.UnitTests/LearningHub.Nhs.ReportApi.Services.UnitTests.csproj index b64ee26c..eea547da 100644 --- a/ReportAPI/LearningHub.Nhs.ReportApi.Services.UnitTests/LearningHub.Nhs.ReportApi.Services.UnitTests.csproj +++ b/ReportAPI/LearningHub.Nhs.ReportApi.Services.UnitTests/LearningHub.Nhs.ReportApi.Services.UnitTests.csproj @@ -18,7 +18,7 @@ - + diff --git a/ReportAPI/LearningHub.Nhs.ReportApi.Services/LearningHub.Nhs.ReportApi.Services.csproj b/ReportAPI/LearningHub.Nhs.ReportApi.Services/LearningHub.Nhs.ReportApi.Services.csproj index 85ac8d84..2ee31940 100644 --- a/ReportAPI/LearningHub.Nhs.ReportApi.Services/LearningHub.Nhs.ReportApi.Services.csproj +++ b/ReportAPI/LearningHub.Nhs.ReportApi.Services/LearningHub.Nhs.ReportApi.Services.csproj @@ -19,7 +19,7 @@ - + diff --git a/ReportAPI/LearningHub.Nhs.ReportApi.Shared/LearningHub.Nhs.ReportApi.Shared.csproj b/ReportAPI/LearningHub.Nhs.ReportApi.Shared/LearningHub.Nhs.ReportApi.Shared.csproj index d7a553c7..7f02f7ec 100644 --- a/ReportAPI/LearningHub.Nhs.ReportApi.Shared/LearningHub.Nhs.ReportApi.Shared.csproj +++ b/ReportAPI/LearningHub.Nhs.ReportApi.Shared/LearningHub.Nhs.ReportApi.Shared.csproj @@ -17,7 +17,7 @@ - + diff --git a/ReportAPI/LearningHub.Nhs.ReportApi/LearningHub.Nhs.ReportApi.csproj b/ReportAPI/LearningHub.Nhs.ReportApi/LearningHub.Nhs.ReportApi.csproj index a0d1c02e..a3bccae8 100644 --- a/ReportAPI/LearningHub.Nhs.ReportApi/LearningHub.Nhs.ReportApi.csproj +++ b/ReportAPI/LearningHub.Nhs.ReportApi/LearningHub.Nhs.ReportApi.csproj @@ -20,7 +20,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj b/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj index b9dde068..463e7a76 100644 --- a/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj +++ b/WebAPI/LearningHub.Nhs.API/LearningHub.Nhs.Api.csproj @@ -29,7 +29,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj b/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj index c01f1d63..0998c373 100644 --- a/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj +++ b/WebAPI/LearningHub.Nhs.Api.Shared/LearningHub.Nhs.Api.Shared.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj b/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj index b4113948..ebf3e0c5 100644 --- a/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj +++ b/WebAPI/LearningHub.Nhs.Api.UnitTests/LearningHub.Nhs.Api.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserInProgressLearningActivities.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserInProgressLearningActivities.sql index 0f440c02..6a188702 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserInProgressLearningActivities.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserInProgressLearningActivities.sql @@ -58,7 +58,7 @@ BEGIN LEFT JOIN [activity].[ScormActivity] sa ON sa.ResourceActivityId = ra.Id WHERE ra.LaunchResourceActivityId IS NULL AND ra.userid = @userId AND ra.deleted = 0 - AND r.ResourceTypeId IN(6) --AND ra.ActivityStart >= DATEADD(MONTH, -6, SYSDATETIMEOFFSET()) + AND r.ResourceTypeId IN(6) ) SELECT Top 8 ActivityId, LaunchResourceActivityId, @@ -79,6 +79,7 @@ SELECT Top 8 ActivityId, ActivityDurationSeconds, ScorePercentage FROM CTERecentActivities -WHERE rn = 1 order by ActivityDate desc; +WHERE rn = 1 AND ActivityStatus IN (2,4,7) +order by ActivityDate desc; END \ No newline at end of file diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserRecentLearningActivities.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserRecentLearningActivities.sql index 62bf9aac..0f9c6d69 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserRecentLearningActivities.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Activity/GetUserRecentLearningActivities.sql @@ -60,14 +60,7 @@ BEGIN LEFT JOIN [activity].[ScormActivity] sa ON sa.ResourceActivityId = ra.Id WHERE ra.LaunchResourceActivityId IS NULL AND ra.userid = @userId AND ra.deleted = 0 - AND r.ResourceTypeId IN(2,6,7,10,11) AND ra.ActivityStart >= DATEADD(MONTH, -6, SYSDATETIMEOFFSET()) - AND ( - @activityStatuses IS NULL OR - ISNULL(ara.ActivityStatusId, ra.ActivityStatusId) IN ( - SELECT TRY_CAST(value AS INT) - FROM STRING_SPLIT(@activityStatuses, ',') - WHERE TRY_CAST(value AS INT) IS NOT NULL) - ) + AND r.ResourceTypeId IN(2,6,7,10,11) AND ra.ActivityStart >= DATEADD(MONTH, -6, SYSDATETIMEOFFSET()) ) SELECT ActivityId, LaunchResourceActivityId, @@ -88,6 +81,14 @@ SELECT ActivityId, ActivityDurationSeconds, ScorePercentage FROM CTERecentActivities -WHERE rn = 1 order by ActivityDate desc; +WHERE rn = 1 +AND ( + @activityStatuses IS NULL OR + ActivityStatus IN ( + SELECT TRY_CAST(value AS INT) + FROM STRING_SPLIT(@activityStatuses, ',') + WHERE TRY_CAST(value AS INT) IS NOT NULL) + ) +order by ActivityDate desc; END \ No newline at end of file diff --git a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetUsercertificateDetails.sql b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetUsercertificateDetails.sql index 560c892b..e69f0a1e 100644 --- a/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetUsercertificateDetails.sql +++ b/WebAPI/LearningHub.Nhs.Database/Stored Procedures/Resources/GetUsercertificateDetails.sql @@ -7,6 +7,7 @@ -- -- 22-08-2025 Tobi Initial Revision -- 16-09-2025 Tobi Added null check for ResourceReferenceID +--17-09-2025 Swapna Added resource version id ------------------------------------------------------------------------------- CREATE PROCEDURE [resources].[GetUsercertificateDetails] @UserId INT, @@ -97,7 +98,8 @@ BEGIN rv.MinorVersion, COALESCE(ra.ActivityEnd, ra.ActivityStart) AS AwardedDate, NULL AS CertificateDownloadUrl, - NULL AS CertificatePreviewUrl + NULL AS CertificatePreviewUrl, + rv.Id AS ResourceVersionId FROM #MyActivity ma JOIN activity.ResourceActivity ra ON ra.Id = ma.ResourceActivityId diff --git a/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj b/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj index 2dd1530c..658a8a40 100644 --- a/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj +++ b/WebAPI/LearningHub.Nhs.Repository.Interface/LearningHub.Nhs.Repository.Interface.csproj @@ -10,7 +10,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj b/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj index 4c233236..35d9b5e0 100644 --- a/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj +++ b/WebAPI/LearningHub.Nhs.Repository/LearningHub.Nhs.Repository.csproj @@ -9,7 +9,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj b/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj index 3175c5ab..33bf0241 100644 --- a/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj +++ b/WebAPI/LearningHub.Nhs.Services.Interface/LearningHub.Nhs.Services.Interface.csproj @@ -16,7 +16,7 @@ - + all diff --git a/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj b/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj index f50d7fe4..7b9f02fe 100644 --- a/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj +++ b/WebAPI/LearningHub.Nhs.Services.UnitTests/LearningHub.Nhs.Services.UnitTests.csproj @@ -13,7 +13,7 @@ - + diff --git a/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj b/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj index 89415e49..12d1cbb9 100644 --- a/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj +++ b/WebAPI/LearningHub.Nhs.Services/LearningHub.Nhs.Services.csproj @@ -13,7 +13,7 @@ - + diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj index 0f50a34c..dcc7657b 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.ConsoleApp/LearningHub.Nhs.Migration.ConsoleApp.csproj @@ -25,7 +25,7 @@ - + all diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj index 02e89854..0ccf9ca0 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Interface/LearningHub.Nhs.Migration.Interface.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj index 2a28363b..cc2179cc 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Models/LearningHub.Nhs.Migration.Models.csproj @@ -10,7 +10,7 @@ - + all diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj index b00ab3f6..4510eab2 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.Staging.Repository/LearningHub.Nhs.Migration.Staging.Repository.csproj @@ -9,7 +9,7 @@ - + diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj index 790a74dc..0e4c13b4 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration.UnitTests/LearningHub.Nhs.Migration.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj b/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj index 62302442..4e0eb630 100644 --- a/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj +++ b/WebAPI/MigrationTool/LearningHub.Nhs.Migration/LearningHub.Nhs.Migration.csproj @@ -12,7 +12,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive